Jul-01-2020, 01:48 AM
You need to set the index as these fields as shown below:
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df_interested = pd.read_csv(r'C:\Users\mirza\Downloads\Topic_Survey_Assignment.csv',index_col="Unnamed: 0") interested = df_interested.sort_values(['Very interested'], ascending = False, axis = 0, inplace = True) df_interested.plot(kind = 'bar', figsize = (20,8), width = 0.8, color=['#5cb85c', '#5bc0de', '#d9534f']) plt.title('Pourcentage of respondents interest in Data Science Areas', size = 16) plt.legend(prop={"size":14}) sns.despine() sns.despine(top=True, right=True, left=True, bottom=False) plt.xlabel("X Label") plt.ylabel("Y Label") ax = plt.gca() # ax.axes.xaxis.set_visible(False) # ax.axes.yaxis.set_visible(False) plt.grid(True) plt.show()To know about data visualization and pandas, have a look at these articles