Created
August 2, 2024 12:12
-
-
Save jens-andersson-2-wcar/8e44e9b444a2736e77c0060e82a66b77 to your computer and use it in GitHub Desktop.
Aggregating data by H3 cell; be careful with angles!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
positions_df_byhex = df_subset.groupby("hex_id", as_index=False).agg({ | |
"longitude": "mean", | |
"latitude": "mean", | |
"vector_component_x": "mean", | |
"vector_component_y": "mean", | |
"bearing": "count", # "mean" would be wrong here; we need circmean | |
"speed_kmh": "mean" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment