我将展示代码的相关部分。
如果我选择 tacf.head。
import matplotlib.pyplot as plt
tacf = pd.DataFrame(data_acf)
print (type(tacf))
plt.bar(tacf,height=2.0)
plt.show()
输出
<class 'pandas.core.frame.DataFrame'>
File "/home/jh/miniconda3/lib/python3.6/site-packages/matplotlib/patches.py", line 351, in set_linewidth
self._linewidth = float(w)
TypeError: float() argument must be a string or a number, not 'NoneType'
如果我选择 tacf.head。
<bound method NDFrame.head of 0
0 1.000000
1 0.942361
2 0.863303
3 0.794420
4 0.727603
5 0.671579
6 0.622612
7 0.570949
8 0.529410
9 0.497035
10 0.485163
11 0.479443
12 0.461094
13 0.444726
14 0.436634
我对bars、args和kwargs感到困惑。我应该将dataframe转换为不同类型还是...?
如何使用Matplotlib将dataframe绘制成条形图?
tacf.head()
的翻译是:tacf.head()
。 - DYZ