我有一個數據幀的對象,DF如下:熊貓繪圖功能給ValueError異常:X和Y必須具有相同的第一維
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 4460 entries, 2013-04-02 00:24:14.655000 to 2013-05-01 08:05:37.820000
Columns: 3928 entries, 0.36813255,37.5913675 to 9.99963814285,76.3137843191
dtypes: float64(3928)
df.plot()給我
ValueError: x and y must have same first dimension
有作爲數據幀中沒有NaN值。奇怪的是,某些範圍的數據框確實打好了。例如下面的工作:
df.ix[:,:3].plot()
任何想法可能發生什麼?
編輯:
的樣本數據:
lat_lng 0.36813255,37.5913675 1.33731422941,103.965656679
date
2013-04-02 00:24:14.655000 0 0
2013-04-02 08:05:39.719000 0 1
2013-04-02 08:16:56.986000 0 0
2013-04-02 08:18:00.408000 0 0
2013-04-02 08:18:38.530000 10 0
2013-04-02 08:24:02.663000 0 0
2013-04-02 08:24:27.286000 0 0
2013-04-02 08:24:46.466000 0 1
2013-04-02 08:25:32.366000 0 0
2013-04-02 08:25:52.018000 0 0
這不積:
lat_lng 0.36813255,37.5913675 1.33731422941,103.965656679 1.36110856929,103.886645147 10.0001097537,76.3023939556
date
2013-04-02 00:24:14.655000 0 0 0 0
2013-04-02 08:05:39.719000 0 0 0 0
2013-04-02 08:16:56.986000 0 0 0 0
2013-04-02 08:18:00.408000 0 0 0 0
2013-04-02 08:18:38.530000 0 0 0 0
2013-04-02 08:24:02.663000 0 0 0 0
2013-04-02 08:24:27.286000 0 0 0 0
2013-04-02 08:24:46.466000 0 0 0 0
2013-04-02 08:25:32.366000 0 0 0 0
2013-04-02 08:25:52.018000 0 0 0 0
你可以發佈數據本身嗎?什麼是你的熊貓和matplotlib版本? – 2013-05-07 10:03:44
這些值是0到100之間的數字。Pandas版本是0.11.0,ans matplotlib是1.2.1。 – Nithin 2013-05-07 10:28:39
這個樣本數據圖很好,但我期望整個數據集有4000個long_lats,每個數據集都有4500個日期時間會看起來很亂,幾乎肯定沒有用...... – 2013-05-07 11:00:07