
    Lpjܡ                       % S SK Jr  S SKJr  S SKJrJrJrJrJ	r	J
r
  S SKrS SKJrJr  S SKJr  S SKJrJr  S SKJrJr  S S	KJrJrJrJrJrJrJrJ r J!r!J"r"J#r#  S S
K$J%r&J'r(  S SK)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrF  S SKGJHrH  S SKIJJrK  S SKLJMrMJNrNJOrO  S SKPJQrR  S SKSJTrU  S SKVJWrWJXrXJYrY  S SKZJ[r[J\r\J]r]J^r^J_r_J`r`JaraJbrb  S SKcJdrdJereJfrf  \(       aq  S SKgJhrhJiriJjrjJkrk  S SKlJmrmJnrnJoro  S SKpJqrqJrrrJsrsJtrtJuruJvrvJwrw  S SKxJyryJzrzJ{r{J|r|J}r}J~r~JrJr  S SK$JrJr  S SKJrJrJrJrJrJrJrJrJr  \" S\S9r\m" S5      r\" S5      r " S S\&\\   5      r% " S  S!\(\^   5      r' " S" S#\U\`   5      rT " S$ S%\K5      rJ " S& S'\R5      rQ\
SsS( j5       r\
StS) j5       r\
SuS* j5       r\
SvS+ j5       r    SwS, jr\
SxS- j5       r\
SyS. j5       r\
      SzS/ j5       r\
S{S0 j5       r\
      S|S1 j5       r\
      S}S2 j5       r\
      S~S3 j5       r\
      SS4 j5       r\
      SS5 j5       r\
      SS6 j5       r\
SS7 j5       r\
            SS8 j5       rS9S9S9SS:.           SS; jjr\
