我有一个数据框对象,df 如下:
<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