18
18
from pandas import DataFrame , Series
19
19
from pandas .core .generic import NDFrame
20
20
21
- from pandas .compat .numpy import function as nv
22
21
from pandas .util ._decorators import doc
23
22
24
23
from pandas .core .dtypes .common import (
37
36
get_jit_arguments ,
38
37
maybe_use_numba ,
39
38
)
40
- from pandas .core .window .common import (
41
- maybe_warn_args_and_kwargs ,
42
- zsqrt ,
43
- )
39
+ from pandas .core .window .common import zsqrt
44
40
from pandas .core .window .doc import (
45
41
_shared_docs ,
46
- args_compat ,
47
42
create_section_header ,
48
- kwargs_compat ,
49
43
kwargs_numeric_only ,
50
44
numba_notes ,
51
45
template_header ,
@@ -503,9 +497,7 @@ def aggregate(self, func, *args, **kwargs):
503
497
template_header ,
504
498
create_section_header ("Parameters" ),
505
499
kwargs_numeric_only ,
506
- args_compat ,
507
500
window_agg_numba_parameters (),
508
- kwargs_compat ,
509
501
create_section_header ("Returns" ),
510
502
template_returns ,
511
503
create_section_header ("See Also" ),
@@ -519,12 +511,9 @@ def aggregate(self, func, *args, **kwargs):
519
511
def mean (
520
512
self ,
521
513
numeric_only : bool = False ,
522
- * args ,
523
514
engine = None ,
524
515
engine_kwargs = None ,
525
- ** kwargs ,
526
516
):
527
- maybe_warn_args_and_kwargs (type (self ), "mean" , args , kwargs )
528
517
if maybe_use_numba (engine ):
529
518
if self .method == "single" :
530
519
func = generate_numba_ewm_func
@@ -542,7 +531,6 @@ def mean(
542
531
elif engine in ("cython" , None ):
543
532
if engine_kwargs is not None :
544
533
raise ValueError ("cython engine does not accept engine_kwargs" )
545
- nv .validate_window_func ("mean" , args , kwargs )
546
534
547
535
deltas = None if self .times is None else self ._deltas
548
536
window_func = partial (
@@ -561,9 +549,7 @@ def mean(
561
549
template_header ,
562
550
create_section_header ("Parameters" ),
563
551
kwargs_numeric_only ,
564
- args_compat ,
565
552
window_agg_numba_parameters (),
566
- kwargs_compat ,
567
553
create_section_header ("Returns" ),
568
554
template_returns ,
569
555
create_section_header ("See Also" ),
@@ -577,12 +563,9 @@ def mean(
577
563
def sum (
578
564
self ,
579
565
numeric_only : bool = False ,
580
- * args ,
581
566
engine = None ,
582
567
engine_kwargs = None ,
583
- ** kwargs ,
584
568
):
585
- maybe_warn_args_and_kwargs (type (self ), "sum" , args , kwargs )
586
569
if not self .adjust :
587
570
raise NotImplementedError ("sum is not implemented with adjust=False" )
588
571
if maybe_use_numba (engine ):
@@ -602,7 +585,6 @@ def sum(
602
585
elif engine in ("cython" , None ):
603
586
if engine_kwargs is not None :
604
587
raise ValueError ("cython engine does not accept engine_kwargs" )
605
- nv .validate_window_func ("sum" , args , kwargs )
606
588
607
589
deltas = None if self .times is None else self ._deltas
608
590
window_func = partial (
@@ -627,8 +609,6 @@ def sum(
627
609
"""
628
610
).replace ("\n " , "" , 1 ),
629
611
kwargs_numeric_only ,
630
- args_compat ,
631
- kwargs_compat ,
632
612
create_section_header ("Returns" ),
633
613
template_returns ,
634
614
create_section_header ("See Also" ),
@@ -637,9 +617,7 @@ def sum(
637
617
aggregation_description = "(exponential weighted moment) standard deviation" ,
638
618
agg_method = "std" ,
639
619
)
640
- def std (self , bias : bool = False , numeric_only : bool = False , * args , ** kwargs ):
641
- maybe_warn_args_and_kwargs (type (self ), "std" , args , kwargs )
642
- nv .validate_window_func ("std" , args , kwargs )
620
+ def std (self , bias : bool = False , numeric_only : bool = False ):
643
621
if (
644
622
numeric_only
645
623
and self ._selected_obj .ndim == 1
@@ -649,7 +627,7 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
649
627
raise NotImplementedError (
650
628
f"{ type (self ).__name__ } .std does not implement numeric_only"
651
629
)
652
- return zsqrt (self .var (bias = bias , numeric_only = numeric_only , ** kwargs ))
630
+ return zsqrt (self .var (bias = bias , numeric_only = numeric_only ))
653
631
654
632
@doc (
655
633
template_header ,
@@ -661,8 +639,6 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
661
639
"""
662
640
).replace ("\n " , "" , 1 ),
663
641
kwargs_numeric_only ,
664
- args_compat ,
665
- kwargs_compat ,
666
642
create_section_header ("Returns" ),
667
643
template_returns ,
668
644
create_section_header ("See Also" ),
@@ -671,9 +647,7 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
671
647
aggregation_description = "(exponential weighted moment) variance" ,
672
648
agg_method = "var" ,
673
649
)
674
- def var (self , bias : bool = False , numeric_only : bool = False , * args , ** kwargs ):
675
- maybe_warn_args_and_kwargs (type (self ), "var" , args , kwargs )
676
- nv .validate_window_func ("var" , args , kwargs )
650
+ def var (self , bias : bool = False , numeric_only : bool = False ):
677
651
window_func = window_aggregations .ewmcov
678
652
wfunc = partial (
679
653
window_func ,
@@ -708,7 +682,6 @@ def var_func(values, begin, end, min_periods):
708
682
"""
709
683
).replace ("\n " , "" , 1 ),
710
684
kwargs_numeric_only ,
711
- kwargs_compat ,
712
685
create_section_header ("Returns" ),
713
686
template_returns ,
714
687
create_section_header ("See Also" ),
@@ -723,11 +696,9 @@ def cov(
723
696
pairwise : bool | None = None ,
724
697
bias : bool = False ,
725
698
numeric_only : bool = False ,
726
- ** kwargs ,
727
699
):
728
700
from pandas import Series
729
701
730
- maybe_warn_args_and_kwargs (type (self ), "cov" , None , kwargs )
731
702
self ._validate_numeric_only ("cov" , numeric_only )
732
703
733
704
def cov_func (x , y ):
@@ -783,7 +754,6 @@ def cov_func(x, y):
783
754
"""
784
755
).replace ("\n " , "" , 1 ),
785
756
kwargs_numeric_only ,
786
- kwargs_compat ,
787
757
create_section_header ("Returns" ),
788
758
template_returns ,
789
759
create_section_header ("See Also" ),
@@ -797,11 +767,9 @@ def corr(
797
767
other : DataFrame | Series | None = None ,
798
768
pairwise : bool | None = None ,
799
769
numeric_only : bool = False ,
800
- ** kwargs ,
801
770
):
802
771
from pandas import Series
803
772
804
- maybe_warn_args_and_kwargs (type (self ), "corr" , None , kwargs )
805
773
self ._validate_numeric_only ("corr" , numeric_only )
806
774
807
775
def cov_func (x , y ):
@@ -940,7 +908,6 @@ def corr(
940
908
other : DataFrame | Series | None = None ,
941
909
pairwise : bool | None = None ,
942
910
numeric_only : bool = False ,
943
- ** kwargs ,
944
911
):
945
912
raise NotImplementedError ("corr is not implemented." )
946
913
@@ -950,11 +917,10 @@ def cov(
950
917
pairwise : bool | None = None ,
951
918
bias : bool = False ,
952
919
numeric_only : bool = False ,
953
- ** kwargs ,
954
920
):
955
921
raise NotImplementedError ("cov is not implemented." )
956
922
957
- def var (self , bias : bool = False , * args , ** kwargs ):
923
+ def var (self , bias : bool = False , numeric_only : bool = False ):
958
924
raise NotImplementedError ("var is not implemented." )
959
925
960
926
def mean (self , * args , update = None , update_times = None , ** kwargs ):
0 commit comments