S<S=.     SS> jj5       r\
S<S=.     SS? jj5       r\
S<S=.     SS@ jj5       r\
SSA j5       rS9S=.     SSB jjr SSCS9S9SCS:.           SSD jjjrSSE jrSSF jrSSG jrSSH jrSSI jrSSSJ jjrSSK jrSSL jrSSM jrSSN jrSSO jrSSP jrSSQ jrSSR jrSSS jrSST jrSSU jr S       SSV jjrSWSX.SSY jjrSZS9S[.         SS\ jjrSS] jrSS^ jr " S_ S`\GRT                  5      r " Sa Sb\GRV                  \J5      rSSc jr S         SSd jjr      SSe jr SSSf.       SSg jjjr\%GR`                  rSh\Si'    S       SSj jjrSkSl.         SSm jjrSkSl.         SSn jjr        SSo jr        SSp jrSSq jr/ SrQrg)    )annotationswraps)TYPE_CHECKINGAnyFinalLiteralcastoverloadN)
exceptions	functions)issue_warning)ExprKindExprNode)TypeVarassert_never)ImplementationVersiongenerate_temporary_column_nameinherit_docis_ordered_categoricalmaybe_align_indexmaybe_convert_dtypesmaybe_get_indexmaybe_reset_indexmaybe_set_indexnot_implemented)	DataFrame	LazyFrame)ArrayBinaryBooleanCategoricalDateDatetimeDecimalDurationEnumFieldFloat16Float32Float64Int8Int16Int32Int64Int128ListObjectStringStructTimeUInt8UInt16UInt32UInt64UInt128Unknown)NarwhalsUnstableWarning)Expr)_new_series_implconcatshow_versions)Schema)Series)dependenciesdtypes	selectors)
DataFrameTIntoDataFrameT	IntoFrameIntoLazyFrameT
IntoSeriesIntoSeriesT
LazyFrameTSeriesT)_from_native_implget_native_namespaceto_py_scalar)CallableIterableMappingSequence)	ParamSpecSelfUnpack)AllowAny	AllowLazyAllowSeriesExcludeSeriesIntoArrowTable
OnlySeriesPassThroughUnknown)ArrowBackendEagerAllowedIntoBackendLazyAllowedPandas
PluginNamePolars)MultiColSelectorMultiIndexSelector)		IntoDTypeIntoExpr
IntoSchemaNonNestedLiteralPythonLiteralSingleColSelectorSingleIndexSelector_1DArray_2DArrayT)defaultPRc                  f  ^  \ rS rSr\R
                  r\" \5      SU 4S jj5       r	\
      SU 4S jj5       r\
 SSS.       SU 4S jjjj5       r\
 S       S U 4S jjj5       r\
 S       S!U 4S jjj5       r\S"S	 j5       r\S#S
 j5       r\S$S j5       r\    S%S j5       r\    S&S j5       r    S'U 4S jjrS(U 4S jjr SSS.     S)U 4S jjjjr\SS.S*S jj5       r\S+S j5       r\SS.   S,S jj5       rSS.   S,U 4S jjjrS-U 4S jjrS-U 4S jjrSrU =r$ ).r   t   c               ^   > UR                   [        R                  L d   e[        TU ]  XS9  g N)level_versionr   V2super__init__selfdfr{   	__class__s      W/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/narwhals/stable/v2/__init__.pyr   DataFrame.__init__w   )    {{gjj((()    c               6   > [         TU ]  XS9n[        SU5      $ NbackendDataFrame[Any])r   
from_arrowr
   )clsnative_framer   resultr   s       r   r   DataFrame.from_arrow   s%     #L#B$f--r   Nr   c               8   > [         TU ]  XUS9n[        SU5      $ r   )r   	from_dictr
   r   dataschemar   r   r   s        r   r   DataFrame.from_dict   s'     "4"A$f--r   c               8   > [         TU ]  XUS9n[        SU5      $ r   )r   
from_dictsr
   r   s        r   r   DataFrame.from_dicts   '     #D'#B$f--r   c               8   > [         TU ]  XUS9n[        SU5      $ r   r   
from_numpyr
   r   s        r   r   DataFrame.from_numpy   r   r   c                "    [        S[        5      $ )Ntype[Series[Any]])r
   rC   r   s    r   _seriesDataFrame._series   s    '00r   c                "    [        S[        5      $ )Ntype[LazyFrame[Any]])r
   r   r   s    r   
_lazyframeDataFrame._lazyframe   s    *I66r   c                    g N r   items     r   __getitem__DataFrame.__getitem__   s    WZr   c                    g r   r   r   s     r   r   r      s     r   c                    g r   r   r   s     r   r   r      s     r   c                "   > [         TU ]  U5      $ r   )r   r   )r   r   r   s     r   r   r      s     w"4((r   c                "   > [         TU ]  U5      $ r   )r   
get_column)r   namer   s     r   r   DataFrame.get_column   s     w!$''r   )sessionc               0   > [        [        TU ]	  XS95      $ )N)r   r   )
_stableifyr   lazy)r   r   r   r   s      r   r   DataFrame.lazy   s     %',w,HIIr   .	as_seriesc                   g r   r   r   r   s     r   to_dictDataFrame.to_dict   s    TWr   c                   g r   r   r   s     r   r   r      s    MPr   Tc                   g r   r   r   s     r   r   r      s     9<r   c                  > [         TU ]  US9$ )Nr   )r   r   )r   r   r   s     r   r   r      s    
 w33r   c                2   > [        [        TU ]	  5       5      $ r   )r   r   is_duplicatedr   r   s    r   r   DataFrame.is_duplicated   s    %'/122r   c                2   > [        [        TU ]	  5       5      $ r   )r   r   	is_uniquer   s    r   r   DataFrame.is_unique   s    %'+-..r   r   r   r   r{   &Literal['full', 'lazy', 'interchange']returnNoner   r]   r   &IntoBackend[EagerAllowed | PluginName]r   r   r   r   zMapping[str, Any]r   2IntoSchema | Mapping[str, IntoDType | None] | Noner   z-IntoBackend[EagerAllowed | PluginName] | Noner   r   )r   zSequence[Mapping[str, Any]]r   r   r   r   r   r   r   rr   r   z!IntoSchema | Sequence[str] | Noner   r   r   r   )r   r   )r   r   )r   z-tuple[SingleIndexSelector, SingleColSelector]r   r   )r   z2str | tuple[MultiIndexSelector, SingleColSelector]r   Series[Any])r   zSingleIndexSelector | MultiIndexSelector | MultiColSelector | tuple[SingleIndexSelector, MultiColSelector] | tuple[MultiIndexSelector, MultiColSelector]r   rW   )r   a  SingleIndexSelector | SingleColSelector | MultiColSelector | MultiIndexSelector | tuple[SingleIndexSelector, SingleColSelector] | tuple[SingleIndexSelector, MultiColSelector] | tuple[MultiIndexSelector, SingleColSelector] | tuple[MultiIndexSelector, MultiColSelector]r   zSeries[Any] | Self | Any)r   strr   r   )r   zIntoBackend[LazyAllowed] | Noner   z
Any | Noner   LazyFrame[Any])r   zLiteral[True]r   zdict[str, Series[Any]])r   Literal[False]r   zdict[str, list[Any]])r   boolr   z-dict[str, Series[Any]] | dict[str, list[Any]])r   r   )__name__
__module____qualname____firstlineno__r   r~   r}   r   NwDataFramer   classmethodr   r   r   r   propertyr   r   r   r   r   r   r   r   r   __static_attributes____classcell__r   s   @r   r   r   t   sv   zzH* * .$. 8	.
 
. .  FJ.
 BF.. C.
 ?. 
. . .  FJ.). C.
 8. 
. .  59.. 2.
 8. 
. . 1 1 7 7 Z ZF	  	:	 
	 	):) 
")( 48J #	J0J 	J
 
J J 47W WP P#'< <	6< < $(4 4	64 43/ /r   r   c                     ^  \ rS rSr\R
                  r\" \5      SU 4S jj5       r	\
SS j5       r S     S	U 4S jjjrSrU =r$ )
r      c               ^   > UR                   [        R                  L d   e[        TU ]  XS9  g rz   r|   r   s      r   r   LazyFrame.__init__   r   r   c                    [         $ r   r   r   s    r   
_dataframeLazyFrame._dataframe       r   c                :   > [        [        TU ]  " SSU0UD65      $ )Nr   r   )r   r   collect)r   r   kwargsr   s      r   r   LazyFrame.collect  s!     %'/D'DVDEEr   r   r   r   ztype[DataFrame[Any]]r   )r   z+IntoBackend[Polars | Pandas | Arrow] | Noner   r   r   r   )r   r   r   r   r   r~   r}   r   NwLazyFramer   r   r   r   r   r   r   s   @r   r   r      se    zzH* *   FJFBFUXF	F Fr   r   c                  P  ^  \ rS rSr% \R
                  r\" \5            SU 4S jj5       r	\
SS j5       r\ S         SU 4S jjj5       r\ S         SU 4S jjj5       rSU 4S jjrS	S	SS	S
.         SU 4S jjjr\" 5       rS\S'   S	S.SU 4S jjjrSrU =r$ )rC   i	  r   c               ^   > UR                   [        R                  L d   e[        TU ]  XS9  g rz   r|   )r   seriesr{   r   s      r   r   Series.__init__  s+     '**,,,-r   c                    [         $ r   r   r   s    r   r   Series._dataframe  r   r   Nc               8   > [         TU ]  XX4S9n[        SU5      $ Nr   r   r   r   r   valuesdtyper   r   r   s         r   r   Series.from_numpy  s&     #D%#IM6**r   c               8   > [         TU ]  XX4S9n[        SU5      $ r   )r   from_iterabler
   r   s         r   r  Series.from_iterable&  s&     &tU&LM6**r   c                2   > [        [        TU ]	  5       5      $ r   )r   r   to_framer   s    r   r  Series.to_frame2  s    %'*,--r   Fsortparallelr   	normalizec          	     2   > [        [        TU ]	  XX4S95      $ )Nr  )r   r   value_counts)r   r  r  r   r	  r   s        r   r  Series.value_counts5  s)     G 4 ! 
 	
r   histignore_nullsc               B   > Sn[        U[        5        [        TU ]  US9$ )Nz_`Series.any_value` is being called from the stable API although considered an unstable feature.r  )r   r=   r   	any_value)r   r  msgr   s      r   r  Series.any_valueF  s-    # 	 	c23w l ;;r   r   )r   r   r{   r   r   r   r   r   )
r   r   r   rq   r   IntoDType | Noner   r   r   r   )
r   r   r   zIterable[Any]r   r  r   r   r   r   )r   r   )
r  r   r  r   r   z
str | Noner	  r   r   r   )r  r   r   rn   )r   r   r   r   r   r~   r}   r   NwSeriesr   r   r   r   r   r  r  r  r   r  __annotations__r  r   r   r   s   @r   rC   rC   	  sQ   zzH..%K.	. .   
 #'		+	+ 	+  		+ 8	+ 
	+ 	+ 
 #'		+	+ 	+  		+ 8	+ 
	+ 	+. 
 
 	

 
 
 

 
  !D#!05 < < <r   rC   c                  :    \ rS rSrSS.S	S jjrS
S jrS
S jrSrg)r>   iO  Fr  c               v    Sn[        U[        5        U R                  [        [        R
                  SUS95      $ )Nz]`Expr.any_value` is being called from the stable API although considered an unstable feature.r  r  )r   r=   _append_noder   r   AGGREGATION)r   r  r  s      r   r  Expr.any_valueP  s>    # 	 	c23  X));\R
 	
r   c                T    U R                  [        [        R                  S5      5      $ )zGet the first value.firstr  r   r   ORDERABLE_AGGREGATIONr   s    r   r  
Expr.firstZ  s       (*H*H'!RSSr   c                T    U R                  [        [        R                  S5      5      $ )zGet the last value.lastr  r   s    r   r"  	Expr.last^  s       (*H*H&!QRRr   r   N)r  r   r   rW   )r   rW   )r   r   r   r   r  r  r"  r   r   r   r   r>   r>   O  s    05 
TSr   r>   c                  ,    \ rS rSr\R
                  rSrg)rB   ic  r   N)r   r   r   r   r   r~   r}   r   r   r   r   rB   rB   c  s    zzHr   rB   c                    g r   r   objs    r   r   r   g      ORr   c                    g r   r   r&  s    r   r   r   i  r(  r   c                    g r   r   r&  s    r   r   r   k      CFr   c                    g r   r   r&  s    r   r   r   m  s    %(r   c                H   [        U [        5      (       a;  [        U R                  R	                  [
        R                  5      U R                  S9$ [        U [        5      (       a;  [        U R                  R	                  [
        R                  5      U R                  S9$ [        U [        5      (       a;  [        U R                  R	                  [
        R                  5      U R                  S9$ [        U [        5      (       a  [        U R                  6 $ [!        U 5        g rz   )
isinstancer   r   _compliant_frame_with_versionr   r~   _levelr   r   r  rC   _compliant_seriesNwExprr>   _nodesr   r&  s    r   r   r   q  s     #{##--;;GJJGszzZZ#{##--;;GJJGszzZZ#x  c++99'**ESZZXX#vSZZ  r   c                    g r   r   native_objectkwdss     r   from_nativer9    s    PSr   c                    g r   r   r6  s     r   r9  r9    s    QTr   c                    g r   r   r6  s     r   r9  r9    s     r   c                    g r   r   r6  s     r   r9  r9    s    UXr   c                    g r   r   r6  s     r   r9  r9         !$r   c                    g r   r   r6  s     r   r9  r9         r   c                    g r   r   r6  s     r   r9  r9    r@  r   c                    g r   r   r6  s     r   r9  r9    r>  r   c                    g r   r   r6  s     r   r9  r9    s     7:r   c                    g r   r   r6  s     r   r9  r9    s	     SVr   c                    g r   r   r6  s     r   r9  r9    s    LOr   c                   g r   r   r7  pass_through
eager_onlyseries_onlyallow_seriess        r   r9  r9    s     r   FrH  rI  rJ  rK  c          
         [        U [        [        45      (       a	  U(       d  U $ [        U [        5      (       a  U(       d  U(       a  U $ [	        U UUUUS[
        R                  S9$ )a5  Convert `native_object` to Narwhals Dataframe, Lazyframe, or Series.

Arguments:
    native_object: Raw object from user.
        Depending on the other arguments, input object can be

        - a Dataframe / Lazyframe / Series supported by Narwhals (pandas, Polars, PyArrow, ...)
        - an object which implements `__narwhals_dataframe__`, `__narwhals_lazyframe__`,
          or `__narwhals_series__`
    pass_through: Determine what happens if the object can't be converted to Narwhals

        - `False` (default): raise an error
        - `True`: pass object through as-is
    eager_only: Whether to only allow eager objects

        - `False` (default): don't require `native_object` to be eager
        - `True`: only convert to Narwhals if `native_object` is eager
    series_only: Whether to only allow Series

        - `False` (default): don't require `native_object` to be a Series
        - `True`: only convert to Narwhals if `native_object` is a Series
    allow_series: Whether to allow Series (default is only Dataframe / Lazyframe)

        - `False` or `None` (default): don't convert to Narwhals if `native_object` is a Series
        - `True`: allow `native_object` to be a Series

Returns:
    DataFrame, LazyFrame, Series, or original object, depending
        on which combination of parameters was passed.
F)rH  rI  rJ  rK  eager_or_interchange_onlyversion)r.  r   r   rC   rO   r   r~   rG  s        r   r9  r9    s\    X -)Y!788-((k\!!"'

 r   .rH  c                   g r   r   narwhals_objectrH  s     r   	to_nativerT         r   c                   g r   r   rR  s     r   rT  rT    rU  r   c                   g r   r   rR  s     r   rT  rT    s     r   c                   g r   r   rR  s     r   rT  rT    r+  r   c               *    [         R                  " XS9$ )a=  Convert Narwhals object to native one.

Arguments:
    narwhals_object: Narwhals object.
    pass_through: Determine what happens if `narwhals_object` isn't a Narwhals class

        - `False` (default): raise an error
        - `True`: pass object through as-is

Returns:
    Object of class that user started with.
rP  )nwrT  rR  s     r   rT  rT    s    & <<CCr   Tc               :   ^^^^ SUUUU4S jjnU c  U$ U" U 5      $ )a  Decorate function so it becomes dataframe-agnostic.

This will try to convert any dataframe/series-like object into the Narwhals
respective DataFrame/Series, while leaving the other parameters as they are.
Similarly, if the output of the function is a Narwhals DataFrame or Series, it will be
converted back to the original dataframe/series type, while if the output is another
type it will be left as is.
By setting `pass_through=False`, then every input and every output will be required to be a
dataframe/series-like object.

Arguments:
    func: Function to wrap in a `from_native`-`to_native` block.
    pass_through: Determine what happens if the object can't be converted to Narwhals

        - `False`: raise an error
        - `True` (default): pass object through as-is
    eager_only: Whether to only allow eager objects

        - `False` (default): don't require `native_object` to be eager
        - `True`: only convert to Narwhals if `native_object` is eager
    series_only: Whether to only allow Series

        - `False` (default): don't require `native_object` to be a Series
        - `True`: only convert to Narwhals if `native_object` is a Series
    allow_series: Whether to allow Series (default is only Dataframe / Lazyframe)

        - `False` or `None`: don't convert to Narwhals if `native_object` is a Series
        - `True` (default): allow `native_object` to be a Series

Returns:
    Decorated function.
c                >   >^  [        T 5      SUUU UU4S jj5       nU$ )Nc                   > U  Vs/ s H  n[        UTTTTS9PM     nnUR                  5        VVs0 s H  u  pEU[        UTTTTS9_M     nnn/ UQUR                  5       Q7 Vs1 s H   n[        USS 5      =n(       d  M  U" 5       iM"     n	nU	R	                  5       S:  a  Sn
[        U
5      eT" U0 UD6n[        UTS9$ s  snf s  snnf s  snf )NrL  __native_namespace__   z_Found multiple backends. Make sure that all dataframe/series inputs come from the same backend.rP  )r9  itemsr   getattr__len__
ValueErrorrT  )argsr   argargs_nwr   value	kwargs_nwvbbackendsr  r   rK  rI  funcrH  rJ  s               r   wrapper.narwhalify.<locals>.decorator.<locals>.wrapper=  s"     	  C !-) +!-    	& $*<<>	 $2KD k!-) +!-  $2  	 978Y%5%5%788A $:DAAAA 8   !A%w o%70i0FV,??E		s   CC&CC)rd  r   r   r   r   r   r   )rl  rm  rK  rI  rH  rJ  s   ` r   	decoratornarwhalify.<locals>.decorator<  s)    	t#	@ #	@ 
#	@J r   )rl  Callable[..., Any]r   rq  r   )rl  rH  rI  rJ  rK  ro  s    ```` r   
narwhalifyrr    s&    R' 'R |T?r   c                 >    [        [        R                  " 5       5      $ )z3Instantiate an expression representing all columns.)r   rZ  allr   r   r   rt  rt  k      bffhr   c                 :    [        [        R                  " U 6 5      $ )zCreates an expression that references one or more columns by their name(s).

Arguments:
    names: Name(s) of the columns to use.
)r   rZ  colnamess    r   rw  rw  p  s     bffen%%r   c                 :    [        [        R                  " U 6 5      $ )zxCreates an expression that excludes columns by their name(s).

Arguments:
    names: Name(s) of the columns to exclude.
)r   rZ  excluderx  s    r   r{  r{  y  s     bjj%())r   c                 :    [        [        R                  " U 6 5      $ )a	  Creates an expression that references one or more columns by their index(es).

Notes:
    `nth` is not supported for Polars version<1.0.0. Please use
    [`narwhals.col`][] instead.

Arguments:
    indices: One or more indices representing the columns to retrieve.
)r   rZ  nth)indicess    r   r}  r}    s     bffg&''r   c                 >    [        [        R                  " 5       5      $ )zReturn the number of rows.)r   rZ  lenr   r   r   r  r    ru  r   c                @    [        [        R                  " X5      5      $ )a  Return an expression representing a literal value.

Arguments:
    value: The value to use as literal. Can be a scalar value, list, tuple, or dict.
        Lists and tuples are converted to `List` dtype, dicts to `Struct` dtype.
    dtype: The data type of the literal value. If not provided, the data type will
        be inferred by the native library. For empty lists/dicts, dtype must be
        specified explicitly.
)r   rZ  lit)rg  r   s     r   r  r    s     bffU*++r   c                 :    [        [        R                  " U 6 5      $ )zReturn the minimum value.

Note:
   Syntactic sugar for ``nw.col(columns).min()``.

Arguments:
    columns: Name(s) of the columns to use in the aggregation function.
)r   rZ  mincolumnss    r   r  r         bffg&''r   c                 :    [        [        R                  " U 6 5      $ )zReturn the maximum value.

Note:
   Syntactic sugar for ``nw.col(columns).max()``.

Arguments:
    columns: Name(s) of the columns to use in the aggregation function.
)r   rZ  maxr  s    r   r  r    r  r   c                 :    [        [        R                  " U 6 5      $ )zGet the mean value.

Note:
    Syntactic sugar for ``nw.col(columns).mean()``

Arguments:
    columns: Name(s) of the columns to use in the aggregation function
)r   rZ  meanr  s    r   r  r    s     bggw'((r   c                 :    [        [        R                  " U 6 5      $ )a0  Get the median value.

Notes:
    - Syntactic sugar for ``nw.col(columns).median()``
    - Results might slightly differ across backends due to differences in the
        underlying algorithms used to compute the median.

Arguments:
    columns: Name(s) of the columns to use in the aggregation function
)r   rZ  medianr  s    r   r  r    s     bii)**r   c                 :    [        [        R                  " U 6 5      $ )zSum all values.

Note:
    Syntactic sugar for ``nw.col(columns).sum()``

Arguments:
    columns: Name(s) of the columns to use in the aggregation function
)r   rZ  sumr  s    r   r  r    r  r   c                 :    [        [        R                  " U 6 5      $ )zSum all values horizontally across columns.

Warning:
    Unlike Polars, we support horizontal sum over numeric columns only.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
)r   rZ  sum_horizontalexprss    r   r  r         b''/00r   c                @    [        [        R                  " USU 065      $ )a  Compute the bitwise AND horizontally across columns.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
    ignore_nulls: Whether to ignore nulls:

        - If `True`, null values are ignored. If there are no elements, the result
          is `True`.
        - If `False`, Kleene logic is followed. Note that this is not allowed for
          pandas with classical NumPy dtypes when null values are present.
r  )r   rZ  all_horizontalr  r  s     r   r  r         b''J\JKKr   c                @    [        [        R                  " USU 065      $ )a  Compute the bitwise OR horizontally across columns.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
    ignore_nulls: Whether to ignore nulls:

        - If `True`, null values are ignored. If there are no elements, the result
          is `False`.
        - If `False`, Kleene logic is followed. Note that this is not allowed for
          pandas with classical NumPy dtypes when null values are present.
r  )r   rZ  any_horizontalr  s     r   r  r    r  r   c                 :    [        [        R                  " U 6 5      $ )zCompute the mean of all values horizontally across columns.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
)r   rZ  mean_horizontalr  s    r   r  r    s     b((%011r   c                 :    [        [        R                  " U 6 5      $ )zGet the minimum value horizontally across columns.

Notes:
    We support `min_horizontal` over numeric columns only.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
)r   rZ  min_horizontalr  s    r   r  r    r  r   c                 :    [        [        R                  " U 6 5      $ )zGet the maximum value horizontally across columns.

Notes:
    We support `max_horizontal` over numeric columns only.

Arguments:
    exprs: Name(s) of the columns to use in the aggregation function. Accepts
        expression input.
)r   rZ  max_horizontalr  s    r   r  r  #  r  r   c                >    [        [        R                  " XUS95      $ )zCompute the Pearson's or Spearman rank correlation between two columns.

Arguments:
    a: Column name or Expression
    b: Column name or Expression
    method: Correlation method ('pearson' or 'spearman')
)method)r   rZ  corr)arj  r  s      r   r  r  0  s     bgga6233r   r_  ddofc               >    [        [        R                  " XUS95      $ )a  Compute the covariance between two columns.

Arguments:
    a: Column name or Expression
    b: Column name or Expression
    ddof: "Delta Degrees of Freedom": the divisor used in the calculation is N - ddof,
        where N represents the number of elements. By default ddof is 1.
r  )r   rZ  cov)r  rj  r  s      r   r  r  =  s     bffQ-..r    	separatorr  c               H    [        [        R                  " U /UQ7XS.65      $ )a  Horizontally concatenate columns into a single string column.

Arguments:
    exprs: Columns to concatenate into a single string column. Accepts expression
        input. Strings are parsed as column names, other non-expression inputs are
        parsed as literals. Non-`String` columns are cast to `String`.
    *more_exprs: Additional columns to concatenate into a single string column,
        specified as positional arguments.
    separator: String that will be used to separate the values of each column.
    ignore_nulls: Ignore null values (default is `False`).
        If set to `False`, null values will be propagated and if the row contains any
        null values, the output is null.
r  )r   rZ  
concat_str)r  r  r  
more_exprss       r   r  r  I  s'    & 
eYjYIY r   c                B    [        [        R                  " U /UQ76 5      $ )zFormat expressions as a string.

Arguments:
    f_string: A string that with placeholders.
    args: Expression(s) that fill the placeholders.
)r   rZ  format)f_stringrd  s     r   r  r  a  s     bii04011r   c                B    [        [        R                  " U /UQ76 5      $ )a  Folds the columns from left to right, keeping the first non-null value.

Arguments:
    exprs: Columns to coalesce, must be a str, nw.Expr, or nw.Series
        where strings are parsed as column names and both nw.Expr/nw.Series
        are passed through as-is. Scalar values must be wrapped in `nw.lit`.

    *more_exprs: Additional columns to coalesce, specified as positional arguments.

Raises:
    TypeError: If any of the inputs are not a str, nw.Expr, or nw.Series.
)r   rZ  coalesce)r  r  s     r   r  r  k  s     bkk%5*566r   c                  2    \ rS rSr\SS j5       rSS jrSrg)Wheni{  c                $    U " UR                   SS9$ )Nr   )chain)
_predicate)r   whens     r   	from_whenWhen.from_when|  s    4??"--r   c                f    / U R                   QU R                  U4P7n[        R                  U5      $ r   )_chainr  Then_from_chain)r   rg  	new_chains      r   then	When.then  s/    <dkk<DOOU#;<		**r   r   N)r  z	nw_f.Whenr   r  )rg  z&IntoExpr | NonNestedLiteral | _1DArrayr   r  )r   r   r   r   r   r  r  r   r   r   r   r  r  {  s    . .+r   r  c                  6   ^  \ rS rSrSS jrSU 4S jjrSrU =r$ )r  i  c                ,    [        USU R                  06$ )Nr  )r  r  )r   
predicatess     r   r  	Then.when  s    Z3t{{33r   c                4   > [        [        TU ]	  U5      5      $ r   )r   r   	otherwise)r   otherwise_valuer   s     r   r  Then.otherwise  s    %'+O<==r   r   r  IntoExpr | Iterable[IntoExpr]r   r  )r  zIntoExpr | NonNestedLiteralr   r>   )r   r   r   r   r  r  r   r   r   s   @r   r  r    s    4> >r   r  c                 N    [         R                  [        R                  " U 6 5      $ )a  Start a `when-then-otherwise` expression.

Expression similar to an `if-else` statement in Python. Always initiated by a
`nw.when(<condition>).then(<value if condition>)`, and optionally followed by
chained `.when(<condition>).then(<value>)` calls.
An `.otherwise(<value if condition is false>)` can be appended at the end.
If not appended, and the condition is not `True`, `None` will be returned.

Arguments:
    predicates: Condition(s) that must be met in order to apply the subsequent
        statement. Accepts one or more boolean expressions, which are implicitly
        combined with `&`. String input is parsed as a column name.

Returns:
    A "When" object, which `.then` can be called on.
)r  r  nw_fr  )r  s    r   r  r    s    " >>$))Z011r   c          	     (    [        [        XX#S95      $ )a  Instantiate Narwhals Series from iterable (e.g. list or array).

Arguments:
    name: Name of resulting Series.
    values: Values of make Series from.
    dtype: (Narwhals) dtype. If not provided, the native library
        may auto-infer it from `values`.
    backend: specifies which eager backend instantiate to.

        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
r   )r   r?   )r   r   r   r   s       r   
new_seriesr    s    . &tULMMr   c               <    [        [        R                  " XS95      $ )a(  Construct a DataFrame from an object which supports the PyCapsule Interface.

Arguments:
    native_frame: Object which implements `__arrow_c_stream__`.
    backend: specifies which eager backend instantiate to.

        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
r   )r   r  r   )r   r   s     r   r   r     s      doolDEEr   r   c               >    [        [        R                  " XUS95      $ )a7  Instantiate DataFrame from dictionary.

Indexes (if present, for pandas-like backends) are aligned following
the [left-hand-rule](../concepts/pandas_index.md).

Notes:
    For pandas-like dataframes, conversion to schema is applied after dataframe
    creation.

Arguments:
    data: Dictionary to create DataFrame from.
    schema: The DataFrame schema as Schema, dict of {name: type}, or a
        iterable of (name, type) tuples.
        If not specified, the schema will be inferred by the native library.
        If any `dtype` is `None`, the data type for that column will be
        inferred by the native library.
    backend: specifies which eager backend instantiate to. Only
        necessary if inputs are not Narwhals Series.

        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
r   )r   r  r   r   r   r   s      r   r   r     s    @ dnnT7CDDr   r   r   c               >    [        [        R                  " XUS95      $ )a"  Construct a DataFrame from a NumPy ndarray.

Notes:
    Only row orientation is currently supported.

    For pandas-like dataframes, conversion to schema is applied after dataframe
    creation.

Arguments:
    data: Two-dimensional data represented as a NumPy ndarray.
    schema: The DataFrame schema as Schema, dict of {name: type}, an iterable
        of (name, type) tuples, or a sequence of str.
    backend: specifies which eager backend instantiate to.

        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
r   )r   r  r   r  s      r   r   r     s    6 doodGDEEr   ,)r  c               F    [        [        R                  " U 4XS.UD65      $ )a  Read a CSV file into a DataFrame.

Arguments:
    source: Path to a file.
    backend: The eager backend for DataFrame creation.
        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
    separator: Single byte character to use as separator in the file.
    kwargs: Extra keyword arguments which are passed to the native CSV reader.
        For example, you could use
        `nw.read_csv('file.csv', backend='pandas', engine='pyarrow')`.
r   r  )r   r  read_csvsourcer   r  r   s       r   r  r    s'    . fMgMfM r   c               F    [        [        R                  " U 4XS.UD65      $ )a`  Lazily read from a CSV file.

For the libraries that do not support lazy dataframes, the function reads
a csv file eagerly and then converts the resulting dataframe to a lazyframe.

Arguments:
    source: Path to a file.
    backend: The eager backend for DataFrame creation.
        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
    separator: Single byte character to use as separator in the file.
    kwargs: Extra keyword arguments which are passed to the native CSV reader.
        For example, you could use
        `nw.scan_csv('file.csv', backend=pd, engine='pyarrow')`.
r  )r   r  scan_csvr  s       r   r  r  .  s'    4 fMgMfM r   c               F    [        [        R                  " U 4SU0UD65      $ )a  Read into a DataFrame from a parquet file.

Arguments:
    source: Path to a file.
    backend: The eager backend for DataFrame creation.
        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN` or `CUDF`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"` or `"cudf"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin` or `cudf`.
    kwargs: Extra keyword arguments which are passed to the native parquet reader.
        For example, you could use
        `nw.read_parquet('file.parquet', backend=pd, engine='pyarrow')`.
r   )r   r  read_parquetr  r   r   s      r   r  r  M  s$    $ d''JJ6JKKr   c               F    [        [        R                  " U 4SU0UD65      $ )a  Lazily read from a parquet file.

For the libraries that do not support lazy dataframes, the function reads
a parquet file eagerly and then converts the resulting dataframe to a lazyframe.

Note:
    Spark like backends require a session object to be passed in `kwargs`.

    For instance:

    ```py
    import narwhals as nw
    from sqlframe.duckdb import DuckDBSession

    nw.scan_parquet(source, backend="sqlframe", session=DuckDBSession())
    ```

Arguments:
    source: Path to a file.
    backend: The eager backend for DataFrame creation.
        `backend` can be specified in various ways

        - As `Implementation.<BACKEND>` with `BACKEND` being `PANDAS`, `PYARROW`,
            `POLARS`, `MODIN`, `CUDF`, `PYSPARK` or `SQLFRAME`.
        - As a string: `"pandas"`, `"pyarrow"`, `"polars"`, `"modin"`, `"cudf"`,
            `"pyspark"` or `"sqlframe"`.
        - Directly as a module `pandas`, `pyarrow`, `polars`, `modin`, `cudf`,
            `pyspark.sql` or `sqlframe`.
    kwargs: Extra keyword arguments which are passed to the native parquet reader.
        For example, you could use
        `nw.scan_parquet('file.parquet', backend=pd, engine='pyarrow')`.
r   )r   r  scan_parquetr  s      r   r  r  b  s%    F d''JJ6JKKr   c                 @    [        [        R                  " U 0 UD65      $ )a  Collect columns into a struct column.

Arguments:
    *exprs: Column(s) to collect into a struct column, specified as
        positional arguments. Accepts only expression input. Strings are parsed
        as column names, other non-expression inputs are not allowed.
    **named_exprs: Additional columns to collect into the struct column,
        specified as keyword arguments. The columns will be renamed to the
        keyword used.
)r   r  struct)r  named_exprss     r   r  r    s     dkk58K899r   )Vr    r!   r"   r#   r   r$   r%   r&   r'   r(   r>   r)   r*   r+   r,   r   r-   r.   r/   r0   r1   r   r2   r3   rB   rC   r4   r5   r6   r7   r8   r9   r:   r;   r<   rt  r  r  r  rw  r@   r  r  r  rD   rE   r   r{  r  r   r   r   r9  r   r   rP   r   r  r  r  r  r   r   r   r   r   r  r  r  r  r  rr  r  r}  r  r  r  r  rF   rA   r  r  r  rT  rQ   r  )r'  zNwDataFrame[IntoDataFrameT]r   DataFrame[IntoDataFrameT])r'  zNwLazyFrame[IntoLazyFrameT]r   LazyFrame[IntoLazyFrameT])r'  zNwSeries[IntoSeriesT]r   Series[IntoSeriesT])r'  r3  r   r>   )r'  zZNwDataFrame[IntoDataFrameT] | NwLazyFrame[IntoLazyFrameT] | NwSeries[IntoSeriesT] | NwExprr   zRDataFrame[IntoDataFrameT] | LazyFrame[IntoLazyFrameT] | Series[IntoSeriesT] | Expr)r7  rN   r8  Unpack[OnlySeries]r   rN   )r7  rN   r8  Unpack[AllowSeries]r   rN   )r7  rG   r8  Unpack[ExcludeSeries]r   rG   )r7  rM   r8  Unpack[AllowLazy]r   rM   )r7  rH   r8  r  r   r  )r7  rL   r8  r  r   r  )r7  rL   r8  r  r   r  )r7  rJ   r8  r  r   r  )r7  zIntoDataFrameT | IntoSeriesTr8  r  r   z/DataFrame[IntoDataFrameT] | Series[IntoSeriesT])r7  z-IntoDataFrameT | IntoLazyFrameT | IntoSeriesTr8  zUnpack[AllowAny]r   KDataFrame[IntoDataFrameT] | LazyFrame[IntoLazyFrameT] | Series[IntoSeriesT])r7  rs   r8  zUnpack[PassThroughUnknown]r   rs   )r7  r   rH  r   rI  r   rJ  r   rK  bool | Noner   r   )r7  zJIntoLazyFrameT | IntoDataFrameT | IntoSeriesT | IntoFrame | IntoSeries | TrH  r   rI  r   rJ  r   rK  r  r   zOLazyFrame[IntoLazyFrameT] | DataFrame[IntoDataFrameT] | Series[IntoSeriesT] | T)rS  r  rH  r   r   rH   )rS  r  rH  r   r   rJ   )rS  r  rH  r   r   rL   )rS  r   rH  r   r   r   )rS  r  rH  r   r   z3IntoDataFrameT | IntoLazyFrameT | IntoSeriesT | Anyr   )rl  zCallable[..., Any] | NonerH  r   rI  r   rJ  r   rK  r  r   rq  )r   r>   )ry  zstr | Iterable[str]r   r>   )r~  zint | Sequence[int]r   r>   )rg  rm   r   r  r   r>   )r  r   r   r>   )r  r  r   r>   )r  r  r  r   r   r>   )pearson)r  rk   rj  rk   r  zLiteral['pearson', 'spearman']r   r>   )r  rk   rj  rk   r  intr   r>   )
r  r  r  rk   r  r   r  r   r   r>   )r  r   rd  rk   r   r>   )r  r  r  rk   r   r>   r  )
r   r   r   r   r   r  r   r   r   r   r   r   r   )
r  r   r   r   r  r   r   r   r   r   )
r  r   r   !IntoBackend[Backend | PluginName]r  r   r   r   r   r   )r  r   r   r   r   r   r   r   )r  r   r   r  r   r   r   r   )r  zIntoExpr | Sequence[IntoExpr]r  rk   r   r>   )
__future__r   	functoolsr   typingr   r   r   r	   r
   r   narwhalsrZ  r   r   r  narwhals._exceptionsr   narwhals._expression_parsingr   r   narwhals._typing_compatr   r   narwhals._utilsr   r   r   r   r   r   r   r   r   r   r   narwhals.dataframer   r   r   r   narwhals.dtypesr    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   narwhals.exceptionsr=   narwhals.exprr>   r3  narwhals.functionsr?   r@   rA   narwhals.schemarB   NwSchemanarwhals.seriesrC   r  narwhals.stable.v2rD   rE   rF   narwhals.stable.v2.typingrG   rH   rI   rJ   rK   rL   rM   rN   narwhals.translaterO   rP   rQ   collections.abcrR   rS   rT   rU   typing_extensionsrV   rW   rX   narwhals._translaterY   rZ   r[   r\   r]   r^   r_   narwhals._typingr`   ra   rb   rc   rd   re   rf   rg   rh   ri   narwhals.typingrj   rk   rl   rm   rn   ro   rp   rq   rr   rs   ru   rv   r   r9  rT  rr  rt  rw  r{  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r  r   r  r  r  r  r  __all__r   r   r   <module>r
     s   "  E E  2 . ; 9    R       > 8 ( F F . . > >	 	 	 U TEE99  	 	 	 H
 
 
 	S!A#AA@/N+ @/FFN+ F$C<Xk" C<LS6 S(X  
 R 
 R	 R 
 R	 F 
 F	 ( 
 (

 X" 
 S 
 S	 T 
 T	'< 
 
 X 
 X	$!$+@$$ 
$ 
(: 
 
(; 
 
$!$+<$$ 
$ 
:/:9L:4: 
: 
V@VJZVPV 
V 
 O 
 O	  	
   	 
   $99 9 9 9 9 U9x 
RU.AO 
 
RU.AO 
 
LO(;I 
 
 F 
 F DD
 D 9D. '+U  $U
#U U 	U
 U U Up 
&*
( 

,	(	(	)+	(
1L L 2
1
1 HQ
4
4
4&D
4	
4 23 	/ 	(  	
 
027 +499 +>499d >2. #N
NN N
 4N N4F F.TFF* BF E >B	 E
 E> E ;	 E
  EF ((
E (
 15F
F-F 4	F
 FD 	 4 	
  @ 	 / 	
  >LLCLORLL*#L#L>#LJM#L#LL:Wr   