我有两个数据帧,例如
>>>df1
datetime id
2018-01-01 1:00:11 abc
2018-01-01 12:00:00 flllds
>>>df2
datetime2 id
2018-01-01 1:30:11 abc
2018-01-01 1:30:32 abc
2018-01-01 2:30:32 abc
2018-01-01 12:00:00 flllds
我必须加入基于id
的数据帧,并选择datetime - datetime2
<;1小时的行
我的问题是我的数据帧很大,所以当我 先合并,然后根据条件筛选。你知道吗
有没有办法在合并期间限制数据帧的大小?你知道吗
df = pd.merge(df1, df2, on=['id'])
目前没有回答
相关问题 更多 >
编程相关推荐