相关疑难解决方法(0)

熊猫第二轴

我有以下数据框

    Date        A           B
0   2017-05-31  17453139    5.865738
1   2017-06-30  17425164    5.272728
2   2017-07-31  17480789    4.843094
Run Code Online (Sandbox Code Playgroud)

当我运行这个:

df.plot(x='Date', y='A')
df.B.plot(secondary_y=True)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

> appdata\local\programs\python\python36\lib\site-packages\pandas\plotting\_timeseries.py
> in format_dateaxis(subplot, freq, index)
>     335             TimeSeries_TimedeltaFormatter())
>     336     else:
> --> 337         raise TypeError('index type not supported')
>     338 
>     339     pylab.draw_if_interactive()
> 
> TypeError: index type not supported
Run Code Online (Sandbox Code Playgroud)

我的图看起来像下面的错误(蓝色和红色应该重叠): 蓝色和红色应该重叠

pandas

3
推荐指数
1
解决办法
3717
查看次数

标签 统计

pandas ×1