从此:
Ordinal Timestamp id_easy lat/long
1 2016-06-01T08:18:46.000Z 22 (44.9484, 7.7728)
2 2016-06-01T08:28:05.000Z 22 (44.9503, 7.7748)
3 2016-06-01T08:28:09.000Z 22 (44.9503, 7.7748)
1 2016-06-01T06:31:05.000Z 16 (45.0314, 7.6181)
基于id_easy
的唯一值,并通过举例说明发生这种情况的时间范围:
Timestamp id_easy lat/long
08:18:46-08:28:09 22 (44.9484, 7.7728),(44.9503, 7.7748),(44.9503, 7.7748)
答案 0 :(得分:1)
您应该使用groupby()
函数。这可能是这样的:
df.groupby('id_easy').agg({'lat/long' : list, 'Timestamp':min})
输出:
id_easy lat/long \
0 16 [(45.0314,7.6181)]
1 22 [(44.9484,7.7728), (44.9503,7.7748), (44.9503,...
Timestamp
0 2016-06-01T06:31:05.000Z
1 2016-06-01T08:18:46.000Z