Reputation: 1
I am watching Keith Galli's Tutorial on Matplotlib
This code is used to create a histogram. It gives me a Type Error on line 9
import matplotlib.pyplot as plt
import pandas as pd
fifa = pd.read_csv(r"C:\Users\luchc\Downloads\fifa_data.csv.txt")
bins = [0,10,20,30,40,50,60,70,80,90,100]
plt.hist(fifa['Overall'], bins=bins)
plt.xticks(bins)
plt.xlabel('Overall')
plt.ylabel('# of Players')
plt.title('Distribution of Overall of Players in FIFA18')
plt.show()
Upvotes: 0
Views: 47
Reputation: 186
replace
fifa = pd.read_csv(r"C:\Users\luchc\Downloads\fifa_data.csv.txt")
to
fifa = pd.read_csv(r"C:\Users\luchc\Downloads\fifa_data.csv")
Upvotes: 2