我想使用matplotlib
绘制直方图,但遇到以下错误:
MatplotlibDeprecationWarning:在Matplotlib 3.6中已弃用resize_event函数,并将在两个次要版本后删除。改为使用callbacks.process('resize_event',ResizeEvent(...))。
这是我的代码;欢迎对我如何清理逻辑表达式提出反馈。
lower_quartile = df['2020 Population'].quantile(0.25)
mid_quartile = df['2020 Population'].quantile(0.5)
upper_quartile = df['2020 Population'].quantile(0.75)
new_data = df.loc[df['2020 Population'] > lower_quartile]
final_2020_range = new_data.loc[df['2020 Population'] < upper_quartile]
check = final_2020_range['2020 Population']
plt.hist(check)