请告诉我如何绘制列的平均值的输出。enter image description here
piv4azn71#
绘制df.mean()import matplotlib as plt的图形,然后执行df.mean().plot(kind='bar')
import matplotlib as plt
df.mean().plot(kind='bar')
c0vxltue2#
import pandas as pd import matplotlib.pyplot as plt data = { 'Store': ['storeA', 'storeB', 'storeC', 'storeD', 'storeE'], 'Mean': [5865.480, 6756.710, 4942.105, 5431.405, 2580.025] } df = pd.DataFrame(data) # plot df df.plot(kind='bar', x='Store', y='Mean', color='red', xlabel='Store', ylabel='Value') plt.show()
2条答案
按热度按时间piv4azn71#
绘制df.mean()
import matplotlib as plt
的图形,然后执行df.mean().plot(kind='bar')
c0vxltue2#