Use the hist method to display a histogram of the "Weight" column from the mens_rowing DataFrame, label this as "Rowing"

动态 未结 0 84
小小草
小小草 LV1 2023年9月23日 23:40 发表
下面是完整代码: ```python fig, ax = plt.subplots() # Plot a histogram of "Weight" for mens_rowing ax.hist(mens_rowing["Weight"], bins=5, histtype="step", label="Rowing") # Compare to histogram of "Weight" for mens_gymnastics ax.hist(mens_gymnastics["Weight"], bins=5, histtype="step", label="Gymnastics") ax.set_xlabel("Weight (kg)") ax.set_ylabel("# of observations") # Add the legend and show the Figure ax.legend() plt.show() ```
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复