Py学习  »  Python

python数据帧的每年绘图框绘图

Thoth • 6 年前 • 1796 次点击  

我有以下数据框:

                    A        B         C  
Date                                                      
2015-04-20 -0.000585 -0.003030  0.000198  
2015-04-21 -0.001334 -0.001330  0.000712  
2015-04-22 -0.000967 -0.000317  0.002388  
2015-04-23 -0.004314 -0.001281  0.002453  
2015-04-24 -0.004910 -0.002032  0.002502 
...  

我想要一个方框图,它指的是每年的数值(a,B,C)(a/年方框图)。我试过这个 direction

df = pd.DataFrame(index=mydf.index.values,
                  data=mydf.values,               
                  columns=mydf.columns.values)
df['Year'] = mydf.index.year
ax = sns.boxplot(data=df, x='Year', y=mydf.index.values)
for item in ax.get_xticklabels():
   item.set_rotation(90)

和回报

值错误:所有数组的长度必须相同

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/54292
文章 [ 1 ]  |  最新文章 6 年前