def f(genre):
if genre=="Action":
plt.bar(df2.Name[:5], df2.Global_Sales[:5])
elif genre=="Adventure":
plt.bar(df2.Name[5:10], df2.Global_Sales[5:10])
How do you shorten the code as dataframe cosnsist of many rows and I want to avoid using if ,elif for thee data frame
Aucun commentaire:
Enregistrer un commentaire