-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: support area-weighted mean in dissolve #3028
Comments
Hi @martinfleis |
Any updates on this feature? |
I don't think so. If you'd like to give it a go, please do. |
hi @martinfleis, I noted this issue had gotten a bit stale so thought I might put forward an approach to it. It's preliminary and rough but I think it shows what I'm thinking of: https://github.com/nicholas-ys-tan/geopandas/tree/issue3028 It is however, quite dissatisfying that the adjustments are made at 2 parts within the function to create an area-weighted mean, but it does preserve the use of aggfunc and any kwargs that may be passed in. Keen to hear your thoughts and feedback, if you think this is an appropriate direction, I'll do some refining, tests and documentation to go with it. |
@nicholas-ys-tan Can you turn it into a draft pull request? It will be easier to review and comment code. |
Dissolve offers all aggregations supported by pandas groupby as well as custom functions, but neither of those can easily do area-weighted mean, which is what you'd need when dealing with intensive variables.
We should figure out a way of supporting that. It would ideally be an option in
aggfunc
, if that wouldn't get too complex due to variability of what aggfunc can consume.The text was updated successfully, but these errors were encountered: