1818 from pandas import DataFrame , Series
1919 from pandas .core .generic import NDFrame
2020
21- from pandas .compat .numpy import function as nv
2221from pandas .util ._decorators import doc
2322
2423from pandas .core .dtypes .common import (
3736 get_jit_arguments ,
3837 maybe_use_numba ,
3938)
40- from pandas .core .window .common import (
41- maybe_warn_args_and_kwargs ,
42- zsqrt ,
43- )
39+ from pandas .core .window .common import zsqrt
4440from pandas .core .window .doc import (
4541 _shared_docs ,
46- args_compat ,
4742 create_section_header ,
48- kwargs_compat ,
4943 kwargs_numeric_only ,
5044 numba_notes ,
5145 template_header ,
@@ -503,9 +497,7 @@ def aggregate(self, func, *args, **kwargs):
503497 template_header ,
504498 create_section_header ("Parameters" ),
505499 kwargs_numeric_only ,
506- args_compat ,
507500 window_agg_numba_parameters (),
508- kwargs_compat ,
509501 create_section_header ("Returns" ),
510502 template_returns ,
511503 create_section_header ("See Also" ),
@@ -519,12 +511,9 @@ def aggregate(self, func, *args, **kwargs):
519511 def mean (
520512 self ,
521513 numeric_only : bool = False ,
522- * args ,
523514 engine = None ,
524515 engine_kwargs = None ,
525- ** kwargs ,
526516 ):
527- maybe_warn_args_and_kwargs (type (self ), "mean" , args , kwargs )
528517 if maybe_use_numba (engine ):
529518 if self .method == "single" :
530519 func = generate_numba_ewm_func
@@ -542,7 +531,6 @@ def mean(
542531 elif engine in ("cython" , None ):
543532 if engine_kwargs is not None :
544533 raise ValueError ("cython engine does not accept engine_kwargs" )
545- nv .validate_window_func ("mean" , args , kwargs )
546534
547535 deltas = None if self .times is None else self ._deltas
548536 window_func = partial (
@@ -561,9 +549,7 @@ def mean(
561549 template_header ,
562550 create_section_header ("Parameters" ),
563551 kwargs_numeric_only ,
564- args_compat ,
565552 window_agg_numba_parameters (),
566- kwargs_compat ,
567553 create_section_header ("Returns" ),
568554 template_returns ,
569555 create_section_header ("See Also" ),
@@ -577,12 +563,9 @@ def mean(
577563 def sum (
578564 self ,
579565 numeric_only : bool = False ,
580- * args ,
581566 engine = None ,
582567 engine_kwargs = None ,
583- ** kwargs ,
584568 ):
585- maybe_warn_args_and_kwargs (type (self ), "sum" , args , kwargs )
586569 if not self .adjust :
587570 raise NotImplementedError ("sum is not implemented with adjust=False" )
588571 if maybe_use_numba (engine ):
@@ -602,7 +585,6 @@ def sum(
602585 elif engine in ("cython" , None ):
603586 if engine_kwargs is not None :
604587 raise ValueError ("cython engine does not accept engine_kwargs" )
605- nv .validate_window_func ("sum" , args , kwargs )
606588
607589 deltas = None if self .times is None else self ._deltas
608590 window_func = partial (
@@ -627,8 +609,6 @@ def sum(
627609 """
628610 ).replace ("\n " , "" , 1 ),
629611 kwargs_numeric_only ,
630- args_compat ,
631- kwargs_compat ,
632612 create_section_header ("Returns" ),
633613 template_returns ,
634614 create_section_header ("See Also" ),
@@ -637,9 +617,7 @@ def sum(
637617 aggregation_description = "(exponential weighted moment) standard deviation" ,
638618 agg_method = "std" ,
639619 )
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 ):
643621 if (
644622 numeric_only
645623 and self ._selected_obj .ndim == 1
@@ -649,7 +627,7 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
649627 raise NotImplementedError (
650628 f"{ type (self ).__name__ } .std does not implement numeric_only"
651629 )
652- return zsqrt (self .var (bias = bias , numeric_only = numeric_only , ** kwargs ))
630+ return zsqrt (self .var (bias = bias , numeric_only = numeric_only ))
653631
654632 @doc (
655633 template_header ,
@@ -661,8 +639,6 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
661639 """
662640 ).replace ("\n " , "" , 1 ),
663641 kwargs_numeric_only ,
664- args_compat ,
665- kwargs_compat ,
666642 create_section_header ("Returns" ),
667643 template_returns ,
668644 create_section_header ("See Also" ),
@@ -671,9 +647,7 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs):
671647 aggregation_description = "(exponential weighted moment) variance" ,
672648 agg_method = "var" ,
673649 )
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 ):
677651 window_func = window_aggregations .ewmcov
678652 wfunc = partial (
679653 window_func ,
@@ -708,7 +682,6 @@ def var_func(values, begin, end, min_periods):
708682 """
709683 ).replace ("\n " , "" , 1 ),
710684 kwargs_numeric_only ,
711- kwargs_compat ,
712685 create_section_header ("Returns" ),
713686 template_returns ,
714687 create_section_header ("See Also" ),
@@ -723,11 +696,9 @@ def cov(
723696 pairwise : bool | None = None ,
724697 bias : bool = False ,
725698 numeric_only : bool = False ,
726- ** kwargs ,
727699 ):
728700 from pandas import Series
729701
730- maybe_warn_args_and_kwargs (type (self ), "cov" , None , kwargs )
731702 self ._validate_numeric_only ("cov" , numeric_only )
732703
733704 def cov_func (x , y ):
@@ -783,7 +754,6 @@ def cov_func(x, y):
783754 """
784755 ).replace ("\n " , "" , 1 ),
785756 kwargs_numeric_only ,
786- kwargs_compat ,
787757 create_section_header ("Returns" ),
788758 template_returns ,
789759 create_section_header ("See Also" ),
@@ -797,11 +767,9 @@ def corr(
797767 other : DataFrame | Series | None = None ,
798768 pairwise : bool | None = None ,
799769 numeric_only : bool = False ,
800- ** kwargs ,
801770 ):
802771 from pandas import Series
803772
804- maybe_warn_args_and_kwargs (type (self ), "corr" , None , kwargs )
805773 self ._validate_numeric_only ("corr" , numeric_only )
806774
807775 def cov_func (x , y ):
@@ -940,7 +908,6 @@ def corr(
940908 other : DataFrame | Series | None = None ,
941909 pairwise : bool | None = None ,
942910 numeric_only : bool = False ,
943- ** kwargs ,
944911 ):
945912 raise NotImplementedError ("corr is not implemented." )
946913
@@ -950,11 +917,10 @@ def cov(
950917 pairwise : bool | None = None ,
951918 bias : bool = False ,
952919 numeric_only : bool = False ,
953- ** kwargs ,
954920 ):
955921 raise NotImplementedError ("cov is not implemented." )
956922
957- def var (self , bias : bool = False , * args , ** kwargs ):
923+ def var (self , bias : bool = False , numeric_only : bool = False ):
958924 raise NotImplementedError ("var is not implemented." )
959925
960926 def mean (self , * args , update = None , update_times = None , ** kwargs ):
0 commit comments