So, i’m trying to plot and wrote this
wnba = pd.read_csv('wnba.csv') pts_sample =  for lap in range(100): sample = wnba['PTS'].sample(n=10, random_state=lap) pts_sample.append(sample.mean()) plt.scatter(range(1,101), pst_sample) plt.axhline(wnba['PTS'].mean()) plt.show()
What I expected to happen: I expected a scatter plot and it should print a scatter plot
What actually happened:
ValueError: x and y must be the same size
But the interesting thing is that after reading my code multiple times and trying to find an error i checked the answer and to be honest i don’t find any difference between my code and the answer code. So why i’m getting an error?
wnba = pd.read_csv('wnba.csv') sample_means =  population_mean = wnba['PTS'].mean() for i in range(100): sample = wnba['PTS'].sample(10, random_state=i) sample_means.append(sample.mean()) plt.scatter(range(1,101), sample_means) plt.axhline(population_mean)