Towards deduplicating APIs and behaviors - level aggregations
Hi team, I was hoping to open a discussion on deduplicating and ideally simplifying the pandas API. There are multiple cases where certain operations are able to be called many different ways. For concreteness, I propose to start with the `level` parameter to aggregations. In the wild, I do not see a significant number of uses of the `level` parameter for sum/prod/count/etc. Internally, it is simply rewritten as a groupby: https://github.com/pandas-dev/pandas/blob/v1.2.2/pandas/core/generic.py#L105.... My proposal is that the `level` parameter to these aggregations be deprecated in favor of `groupby` with the `level` parameter. To me at least, the `groupby` syntax is more clear about what to expect in terms of output. I am happy to help contribute the changes necessary. I can also open an issue if GitHub is a better place for this discussion. Devin
yep this is prob ok to deprecate pls open an issue / PR
On Feb 22, 2021, at 10:53 AM, Devin Petersohn <devin.petersohn@gmail.com> wrote:
Hi team,
I was hoping to open a discussion on deduplicating and ideally simplifying the pandas API. There are multiple cases where certain operations are able to be called many different ways. For concreteness, I propose to start with the `level` parameter to aggregations.
In the wild, I do not see a significant number of uses of the `level` parameter for sum/prod/count/etc. Internally, it is simply rewritten as a groupby: https://github.com/pandas-dev/pandas/blob/v1.2.2/pandas/core/generic.py#L105.... My proposal is that the `level` parameter to these aggregations be deprecated in favor of `groupby` with the `level` parameter. To me at least, the `groupby` syntax is more clear about what to expect in terms of output.
I am happy to help contribute the changes necessary. I can also open an issue if GitHub is a better place for this discussion.
Devin _______________________________________________ Pandas-dev mailing list Pandas-dev@python.org https://mail.python.org/mailman/listinfo/pandas-dev
participants (2)
-
Devin Petersohn -
Jeff Reback