现在我有一个 DataFrame “df”,如下所示:
In [28]: df[:100]
Out[28]:
distkm modlat modlon reallat reallon time
0 9.325590 42.423024 -70.512309 42.5040 -70.5419 731800.5514
1 9.286476 42.416112 -70.519175 42.4956 -70.5539 731800.6319
0 4.456535 42.423877 -70.408784 42.4292 -70.4626 731802.0660
1 6.393979 42.405980 -70.367245 42.4297 -70.4382 731802.1556
2 7.447289 42.389719 -70.343267 42.4259 -70.4196 731802.2312
0 4.456535 42.423877 -70.408784 42.4292 -70.4626 731802.0660
1 6.393979 42.405980 -70.367245 42.4297 -70.4382 731802.1556
2 7.447289 42.389719 -70.343267 42.4259 -70.4196 731802.2312
3 7.329755 42.370420 -70.340029 42.4134 -70.4077 731802.3208
4 6.817408 42.355624 -70.337595 42.3942 -70.4021 731802.3972
0 ...
1 ...
我想通过“df.index”来分隔 DataFrame,例如:
distkm modlat modlon reallat reallon time
0 9.325590 42.423024 -70.512309 42.5040 -70.5419 731800.5514
1 9.286476 42.416112 -70.519175 42.4956 -70.5539 731800.6319
distkm modlat modlon reallat reallon time
0 4.456535 42.423877 -70.408784 42.4292 -70.4626 731802.0660
1 6.393979 42.405980 -70.367245 42.4297 -70.4382 731802.1556
2 7.447289 42.389719 -70.343267 42.4259 -70.4196 731802.2312
distkm modlat modlon reallat reallon time
0 4.456535 42.423877 -70.408784 42.4292 -70.4626 731802.0660
1 6.393979 42.405980 -70.367245 42.4297 -70.4382 731802.1556
2 7.447289 42.389719 -70.343267 42.4259 -70.4196 731802.2312
3 7.329755 42.370420 -70.340029 42.4134 -70.4077 731802.3208
4 6.817408 42.355624 -70.337595 42.3942 -70.4021 731802.3972
然后将这些小“df”绘制为图形。我该如何处理?我尝试了“groupby(df.index)”,但结果不是我想要的,它只是将每个相同的索引号组合在一起。