0

次のステートメントを実行すると、次のようになります。

DataFrame(randn(3,1),index=[date(2012,10,1),date(2012,9,1),date(2012,8,1)],columns=['test']).plot() 

次の例外が発生します。

ファイル"/usr/local/lib/python2.7/dist-packages/pandas-0.10.0-py2.7-linux-x86_64.egg/pandas/tseries/converter.py"、行317、呼び出し中 (推定、 dmin、dmax、self.MAXTICKS * 2))RuntimeError:MillisecondLocatorは、2012-08-01 00:00:00 + 00:00から2012-10-01 00:00:00 + 00:00まで5270400ティックを生成すると推定されます: Locator.MAXTICKS * 2(2000)を超えています

このバグに対して利用可能な回避策はありますか?

4

1 に答える 1

0

1 つの回避策は、プロットする前にソートすることです。

df.sort().plot()

バグっぽいのでgithubに投稿しました!

注: date ではなく datetime を使用すると、これは目盛りをより適切にプロットするようです:

df1 = DataFrame(randn(3,1), index=[datetime(2012,10,1), datetime(2012,9,1), datetime(2012,8,1)], columns=['test'])
于 2012-12-28T21:31:00.183 に答える