【发布时间】:2020-01-05 15:56:49
【问题描述】:
x=pd.DataFrame(np.random.randn(400))
fig, axs = plt.subplots(2, 2, sharey=True, tight_layout=True, figsize=(10,5));
for idx in range(3):
axs[idx].hist(x, bins=20)
axs[idx].hist(x, bins=40)
axs[idx].hist(x, bins=60)
axs[idx].hist(x, bins=100)
当我运行上面的代码时;我收到此错误
AttributeError: 'numpy.ndarray' 对象没有属性 'hist';
你能解决这个问题吗?
【问题讨论】:
标签: python pandas numpy matplotlib histogram