I have two DataFrames with Lat
, Long
columns and other additional columns. For example,
import pandas as pd
import geopandas as gpd
df1 = pd.DataFrame({
'id': [0, 1, 2],
'dt': [01-01-2022, 02-01-2022, 03-01-2022],
'Lat': [33.155480, 33.155480, 33.155480],
'Long': [-96.731630, -96.731630, -96.731630]
})
df2 = pd.DataFrame({
'val': ['a', 'b', 'c'],
'dt': [01-01-2022, 02-01-2022, 03-01-2022],
'Lat': [33.155480, 33.155480, 33.155480],
'Long': [-96.731630, -96.731630, -96.731630]
})
I'd like to do a spatial join not just on lat
, long
but also on date column. Expected output:
id | dt | lat | long | val |
---|---|---|---|---|
0 | 01-01-2022 | 33.155480 | -96.731630 | a |
1 | 02-01-2022 | 33.155480 | -96.731630 | b |
2 | 03-01-2022 | 33.155480 | -96.731630 | c |
sjoin
does not work.