我正试图解决一个关于edx的问题,但我似乎不能正确回答。在
尽管图表显示系统显示“你打电话了吗表演()两次?”在
在输出中还显示了以下内容:
array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f86702755c0>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f867020dbe0>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f867022c198>],
dtype=object)
如有任何帮助,我们将不胜感激。谢谢
基于之前的练习。。。。 数据源:https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/recent-grads.csv
现在你有兴趣画出几个不同的平均分位数 主要类别的薪水,这样你就可以比较不同的分配 薪水。在本练习中,您将为matplotlib准备数据。在
说明书
列median、p25th和p75th当前被编码为字符串。转换这些 列到数值。然后,将每列的值除以1000,使 最终绘图的比例尺更容易阅读。在
找到每个主要类别的三列中的每一列。把这个保存为sal_quantiles
import pandas as pd
# Convert to numeric and divide by 1000
recent_grads['median'] = pd.to_numeric(recent_grads['median'])/ 1000
recent_grads['p25th'] = pd.to_numeric(recent_grads['p25th'])/ 1000
recent_grads['p75th'] = pd.to_numeric(recent_grads['p75th'])/ 1000
# Select averages by major category
columns = ['median', 'p25th', 'p75th']
sal_quantiles = recent_grads.groupby(['major_category'])['median', 'p25th', 'p75th'].mean()
print(sal_quantiles)
在应用
subplot=True
以通过评估后,您需要再次显示图像,即plt.show()
。在相关问题 更多 >
编程相关推荐