df_type = df.groupby(by='type1') df_type_con = df_type.count() plt.rcParams['font.sans-serif'] = 'Microsoft YaHei' %config InlineBackend.figure_format = 'svg' df_type_con.plot(kind='bar')
代码不只这几行吧