Inactive Tutor answered 07/03/21
you are comparing 2 non-numeric values, title and language. in barplots the y variable is supposed to be numeric. Try using budget in place of language and language in place of title.
Ethan C.
asked 06/10/21# Give filepath here to the variable filepath
filepath = '/content/drive/MyDrive/ColabNotebooks/IMDbmovies.csv'
# Import "pandas" package here
import pandas as pd
This code below is Python programming below but getting an error, please advise, also the code above is part of the code below.
Give a bar plot of top 10 English movies based on the budget. The movie is rank 1 if it has the highest budget.
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('paper')
# load dataset
IMDbmovies = sns.load_dataset('IMDbmovies.csv')
# createanic plot
sns.barplot(x = 'title', y = 'language', data = budget,
palette = 'PuRd',ci=None
)
plt.legend()
plt.show()
print(IMDBmovies.columns)
Inactive Tutor answered 07/03/21
you are comparing 2 non-numeric values, title and language. in barplots the y variable is supposed to be numeric. Try using budget in place of language and language in place of title.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.