[Pandas-dev] Towards deduplicating APIs and behaviors - level aggregations

Jeff Reback jeffreback at gmail.com
Mon Feb 22 12:16:59 EST 2021


yep this is prob ok to deprecate 

pls open an issue / PR

> On Feb 22, 2021, at 10:53 AM, Devin Petersohn <devin.petersohn at 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#L10549-L10558. 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 at python.org
> https://mail.python.org/mailman/listinfo/pandas-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/pandas-dev/attachments/20210222/4702599b/attachment.html>


More information about the Pandas-dev mailing list