绘制大熊猫0.21的错误

时间:2017-11-03 01:30:06

标签: python pandas

运行以下代码:     plt.fill_between(df.index.unique(),min_vals,max_vals)

我收到错误:

*** TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

df.index.unique()

DatetimeIndex(['2005-01-01', '2005-01-02', '2005-01-03', '2005-01-04',
               '2005-01-05', '2005-01-06', '2005-01-07', '2005-01-08',
               '2005-01-09', '2005-01-10',
               ...
               '2005-07-05', '2005-07-06', '2005-07-07', '2005-07-08',
               '2005-07-09', '2005-07-10', '2005-07-11', '2005-07-12',
               '2005-07-13', '2005-07-14'],
              dtype='datetime64[ns]', name='datetime', length=195, freq=None)

min_vals以及max_vals是与df.index.unique()长度相同的numpy数组。样品:

array([ 118.15219205,  118.09140844,  118.05368241,  118.01825058,
        117.9923672 ,  117.97512   ,  117.98164725,  117.96102018,
        117.93014226,  117.89721839])

我没有得到pandas版本0.20.3的这个错误,但我确实得到了pandas版本0.21的这个错误。如何解决这个问题?

0 个答案:

没有答案