gpt4 book ai didi

python - Pandas DataFrame.hist() 不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 09:41:27 24 4
gpt4 key购买 nike

我学习了关于机器学习的谷歌类(class)。我在这部分:pandas

但是在我的 mac 上,当我想用​​这个命令生成图表时:

california_housing_dataframe.hist('housing_median_age')

这是行不通的。出现 python 图标,但屏幕上没有显示任何内容。

我看到一些关于后端参数到 matplotlibrc 的提示,但我的是等同于 MacOSX 并且它应该工作?

感谢帮助

最佳答案

详细说明 T. Kelly 的评论:

您需要调用 plt.show()。这对我有用:

import matplotlib.pyplot as plt
california_housing_dataframe.hist('housing_median_age')
plt.show()

关于python - Pandas DataFrame.hist() 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51519178/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com