Error in Tutorial Using Excel with Python and Pandas

There is an error in Tutorial Using Excel with Python and Pandas.

In “reading a subset of columns” topic there is a code:

movies_subset_columns = pd.read_excel(excel_file, parse_cols=6)
movies_subset_columns.head()

There should be:

movies_subset_columns = pd.read_excel(excel_file, usecols=6)
movies_subset_columns.head()

The argument parse_cols is expired. Now there is usecols

this one doesn’t work too:

sorted_movies = movies[['Net Earnings']].sort_values(['Net Earnings'], ascending=[False])sorted_movies.head(10)['Net Earnings'].plot.barh()
plt.show()

…but I don’t know why. I think someone should check last half of this lesson.

@drill_n_bass: I think this is a versioning issue. DQ’s platform is still on the older version of pandas. Not too sure about the specific version but this is the documentation for version 0.20 and the latest one 1.2.0, thus the errors will be generated so please use the updated documentation as reference when following along with the walk through.

Hope this clarifies.

@drill_n_bass: I think this is a versioning issue. DQ’s platform is still on the older version of pandas. Not too sure about the specific version but this is the documentation for version 0.20 and the latest one 1.2.0, thus the errors will be generated so please use the updated documentation as reference when following along with the walk through.

Edit: DQ uses version 0.22 (should be similar to 0.20) and you can use this block of code to check your locally installed version.

import pandas as pd 
print(pd.__version__)

Hope this clarifies.