gL i!!ddZddlZddlZddlmZmZddlmZmZm Z ddl m Z m Z dZ dZdZd Zy) z Tests of the groupby API, including internal consistency and with other pandas objects. Tests in this file should only check the existence, names, and arguments of groupby methods. It should not test the results of any groupby operation. N) DataFrameSeries)groupby_other_methodsreduction_kernelstransformation_kernels)DataFrameGroupBy SeriesGroupByc|jd}t|Dchc]}|jdr|}}hd}||k(sJycc}w)Nsecond)level_>BABCaggallanycovewmmaxminnthsemstdsumvarcorrdiffheadhistlastmeanndimohlcpipeplotprodranksizeskewtailtakeapplybfillcountffillfirstshiftcummaxcummincumsumdtypesfillnafiltergroupsidxmaxidxminmedianngroupsampleboxplotcumprodindicesngroupsnuniquerollingcorrwithcumcountdescribequantileresample aggregate expanding get_group transform pct_change value_counts)groupbydir startswith) multiindex_dataframe_random_datagrpvresultsexpecteds c/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/groupby/test_api.pytest_tab_completionrYsV * 2 2 2 BCc( EE I ""I ''I &&I #999 9 #888 8%(=== =   S!!(*@@CXXO 5S!! A ;s C8C8c|dvrd}tj||dvrtt|rJyt t|}t t |}t tj|j}|dk(rdh}n(t tj|j}t t }}|dvrhd}nl|d vrd d h}nc|d vrd h}n[|d vr hd}hd}nN|dvr hd}ddh}nA|dvrhd}n8|dvrhd}n/|dvrddh}d h}n#|dvrdh}n|dvrdh}d h}n|dvrd h}n|dvrdd h}||z|k(sJ||z|k(sJ||z}||z}||k(sJy)Nr1r!z?first and last are entirely different between frame and groupby)reason)rFr=r)selfrr>axiskwargs bool_only)r/ numeric_onlyri)rCrr>rirjskipna>engine min_count engine_kwargsr"rrrrorqr<r'rbackfillr.r0pad>riinplacedowncast limit_arear3r4rnargsr@r5rNrjr(rHmethod) pytestskiphasattrrgetattrrr\inspect signature parameters) groupby_funcra frame_method gb_methodresultrWexclude_expectedexclude_results rXtest_frame_consistencyrs((O 3--9l3339l3L(,7I ""9-88 9Fv8w((6AAB(+ucen~%:  #*F3  %"8  '7A 6 67"O4 2 27 > >H - -$f-() . .$:  ($:   "*+  &$f- N "n 44 4 & &*: :: : nF   H X  c|dvrtjd|dvrtt|rJyt t|}t t |}t tj|j}|dk(rdh}n(t tj|j}t t }}|dvrhd}nk|dvrd h}nc|d vr hd }hd }nV|d vr hd }ddh}nI|dvrhd }n@|dvrhd}n7|dvrddh}dh}n+|dvrdh}n#|dvrdh}d h}n|dvrdh}n|dvrddh}n|dvrdh}||z|k(sJ||z|k(sJ||z}||z}||k(sJy)Nrez@first and last are entirely different between Series and groupby)rFrEr=r)rgrh>rirjrk)rrirm>rirjrn>rorprqrrrorqrsrt>rirwrxryrzrnr{rlr|r}rjr~)r;r:r) rrrrrr r\rrr)requestr series_methodrrrWrrs rXtest_series_consistencyrs(( VW996<000FL1M |4I ""9-88 9Fv8w((7BBC(+ucen~%:  "   '7A 6 67"O4 2 27 > >H - -$f-() . .$:  ($:   "*+ - -"H-  &() N "n 44 4 & &*: :: : nF   H X  r)__doc__rrpandasrrpandas.core.groupby.baserrrpandas.core.groupby.genericrr rYrcrrrrXrs>   GT-"`9x8r