Ë
    ˜.çim. ã                  ó4  — U d dl mZ d dlZd dlZd dlmZmZmZ d dlm	Z	m
Z
 d dlmZmZmZmZmZ d dlmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZm Z  d dl!m"Z" d d	l#m$Z$ d d
l%m&Z&m'Z' e	r]d dl(m)Z) d dl*m+Z+m,Z,m-Z- d dl.m/Z/m0Z0m1Z1 d dl2m3Z3 d dl4m5Z5m6Z6m7Z7 d dl8m9Z9m:Z: d dl;m<Z< d dl=m>Z> d dl?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZI dZJdeKd<   ddœdOd„ZL	 dP	 	 	 	 	 	 	 	 	 dQd„ZM	 dP	 	 	 	 	 	 	 	 	 dQd„ZN ed¬«      	 dPdddœ	 	 	 	 	 	 	 	 	 dRd„«       ZO	 	 	 	 dSd „ZP	 dP	 	 	 	 	 	 	 dTd!„ZQ	 dP	 	 	 	 	 	 	 dUd"„ZRdVd#„ZS	 	 	 	 	 	 dWd$„ZTdXd%„ZUdXd&„ZVdYd'„ZW	 	 	 	 	 	 	 	 dZd(„ZXd[d)„ZYd*d+œ	 	 	 	 	 	 	 	 	 d\d,„ZZd*d+œ	 	 	 	 	 	 	 	 	 d]d-„Z[	 	 	 	 	 	 	 	 d^d.„Z\	 	 	 	 	 	 	 	 d_d/„Z]d`d0„Z^d`d1„Z_dad2„Z`dbd3„Zadbd4„Zbdcd5„Zcdcd6„Zddcd7„Zedcd8„Zfdcd9„Zgddd:„Zhdedfd;„Zidgd<„Zjdgd=„Zkdgd>„Zl G d?„ d@«      Zm G dA„ dBe$«      ZndhdC„ZodidD„ZpdPdjdE„ZqdidF„ZrdgdG„ZsdHdIdJœ	 	 	 	 	 	 	 	 	 dkdK„Zt	 	 	 	 	 	 dldL„ZudmdM„ZvdndN„Zwy)oé    )ÚannotationsN)ÚIterableÚMappingÚSequence)ÚTYPE_CHECKINGÚAny)ÚExprKindÚExprNodeÚ_parse_into_exprÚis_exprÚ	is_series)
ÚImplementationÚVersionÚdeprecate_native_namespaceÚflattenÚis_eager_allowedÚis_nested_literalÚis_sequence_but_not_strÚnormalize_pathÚsupports_arrow_c_streamÚvalidate_laziness)Úis_narwhals_seriesÚis_numpy_arrayÚis_numpy_array_2dÚis_pyarrow_table)ÚInvalidOperationError)ÚExpr)Úfrom_nativeÚ	to_native)Ú
ModuleType)ÚSelfÚ	TypeAliasÚTypeIs)ÚNativeDataFrameÚNativeLazyFrameÚNativeSeries)ÚIntoArrowTable)ÚBackendÚEagerAllowedÚIntoBackend)Ú	DataFrameÚ	LazyFrame)ÚDType)ÚSeries)
ÚConcatMethodÚCorrelationMethodÚ
FileSourceÚFrameTÚ	IntoDTypeÚIntoExprÚ
IntoSchemaÚNonNestedLiteralÚPythonLiteralÚ_2DArrayú!IntoSchema | Sequence[str] | Noner"   Ú_IntoSchemaÚvertical©Úhowc               óV  — ddl m} | sd}t        |«      ‚t        | «      } t	        | «       |dvrd}t        |«      ‚| d   } ||«      r|dk(  rd}t        |«      ‚|j                  «       }|j                  |j                  | D cg c]  }|j                  ‘Œ c}|¬«      «      S c c}w )	u  Concatenate multiple DataFrames, LazyFrames into a single entity.

    Arguments:
        items: DataFrames, LazyFrames to concatenate.
        how: concatenating strategy

            - vertical: Concatenate vertically. Column names must match.
            - horizontal: Concatenate horizontally. If lengths don't match, then
                missing rows are filled with null values. This is only supported
                when all inputs are (eager) DataFrames.
            - diagonal: Finds a union between the column schemas and fills missing column
                values with null.

    Raises:
        TypeError: The items to concatenate should either all be eager, or all lazy

    Examples:
        Let's take an example of vertical concatenation:

        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw

        Let's look at one case a for vertical concatenation (pandas backed):

        >>> df_pd_1 = nw.from_native(pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}))
        >>> df_pd_2 = nw.from_native(pd.DataFrame({"a": [5, 2], "b": [1, 4]}))
        >>> nw.concat([df_pd_1, df_pd_2], how="vertical")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |        a  b      |
        |     0  1  4      |
        |     1  2  5      |
        |     2  3  6      |
        |     0  5  1      |
        |     1  2  4      |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        Let's look at one case a for horizontal concatenation (polars backed):

        >>> df_pl_1 = nw.from_native(pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}))
        >>> df_pl_2 = nw.from_native(pl.DataFrame({"c": [5, 2], "d": [1, 4]}))
        >>> nw.concat([df_pl_1, df_pl_2], how="horizontal")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |    Narwhals DataFrame     |
        |---------------------------|
        |shape: (3, 4)              |
        |â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”|
        |â”‚ a   â”† b   â”† c    â”† d    â”‚|
        |â”‚ --- â”† --- â”† ---  â”† ---  â”‚|
        |â”‚ i64 â”† i64 â”† i64  â”† i64  â”‚|
        |â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡|
        |â”‚ 1   â”† 4   â”† 5    â”† 1    â”‚|
        |â”‚ 2   â”† 5   â”† 2    â”† 4    â”‚|
        |â”‚ 3   â”† 6   â”† null â”† null â”‚|
        |â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        Let's look at one case a for diagonal concatenation (pyarrow backed):

        >>> df_pa_1 = nw.from_native(pa.table({"a": [1, 2], "b": [3.5, 4.5]}))
        >>> df_pa_2 = nw.from_native(pa.table({"a": [3, 4], "z": ["x", "y"]}))
        >>> nw.concat([df_pa_1, df_pa_2], how="diagonal")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |    Narwhals DataFrame    |
        |--------------------------|
        |pyarrow.Table             |
        |a: int64                  |
        |b: double                 |
        |z: string                 |
        |----                      |
        |a: [[1,2],[3,4]]          |
        |b: [[3.5,4.5],[null,null]]|
        |z: [[null,null],["x","y"]]|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r   )Úis_narwhals_lazyframezNo items to concatenate.>   Údiagonalr;   Ú
horizontalzDOnly vertical, horizontal and diagonal concatenations are supported.rA   zdHorizontal concatenation is not supported for LazyFrames.

Hint: you may want to use `join` instead.r<   )Únarwhals.dependenciesr?   Ú
ValueErrorÚtupler   ÚNotImplementedErrorr   Ú__narwhals_namespace__Ú_with_compliantÚconcatÚ_compliant_frame)Úitemsr=   r?   ÚmsgÚ
first_itemÚplxÚdfs          úO/opt/house_gps_flutter/.venv/lib/python3.12/site-packages/narwhals/functions.pyrH   rH   @   s¸   € õ^ <áØ(ˆÜ˜‹oÐÜ%‹L€EÜeÔØ
Ð8Ñ8ØTˆÜ! #Ó&Ð&Øq‘€JÙ˜ZÔ(¨S°LÒ-@ð8ð 	ô $ CÓ(Ð(Ø
×
+Ñ
+Ó
-€CØ×%Ñ%Ø
‰
°%Ö8¨BB×'Ó'Ò8¸cˆ
ÓBóð ùÚ8s   ÂB&c               ó    — t        | |||¬«      S )u  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`.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> values = [4, 1, 2, 3]
        >>> nw.new_series(name="a", values=values, dtype=nw.Int32, backend=pd)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |   Narwhals Series   |
        |---------------------|
        |0    4               |
        |1    1               |
        |2    2               |
        |3    3               |
        |Name: a, dtype: int32|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    ©Úbackend)Ú_new_series_impl)ÚnameÚvaluesÚdtyperR   s       rO   Ú
new_seriesrW   ¦   s   € ôN ˜D &¨%¸ÔAÐAó    c               ó  — t        j                  |«      }t        |«      rbt        j                  j
                  j                  |«      j                  }|j                  j                  || ||¬«      }|j                  «       S |t         j                  u r@|j                  «       }	 |j                  | ||«      }t        |d¬«      j                  | «      S |› d|› d}
t!        |
«      ‚# t        $ r}	d}
t        |
«      |	‚d }	~	ww xY w)N)rT   ÚcontextrV   T)Úseries_onlyzDUnknown namespace is expected to implement `new_series` constructor.zÝ support in Narwhals is lazy-only, but `new_series` is an eager-only function.

Hint: you may want to use an eager backend and then call `.lazy`, e.g.:

    nw.new_series('a', [1,2,3], backend='pyarrow').to_frame().lazy('ú'))r   Úfrom_backendr   r   ÚMAINÚ	namespaceÚ	compliantÚ_seriesÚfrom_iterableÚto_narwhalsÚUNKNOWNÚto_native_namespacerW   r   ÚaliasÚAttributeErrorrC   )rT   rU   rV   rR   ÚimplementationÚnsÚseriesÚ_native_namespaceÚnative_seriesÚerK   s              rO   rS   rS   Ð   s  € ô $×0Ñ0°Ó9€NÜ˜Ô'Ü\‰\×#Ñ#×0Ñ0°Ó@×JÑJˆØ—‘×)Ñ)¨&°tÀRÈuÐ)ÓUˆØ×!Ñ!Ó#Ð#Øœ×/Ñ/Ñ/Ø*×>Ñ>Ó@Ðð	-Ø*;×*FÑ*FØf˜eó+ˆMô ˜}¸$Ô?×EÑEÀdÓKÐKð
 Ð
ð OàO]ÐN^Ð^`ð	bð ô
 S‹/Ðøô ò 	-ØXˆCÜ  Ó%¨1Ð,ûð	-ús   Â&.C( Ã(	DÃ1C?Ã?Dz1.26.0)Úwarn_version)rR   Únative_namespacec               ó¢  — |€t        | «      \  } }|rJ| rHt        |j                  «       «      j                  | j                  «       «      x}rd|› }t	        |«      ‚t        j                  |«      }t        |«      r_t        j                  j                  j                  |«      j                  }|j                  j                  | ||¬«      j                  «       S |t
        j                  u r1|j!                  «       }	 |j                  | |¬«      }	t%        |	d¬«      S |› d|› d	}t'        |«      ‚# t"        $ r}
d}t#        |«      |
‚d}
~
ww xY w)
u\  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 or dict of {name: type}. 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`.
        native_namespace: deprecated, same as `backend`.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>> data = {"c": [5, 2], "d": [1, 4]}
        >>> nw.from_dict(data, backend="pandas")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |        c  d      |
        |     0  5  1      |
        |     1  2  4      |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    NzIKeys in `schema` and `data` are expected to match, found unmatched keys: )ÚschemarZ   ©rq   z@Unknown namespace is expected to implement `from_dict` function.T©Ú
eager_onlyzÑ support in Narwhals is lazy-only, but `from_dict` is an eager-only function.

Hint: you may want to use an eager backend and then call `.lazy`, e.g.:

    nw.from_dict({'a': [1, 2]}, backend='pyarrow').lazy('r\   )Ú_from_dict_no_backendÚsetÚkeysÚsymmetric_differencer   r   r]   r   r   r^   r_   r`   Ú
_dataframeÚ	from_dictrc   rd   re   rg   r   rC   )Údatarq   rR   ro   ÚdiffrK   rh   ri   rk   Únative_framerm   s              rO   rz   rz   î   sW  € ð^ €Ü-¨dÓ3‰ˆˆgÙ‘$¤C¨¯©«Ó$6×$KÑ$KÈDÏIÉIËKÓ$XÐX˜DÐXØYÐZ^ÐY_Ð`ˆÜ# CÓ(Ð(Ü#×0Ñ0°Ó9€NÜ˜Ô'Ü\‰\×#Ñ#×0Ñ0°Ó@×JÑJˆØ}‰}×&Ñ& t°FÀBÐ&ÓG×SÑSÓUÐUØœ×/Ñ/Ñ/Ø*×>Ñ>Ó@Ðð	-ð ->×,GÑ,GØ˜Vð -Hó -ˆLô ˜<°DÔ9Ð9àÐ
ð FàFTÐEUÐUWð	Yð ô
 S‹/Ðøô ò 	-ØTˆCÜ  Ó%¨1Ð,ûð	-ús   Ã?D2 Ä2	EÄ;E	Å	Ec          	     óð   — | j                  «       D ]  }t        |«      sŒ|j                  «       } n d}t        |«      ‚| j	                  «       D ci c]  \  }}|t        |d¬«      “Œ } }}| |fS c c}}w )NzgCalling `from_dict` without `backend` is only supported if all input values are already Narwhals SeriesT)Úpass_through)rU   r   Ú__native_namespace__Ú	TypeErrorrJ   r   )r{   Úvalro   rK   ÚkeyÚvalues         rO   ru   ru   :  s€   € ð {‰{‹}ò ˆÜ˜cÕ"Ø"×7Ñ7Ó9ÐÙðð
 xˆÜ˜‹nÐØGKÇzÁzÃ|×T¹¸¸eˆC”˜5¨tÔ4Ñ4ÐT€DÑTØÐ!Ð!Ð!ùó Us   ÁA2c               óZ   — t         j                  j                  j                  | ||¬«      S )u)	  Instantiate DataFrame from a sequence of dictionaries representing rows.

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

    Arguments:
        data: Sequence with dictionaries mapping column name to value.
        schema: The DataFrame schema as Schema or dict of {name: type}. 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.

            `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`.

    Tip:
        If you expect non-uniform keys in `data`, consider passing `schema` for
        more consistent results, as **inference varies between backends**:

        - pandas uses all rows
        - polars uses the first 100 rows
        - pyarrow uses only the first row

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>> data = [
        ...     {"item": "apple", "weight": 80, "price": 0.60},
        ...     {"item": "egg", "weight": 55, "price": 0.40},
        ... ]
        >>> nw.DataFrame.from_dicts(data, backend="polars")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |    Narwhals DataFrame    |
        |--------------------------|
        |shape: (2, 3)             |
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚ item  â”† weight â”† price â”‚|
        |â”‚ ---   â”† ---    â”† ---   â”‚|
        |â”‚ str   â”† i64    â”† f64   â”‚|
        |â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡|
        |â”‚ apple â”† 80     â”† 0.6   â”‚|
        |â”‚ egg   â”† 55     â”† 0.4   â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    rQ   )r   r^   Ú	dataframeÚ
from_dicts)r{   rq   rR   s      rO   r‡   r‡   H  s'   € ôr <‰<×!Ñ!×,Ñ,¨T°6À7Ð,ÓKÐKrX   c               óL  — t        | «      sd}t        |«      ‚t        |«      sdt        |«      › d}t	        |«      ‚t        j                  |«      }t        |«      rSt        j                  j                  j                  |«      j                  }|j                  | |«      j                  «       S |t
        j                  u r1|j                  «       }	 |j                  | |¬«      }t#        |d¬«      S |› d	|› d
}t        |«      ‚# t         $ r}d}t!        |«      |‚d}~ww xY w)u  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}, 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`.

    Examples:
        >>> import numpy as np
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> arr = np.array([[5, 2, 1], [1, 4, 3]])
        >>> schema = {"c": nw.Int16(), "d": nw.Float32(), "e": nw.Int8()}
        >>> nw.from_numpy(arr, schema=schema, backend="pyarrow")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  pyarrow.Table   |
        |  c: int16        |
        |  d: float        |
        |  e: int8         |
        |  ----            |
        |  c: [[5,1]]      |
        |  d: [[2,4]]      |
        |  e: [[1,3]]      |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    z)`from_numpy` only accepts 2D numpy arrayszW`schema` is expected to be one of the following types: IntoSchema | Sequence[str]. Got ú.rr   zAUnknown namespace is expected to implement `from_numpy` function.NTrs   zÉ support in Narwhals is lazy-only, but `from_numpy` is an eager-only function.

Hint: you may want to use an eager backend and then call `.lazy`, e.g.:

    nw.from_numpy(arr, backend='pyarrow').lazy('r\   )r   rC   Ú_is_into_schemaÚtyper   r   r]   r   r   r^   r_   r`   Ú
from_numpyrc   rd   re   rg   r   )	r{   rq   rR   rK   rh   ri   rk   r}   rm   s	            rO   rŒ   rŒ   „  s8  € ô^ ˜TÔ"Ø9ˆÜ˜‹oÐÜ˜6Ô"ðä˜“<. ð#ð 	ô
 ˜‹nÐÜ#×0Ñ0°Ó9€NÜ˜Ô'Ü\‰\×#Ñ#×0Ñ0°Ó@×JÑJˆØ}‰}˜T 6Ó*×6Ñ6Ó8Ð8Øœ×/Ñ/Ñ/Ø*×>Ñ>Ó@Ðð	-ð ->×,HÑ,HØ˜Vð -Ió -ˆLô ˜<°DÔ9Ð9àÐ
ð ;à;IÐ:JÈ"ð	Nð ô
 S‹/Ðøô ò 	-ØUˆCÜ  Ó%¨1Ð,ûð	-ús   ÃD Ä	D#ÄDÄD#c                óX   — ddl m} | d u xs t        | t        |f«      xs t	        | «      S )Nr   )ÚSchema)Únarwhals.schemarŽ   Ú
isinstancer   r   )ÚobjrŽ   s     rO   rŠ   rŠ   Õ  s0   € Ý&ð 	ˆtˆÒY”z #¬°Ð'8Ó9ÒYÔ=TÐUXÓ=YðrX   c               óD  — t        | «      s%t        | «      sdt        | «      › d}t        |«      ‚t	        j
                  |«      }t        |«      r^t        j                  j                  j                  |«      j                  }|j                  j                  | |¬«      j                  «       S |t        j                  u r/|j                  «       }	 |j!                  | «      }t%        |d¬«      S |› d|› d	}t'        |«      ‚# t"        $ r}d}t#        |«      |‚d}~ww xY w)
uz  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`.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pd.DataFrame({"a": [1, 2], "b": [4.2, 5.1]})
        >>> nw.from_arrow(df_native, backend="polars")
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (2, 2)   |
        |  â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”   |
        |  â”‚ a   â”† b   â”‚   |
        |  â”‚ --- â”† --- â”‚   |
        |  â”‚ i64 â”† f64 â”‚   |
        |  â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡   |
        |  â”‚ 1   â”† 4.2 â”‚   |
        |  â”‚ 2   â”† 5.1 â”‚   |
        |  â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜   |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    zGiven object of type z% does not support PyCapsule interface)rZ   zuUnknown namespace is expected to implement `DataFrame` class which accepts object which supports PyCapsule Interface.NTrs   zÈ support in Narwhals is lazy-only, but `from_arrow` is an eager-only function.

Hint: you may want to use an eager backend and then call `.lazy`, e.g.:

    nw.from_arrow(df, backend='pyarrow').lazy('r\   )r   r   r‹   r   r   r]   r   r   r^   r_   r`   ry   Ú
from_arrowrc   rd   re   r+   rg   r   rC   )r}   rR   rK   rh   ri   rk   Únativerm   s           rO   r“   r“   Ý  s#  € ôJ $ LÔ1Ô5EÀlÔ5SØ%¤d¨<Ó&8Ð%9Ð9^Ð_ˆÜ˜‹nÐÜ#×0Ñ0°Ó9€NÜ˜Ô'Ü\‰\×#Ñ#×0Ñ0°Ó@×JÑJˆØ}‰}×'Ñ'¨¸bÐ'ÓA×MÑMÓOÐOØœ×/Ñ/Ñ/Ø*×>Ñ>Ó@Ðð	-ð '8×&AÑ&AÀ,Ó&OˆFô ˜6¨dÔ3Ð3àÐ
ð :à:HÐ9IÈð	Mð ô
 S‹/Ðøô ò 	-ð JˆCÜ  Ó%¨1Ð,ûð	-ús   ÃD Ä	DÄDÄDc                 ó®   — t         j                  j                  dd«      } d| fdt         j                  fdt	        j                  «       ff}t        |«      S )z—System information.

    Returns system and Python version information

    Copied from sklearn

    Returns:
        Dictionary with system info.
    ú
ú ÚpythonÚ
executableÚmachine)ÚsysÚversionÚreplacer™   ÚplatformÚdict)r˜   Úblobs     rO   Ú_get_sys_infor¡     sT   € ô [‰[× Ñ   sÓ+€Fð 
6ÐØ	”s—~‘~Ð&Ø	”H×%Ñ%Ó'Ð(ð€Dô ‹:ÐrX   c                 ó`  ‡	— ddl m}  d}t        j                  }ddhŠ	t	        ˆ	fd„g |¢|¢­D «       «      }t
        j                  |d«      } | «       D ]W  }|j                  j                  «       |j                  }}||v r|||<   Œ3|D ]   }||   rŒ	|j                  |«      sŒ|||<    ŒW ŒY |S )aˆ  Overview of the installed version of main dependencies.

    This function does not import the modules to collect the version numbers
    but instead relies on standard Python package metadata.

    Returns version information on relevant Python libraries

    This function and show_versions were copied from sklearn and adapted

    Returns:
        Mapping from dependency to version.
    r   )Údistributions)ÚnarwhalsÚnumpyÚPYSPARK_CONNECTrd   c              3  óH   •K  — | ]  }|‰vsŒ|j                  «       –— Œ y ­w©N)Úlower)Ú.0rT   Úexcludes     €rO   ú	<genexpr>z!_get_deps_info.<locals>.<genexpr>B  s#   øè ø€ ò ØÀ$ÈgÒBUˆ
‰
ñùs   ƒ	""Ú )Úimportlib.metadatar£   r   Ú_member_names_rD   rŸ   ÚfromkeysrT   r©   rœ   Ú
startswith)
r£   Úextra_namesÚmember_namesÚtarget_namesÚresultÚdistÚ	dist_nameÚdist_versionÚtargetr«   s
            @rO   Ú_get_deps_inforº   0  sË   ø€ õ 1à'€KÜ!×0Ñ0€LØ  )Ð,€GÜó Ø!> ;Ð!>°Ñ!>ôó €Lô ]‰]˜<¨Ó,€Fá“ò ˆØ"&§)¡)§/¡/Ó"3°T·\±\<ˆ	à˜ÑØ ,ˆF9Òà&ò Ø˜f“~¨)×*>Ñ*>Øõ+ð &2F˜6‘NÙñðð €MrX   c                 óü   — t        «       } t        «       }t        d«       | j                  «       D ]  \  }}t        |d›d|› «       Œ t        d«       |j                  «       D ]  \  }}t        |d›d|› «       Œ y)z”Print useful debugging information.

    Examples:
        >>> from narwhals import show_versions
        >>> show_versions()  # doctest: +SKIP
    z
System:z>10z: z
Python dependencies:z>13N)r¡   rº   ÚprintrJ   )Úsys_infoÚ	deps_infoÚkÚstats       rO   Úshow_versionsrÁ   W  s„   € ô ‹€HÜÓ €Iä	ˆ+ÔØ—>‘>Ó#ò "‰ˆˆ4Ü3r˜$˜Ð Õ!ð"ô 
Ð
"Ô#Ø—?‘?Ó$ò "‰ˆˆ4Ü3r˜$˜Ð Õ!ñ"rX   c           
     óf   — |D ],  }||v sŒ||   | k7  sŒd|› d| › d|› d||   › d	}t        |«      ‚ y )Nz`separator` and `z` do not match: `separator`=z and `z`=r‰   )r   )Ú	separatorÚnative_separatorsÚkwargsÚnative_separatorrK   s        rO   Ú_validate_separatorsrÇ   j  sk   € ð .ò !ÐØ˜vÒ%¨&Ð1AÑ*BÀiÓ*Oà#Ð$4Ð#5ð 6Ø(˜k¨Ð0@Ð/AÀÀFÐK[ÑD\ÐC]Ð]^ð`ð ô ˜C“.Ð ñ!rX   c                ó¾   — d|v r@|j                  d«      }|j                  | k7  rd| › d|j                  › d}t        |«      ‚|S ddlm} d|j                  | ¬«      iS )NÚparse_optionszD`separator` and `parse_options.delimiter` do not match: `separator`=z and `delimiter`=r‰   r   ©Úcsv)Ú	delimiter)ÚpoprÌ   r   ÚpyarrowrË   ÚParseOptions)rÃ   rÅ   rÉ   rK   rË   s        rO   Ú_validate_separator_pyarrowrÐ   v  sy   € Ø˜&Ñ ØŸ
™
 ?Ó3ˆØ×"Ñ" iÒ/ðØ(˜kÐ):¸=×;RÑ;RÐ:SÐSTðVð ô ˜C“.Ð ØˆÝà˜S×-Ñ-¸	Ð-ÓBÐCÐCrX   ú,©rÃ   c               óD  — t        j                  |«      }|j                  «       }|t         j                  t         j                  t         j
                  hv r,t        |dfi |¤Ž  |j                  t        | «      fd|i|¤Ž}nó|t         j                  u r |j                  t        | «      fd|i|¤Ž}nÂ|t         j                  u r&t        |fi |¤Ž}ddlm}  |j                  | fi |¤Ž}nŠ|t         j                  t         j                  t         j                   t         j"                  t         j$                  t         j&                  hv rd|› d| › d|› d	}t)        |«      ‚	  |j                  dd
| i|¤Ž}t-        |d¬«      S # t*        $ r}	d}t+        |«      |	‚d}	~	ww xY w)uš  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')`.

    Examples:
        >>> import narwhals as nw
        >>> nw.read_csv("file.csv", backend="pandas")  # doctest:+SKIP
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |        a   b     |
        |     0  1   4     |
        |     1  2   5     |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    ©ÚseprÕ   rÃ   r   rÊ   úExpected eager backend, found z .

Hint: use nw.scan_csv(source=ú
, backend=ú)Úsourcez?Unknown namespace is expected to implement `read_csv` function.NTrs   © )r   r]   re   ÚPANDASÚMODINÚCUDFrÇ   Úread_csvr   ÚPOLARSÚPYARROWrÐ   rÎ   rË   ÚPYSPARKÚDASKÚDUCKDBÚIBISÚSQLFRAMEr¦   rC   rg   r   )
rÙ   rR   rÃ   rÅ   Úimplro   r}   rË   rK   rm   s
             rO   rÞ   rÞ   …  s»  € ôD ×&Ñ& wÓ/€DØ×/Ñ/Ó1Ðà”×%Ñ%¤~×';Ñ';¼^×=PÑ=PÐQÑQÜ˜Y¨Ñ;°FÒ;Ø0Ð'×0Ñ0Ü˜6Ó"ñ
Ø(1ð
Ø5;ñ
‰ð 
”×&Ñ&Ñ	&Ø0Ð'×0Ñ0Ü˜6Ó"ñ
Ø.7ð
Ø;Añ
‰ð 
”×'Ñ'Ñ	'Ü,¨YÑA¸&ÑAˆÝà#s—|‘| FÑ5¨fÑ5‰Ø	Ü×ÑÜ×ÑÜ×ÑÜ×ÑÜ×ÑÜ×&Ñ&ðñ 
ð -¨T¨Fð 3,Ø,2¨8°:¸g¸YÀaðIð 	ô ˜‹oÐð	-ð 5Ð+×4Ñ4ÑM¸FÐMÀfÑMˆLô |°Ô5Ð5øô ò 	-ØSˆCÜ  Ó%¨1Ð,ûð	-ús   Å"F Æ	FÆFÆFc               óz  — t        j                  |«      }|j                  «       }t        | «      } |t         j                  u r |j
                  | fd|i|¤Ž}n«|t         j                  t         j                  t         j                  t         j                  t         j                  hv r$t        |dfi |¤Ž  |j                  | fd|i|¤Ž}n8|t         j                  u r$t        |dfi |¤Ž  |j                  | fd|i|¤Ž}n|t         j                  u r&t        |fi |¤Ž}ddlm}  |j                  | fi |¤Ž}nÊ|j%                  «       r¥t        |dfi |¤Ž |j'                  d	d
«      x}€d}	t)        |	«      ‚|j*                  j-                  d«      }
|t         j.                  u r&|j1                  «       dk  r|
j3                  | |¬«      n" |
j4                  dd|i|¤Žj3                  | «      }n	  |j
                  dd| i|¤Ž}t9        |«      j;                  «       S # t6        $ r}d}	t7        |	«      |‚d
}~ww xY w)u¶  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')`.

    Examples:
        >>> import duckdb
        >>> import narwhals as nw
        >>>
        >>> nw.scan_csv("file.csv", backend="duckdb").to_native()  # doctest:+SKIP
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚    a    â”‚   b   â”‚
        â”‚ varchar â”‚ int32 â”‚
        â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”¤
        â”‚ x       â”‚     1 â”‚
        â”‚ y       â”‚     2 â”‚
        â”‚ z       â”‚     3 â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
    rÃ   rÔ   rÕ   )rÌ   ÚdelimrÕ   rÌ   r   rÊ   )rÕ   rÌ   ÚsessionNúFSpark like backends require a session object to be passed in `kwargs`.rË   ©é   é   r   rÙ   z?Unknown namespace is expected to implement `scan_csv` function.rÚ   )r   r]   re   r   rß   Úscan_csvrÛ   rÜ   rÝ   râ   rä   rÇ   rÞ   rã   rà   rÐ   rÎ   rË   Úis_spark_likerÍ   rC   ÚreadÚformatrå   Ú_backend_versionÚloadÚoptionsrg   r   Úlazy)rÙ   rR   rÃ   rÅ   rh   ro   r}   rË   ré   rK   Ú
csv_readerrm   s               rO   rî   rî   Ð  sA  € ôP $×0Ñ0°Ó9€NØ%×9Ñ9Ó;Ðä˜FÓ#€FØœ×.Ñ.Ñ.Ø0Ð'×0Ñ0°ÑWÀ9ÐWÐPVÑWŠØ	Ü×ÑÜ×ÑÜ×ÑÜ×ÑÜ×Ñðñ 
ô 	˜Y¨Ñ;°FÒ;Ø0Ð'×0Ñ0°ÑQ¸YÐQÈ&ÑQŠØ	œ>×0Ñ0Ñ	0Ü˜YÐ(EÑPÈÒPØ0Ð'×0Ñ0°ÑWÀ9ÐWÐPVÑWŠØ	œ>×1Ñ1Ñ	1Ü,¨YÑA¸&ÑAˆÝà#s—|‘| FÑ5¨fÑ5‰Ø	×	%Ñ	%Ô	'Ü˜YÐ(<ÑGÀÒGØ—z‘z )¨TÓ2Ð2ˆGÐ;ØZˆCÜ˜S“/Ð!Ø—\‘\×(Ñ(¨Ó/ˆ
ð ¤.×"9Ñ"9Ñ9Ø"×3Ñ3Ó5¸
ÒBð O‰O˜F¨	ˆOÔ2ð
 $×#Ñ#Ñ<¨	Ð<°VÑ<×AÑAÀ&ÓIñ 	ð	-ð 5Ð+×4Ñ4ÑM¸FÐMÀfÑMˆLô |Ó$×)Ñ)Ó+Ð+øô ò 	-ØSˆCÜ  Ó%¨1Ð,ûð	-ús   Ç1H È	H:È'H5È5H:c               óÎ  — t        j                  |«      }|j                  «       }|t         j                  t         j                  t         j
                  t         j                  hv rt        | «      }  |j                  | fi |¤Ž}n¶|t         j                  u rddl
m}  |j                  | fi |¤Ž}nŠ|t         j                  t         j                  t         j                  t         j                   t         j"                  t         j$                  hv rd|› d| › d|› d}t'        |«      ‚	  |j                  dd| i|¤Ž}t+        |d	¬
«      S # t(        $ r}d}t)        |«      |‚d}~ww xY w)uì  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')`.

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> nw.read_parquet("file.parquet", backend="pyarrow")  # doctest:+SKIP
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |pyarrow.Table     |
        |a: int64          |
        |c: double         |
        |----              |
        |a: [[1,2]]        |
        |c: [[0.2,0.1]]    |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r   NrÖ   z$.

Hint: use nw.scan_parquet(source=r×   rØ   rÙ   zCUnknown namespace is expected to implement `read_parquet` function.Trs   rÚ   )r   r]   re   rß   rÛ   rÜ   rÝ   r   Úread_parquetrà   Úpyarrow.parquetÚparquetÚ
read_tablerá   râ   rã   rä   rå   r¦   rC   rg   r   )	rÙ   rR   rÅ   ræ   ro   r}   ÚpqrK   rm   s	            rO   rø   rø   (  si  € ôD ×&Ñ& wÓ/€DØ×/Ñ/Ó1ÐàÜ×ÑÜ×ÑÜ×ÑÜ×Ñð	ñ ô   Ó'ˆØ4Ð'×4Ñ4°VÑF¸vÑF‰Ø	”×'Ñ'Ñ	'Ý$à$r—}‘} VÑ6¨vÑ6‰Ø	Ü×ÑÜ×ÑÜ×ÑÜ×ÑÜ×ÑÜ×&Ñ&ðñ 
ð -¨T¨Fð 30Ø06¨x°zÀ'ÀÈ!ðMð 	ô ˜‹oÐð	-ð 9Ð+×8Ñ8ÑQÀÐQÈ&ÑQˆLô |°Ô5Ð5øô ò 	-ØWˆCÜ  Ó%¨1Ð,ûð	-ús   Ä'E Å	E$ÅEÅE$c               óÎ  — t        j                  |«      }|j                  «       }t        | «      } |t         j                  u r |j
                  | fi |¤Ž}nW|t         j                  t         j                  t         j                  t         j                  t         j                  t         j                  hv r |j                  | fi |¤Ž}nå|t         j                  u rddlm}  |j                   | fi |¤Ž}n¹|j#                  «       r”|j%                  dd«      x}€d}t'        |«      ‚|j(                  j+                  d«      }	|t         j,                  u r$|j/                  «       dk  r|	j1                  | «      n  |	j2                  d	i |¤Žj1                  | «      }n	  |j
                  d	d| i|¤Ž}t7        |«      j9                  «       S # t4        $ r}
d}t5        |«      |
‚d}
~
ww xY w)
u	  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')`.

    Examples:
        >>> import dask.dataframe as dd
        >>> from sqlframe.duckdb import DuckDBSession
        >>> import narwhals as nw
        >>>
        >>> nw.scan_parquet("file.parquet", backend="dask").collect()  # doctest:+SKIP
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |        a   b     |
        |     0  1   4     |
        |     1  2   5     |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        >>> nw.scan_parquet(
        ...     "file.parquet", backend="sqlframe", session=DuckDBSession()
        ... ).collect()  # doctest:+SKIP
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  pyarrow.Table   |
        |  a: int64        |
        |  b: int64        |
        |  ----            |
        |  a: [[1,2]]      |
        |  b: [[4,5]]      |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r   Nré   rê   rú   rë   rÙ   zCUnknown namespace is expected to implement `scan_parquet` function.rÚ   )r   r]   re   r   rß   Úscan_parquetrÛ   rÜ   rÝ   râ   rã   rä   rø   rà   rù   rú   rû   rï   rÍ   rC   rð   rñ   rå   rò   ró   rô   rg   r   rõ   )rÙ   rR   rÅ   rh   ro   r}   rü   ré   rK   Ú	pq_readerrm   s              rO   rþ   rþ   q  sÌ  € ô| $×0Ñ0°Ó9€NØ%×9Ñ9Ó;Ðä˜FÓ#€FØœ×.Ñ.Ñ.Ø4Ð'×4Ñ4°VÑF¸vÑFŠØ	Ü×ÑÜ×ÑÜ×ÑÜ×ÑÜ×ÑÜ×Ñðñ 
ð 5Ð'×4Ñ4°VÑF¸vÑF‰Ø	œ>×1Ñ1Ñ	1Ý$à$r—}‘} VÑ6¨vÑ6‰Ø	×	%Ñ	%Ô	'Ø—z‘z )¨TÓ2Ð2ˆGÐ;ØZˆCÜ˜S“/Ð!Ø—L‘L×'Ñ'¨	Ó2ˆ	ð ¤.×"9Ñ"9Ñ9Ø"×3Ñ3Ó5¸
ÒBð N‰N˜6Ô"ð
 #×"Ñ"Ñ, VÑ,×1Ñ1°&Ó9ñ 	ð	-ð 9Ð+×8Ñ8ÑQÀÐQÈ&ÑQˆLô |Ó$×)Ñ)Ó+Ð+øô ò 	-ØWˆCÜ  Ó%¨1Ð,ûð	-ús   ÆG Ç	G$ÇGÇG$c                 ób   — t        | «      }t        t        t        j                  d|¬«      «      S )u¿  Creates an expression that references one or more columns by their name(s).

    Arguments:
        names: Name(s) of the columns to use.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 2], "b": [3, 4], "c": ["x", "z"]})
        >>> nw.from_native(df_native).select(nw.col("a", "b") * nw.col("b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (2, 2)   |
        |  â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”   |
        |  â”‚ a   â”† b   â”‚   |
        |  â”‚ --- â”† --- â”‚   |
        |  â”‚ i64 â”† i64 â”‚   |
        |  â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡   |
        |  â”‚ 3   â”† 9   â”‚   |
        |  â”‚ 8   â”† 16  â”‚   |
        |  â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜   |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úcol©Únames)r   r   r
   r	   ÚCOL)r  Ú
flat_namess     rO   r  r  Û  s%   € ô4 ˜“€JÜ”œŸ™ u°JÔ?Ó@Ð@rX   c                 óp   — t        t        t        j                  dt	        t        | «      «      ¬«      «      S )u}  Creates an expression that excludes columns by their name(s).

    Arguments:
        names: Name(s) of the columns to exclude.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 2], "b": [3, 4], "c": ["x", "z"]})
        >>> nw.from_native(df_native).select(nw.exclude("c", "a"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (2, 1)   |
        |  â”Œâ”€â”€â”€â”€â”€â”         |
        |  â”‚ b   â”‚         |
        |  â”‚ --- â”‚         |
        |  â”‚ i64 â”‚         |
        |  â•žâ•â•â•â•â•â•¡         |
        |  â”‚ 3   â”‚         |
        |  â”‚ 4   â”‚         |
        |  â””â”€â”€â”€â”€â”€â”˜         |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r«   r  )r   r
   r	   ÚEXCLUDEÚ	frozensetr   r  s    rO   r«   r«   ù  s'   € ô4 ”œ×)Ñ)¨9¼IÄgÈeÃnÓ<UÔVÓWÐWrX   c                 ób   — t        | «      }t        t        t        j                  d|¬«      «      S )u  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.

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> df_native = pa.table({"a": [1, 2], "b": [3, 4], "c": [0.123, 3.14]})
        >>> nw.from_native(df_native).select(nw.nth(0, 2) * 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |pyarrow.Table     |
        |a: int64          |
        |c: double         |
        |----              |
        |a: [[2,4]]        |
        |c: [[0.246,6.28]] |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Únth)Úindices)r   r   r
   r	   ÚNTH)r  Úflat_indicess     rO   r
  r
    s&   € ô6 ˜7Ó#€LÜ”œŸ™ u°lÔCÓDÐDrX   c                 óH   — t        t        t        j                  d«      «      S )u3  Instantiate an expression representing all columns.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> df_native = pd.DataFrame({"a": [1, 2], "b": [3.14, 0.123]})
        >>> nw.from_native(df_native).select(nw.all() * 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |      a      b    |
        |   0  2  6.280    |
        |   1  4  0.246    |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úall)r   r
   r	   ÚALLrÚ   rX   rO   Úall_r  6  s   € ô" ”œŸ™ uÓ-Ó.Ð.rX   c                 óH   — t        t        t        j                  d«      «      S )uÝ  Return the number of rows.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 2], "b": [5, None]})
        >>> nw.from_native(df_native).select(nw.len())
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (1, 1)   |
        |  â”Œâ”€â”€â”€â”€â”€â”         |
        |  â”‚ len â”‚         |
        |  â”‚ --- â”‚         |
        |  â”‚ u32 â”‚         |
        |  â•žâ•â•â•â•â•â•¡         |
        |  â”‚ 2   â”‚         |
        |  â””â”€â”€â”€â”€â”€â”˜         |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úlen©r   r
   r	   ÚAGGREGATIONrÚ   rX   rO   Úlen_r  K  s   € ô, ”œ×-Ñ-¨uÓ5Ó6Ð6rX   c                 ó.   — t        | Ž j                  «       S )u  Sum all values.

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

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> df_native = pd.DataFrame({"a": [1, 2], "b": [-1.4, 6.2]})
        >>> nw.from_native(df_native).select(nw.sum("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |       a    b     |
        |    0  3  4.8     |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    )r  Úsum©Úcolumnss    rO   r  r  d  ó   € ô, ˆ=×ÑÓÐrX   c                 ó.   — t        | Ž j                  «       S )us  Get the mean value.

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

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> df_native = pa.table({"a": [1, 8, 3], "b": [3.14, 6.28, 42.1]})
        >>> nw.from_native(df_native).select(nw.mean("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |   Narwhals DataFrame    |
        |-------------------------|
        |pyarrow.Table            |
        |a: double                |
        |b: double                |
        |----                     |
        |a: [[4]]                 |
        |b: [[17.173333333333336]]|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    )r  Úmeanr  s    rO   r  r  }  s   € ô4 ˆ=×ÑÓÐrX   c                 ó.   — t        | Ž j                  «       S )u  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

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [4, 5, 2]})
        >>> nw.from_native(df_native).select(nw.median("a"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (1, 1)   |
        |  â”Œâ”€â”€â”€â”€â”€â”         |
        |  â”‚ a   â”‚         |
        |  â”‚ --- â”‚         |
        |  â”‚ f64 â”‚         |
        |  â•žâ•â•â•â•â•â•¡         |
        |  â”‚ 4.0 â”‚         |
        |  â””â”€â”€â”€â”€â”€â”˜         |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    )r  Úmedianr  s    rO   r  r  š  s   € ô< ˆ=×ÑÓ!Ð!rX   c                 ó.   — t        | Ž j                  «       S )u  Return the minimum value.

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

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function.

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> df_native = pa.table({"a": [1, 2], "b": [5, 10]})
        >>> nw.from_native(df_native).select(nw.min("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  pyarrow.Table   |
        |  a: int64        |
        |  b: int64        |
        |  ----            |
        |  a: [[1]]        |
        |  b: [[5]]        |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    )r  Úminr  s    rO   r!  r!  »  s   € ô4 ˆ=×ÑÓÐrX   c                 ó.   — t        | Ž j                  «       S )u—  Return the maximum value.

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

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> df_native = pd.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> nw.from_native(df_native).select(nw.max("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |        a   b     |
        |     0  2  10     |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    )r  Úmaxr  s    rO   r#  r#  Ø  r  rX   c                ó|   — |sd| › d}t        |«      ‚t        t        t        j                  | fd|i|¤ddi¤Ž«      S )Nz+At least one expression must be passed to `ú`ÚexprsÚallow_multi_outputT)rC   r   r
   r	   ÚELEMENTWISE)rT   r&  rÅ   rK   s       rO   Ú_expr_with_horizontal_opr)  ñ  sU   € ÙØ;¸D¸6ÀÐCˆÜ˜‹oÐÜÜÜ× Ñ  $ñ	
Ø.3ð	
Ø7=ñ	
ØRVò	
óð rX   c                óR   — t        t        t        j                  d| |f|¬«      «      S )uÝ  Compute 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')

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 2, 3], "b": [0, 3, 2]})
        >>> nw.from_native(df_native).select(
        ...     pearson=nw.corr("a", "b", method="pearson"),
        ...     spearman=nw.corr("a", "b", method="spearman"),
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |  Narwhals DataFrame   |
        |-----------------------|
        |shape: (1, 2)          |
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚ pearson  â”† spearman â”‚|
        |â”‚ ---      â”† ---      â”‚|
        |â”‚ f64      â”† f64      â”‚|
        |â•žâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡|
        |â”‚ 0.654654 â”† 0.5      â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úcorr)r&  Úmethodr  )ÚaÚbr,  s      rO   r+  r+  ü  s$   € ô< ”œ×-Ñ-¨v¸aÀ¸VÈFÔSÓTÐTrX   c                 ó,   — t        dgt        | «      ¢­Ž S )u¸  Sum 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.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 2, 3], "b": [5, 10, None]})
        >>> nw.from_native(df_native).with_columns(sum=nw.sum_horizontal("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        | Narwhals DataFrame |
        |--------------------|
        |shape: (3, 3)       |
        |â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”|
        |â”‚ a   â”† b    â”† sum â”‚|
        |â”‚ --- â”† ---  â”† --- â”‚|
        |â”‚ i64 â”† i64  â”† i64 â”‚|
        |â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡|
        |â”‚ 1   â”† 5    â”† 6   â”‚|
        |â”‚ 2   â”† 10   â”† 12  â”‚|
        |â”‚ 3   â”† null â”† 3   â”‚|
        |â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úsum_horizontal©r)  r   ©r&  s    rO   r0  r0    ó   € ô> $Ð$4ÐF´w¸u³~ÒFÐFrX   c                 ó,   — t        dgt        | «      ¢­Ž S )u¨  Get 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.

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> df_native = pa.table({"a": [1, 8, 3], "b": [4, 5, None]})
        >>> nw.from_native(df_native).with_columns(h_min=nw.min_horizontal("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        | pyarrow.Table    |
        | a: int64         |
        | b: int64         |
        | h_min: int64     |
        | ----             |
        | a: [[1,8,3]]     |
        | b: [[4,5,null]]  |
        | h_min: [[1,5,3]] |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úmin_horizontalr1  r2  s    rO   r5  r5  ?  s   € ô: $Ð$4ÐF´w¸u³~ÒFÐFrX   c                 ó,   — t        dgt        | «      ¢­Ž S )uá  Get 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.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> df_native = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, None]})
        >>> nw.from_native(df_native).with_columns(h_max=nw.max_horizontal("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |  Narwhals DataFrame  |
        |----------------------|
        |shape: (3, 3)         |
        |â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚ a   â”† b    â”† h_max â”‚|
        |â”‚ --- â”† ---  â”† ---   â”‚|
        |â”‚ i64 â”† i64  â”† i64   â”‚|
        |â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡|
        |â”‚ 1   â”† 4    â”† 4     â”‚|
        |â”‚ 8   â”† 5    â”† 8     â”‚|
        |â”‚ 3   â”† null â”† 3     â”‚|
        |â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úmax_horizontalr1  r2  s    rO   r7  r7  _  r3  rX   c                  ó(   — e Zd Z	 	 	 	 	 	 dd„Zdd„Zy)ÚWhenc               óD   — t        t        |«      ddiŽ| _        || _        y )NÚignore_nullsF)Úall_horizontalr   Ú
_predicateÚ_chain)ÚselfÚchainÚ
predicatess      rO   Ú__init__zWhen.__init__‚  s!   € ô
 )¬'°*Ó*=ÐRÈEÑRˆŒØˆrX   c                óf   — g | j                   ¢| j                  |f‘­}t        j                  |«      S r¨   )r>  r=  ÚThenÚ_from_chain)r?  r„   Ú	new_chains      rO   Úthenz	When.thenŠ  s/   € Ø<d—k‘kÐ< D§O¡O°UÐ#;Ñ<ˆ	Ü×Ñ 	Ó*Ð*rX   N)rA  úIntoExpr | Iterable[IntoExpr]r@  ú4tuple[tuple[Expr, IntoExpr | NonNestedLiteral], ...]ÚreturnÚNone)r„   úIntoExpr | NonNestedLiteralrJ  rD  )Ú__name__Ú
__module__Ú__qualname__rB  rG  rÚ   rX   rO   r9  r9    s)   „ ðà2ðð Dðð 
ó	ô+rX   r9  c                  ó–   — e Zd ZU ded<   dZded<   dZded<   edd„«       Zej                  dd	„«       Ze		 	 	 	 dd
„«       Z
dd„Zdd„Zy)rD  rI  r>  Nztuple[ExprNode, ...] | NoneÚ_cached_nodesz"IntoExpr | NonNestedLiteral | NoneÚ
_otherwisec           	     óF  — | j                   r| j                   S | j                  }t        | j                  «      D ]7  \  }}|€||f}n|||f}t	        t        t        j                  d|d¬«      «      }Œ9 t        |t        «      sJ ‚|j                  | _         | j                   S )NÚ	when_thenF©r&  r'  )
rQ  rR  Úreversedr>  r   r
   r	   r(  r   Ú_nodes)r?  ÚexprÚ	predicateÚ
then_valuer&  s        rO   rW  zThen._nodes”  s¦   € à×ÒØ×%Ñ%Ð%Ø‰ˆÜ%-¨d¯k©kÓ%:ò 	Ñ!ˆIzØˆ|ØBKÈZÐAX‘à" J°Ð5ÜÜÜ×(Ñ(ØØØ',ô	ó‰Dð	ô ˜$¤Ô%Ð%Ð%Ø!Ÿ[™[ˆÔØ×!Ñ!Ð!rX   c                ó.   — | j                   J ‚|| _         y r¨   )rQ  )r?  Únodess     rO   rW  zThen._nodesª  s   € à×!Ñ!Ð)Ð)Ð)Ø"ˆÕrX   c                ó"   —  | «       }||_         |S r¨   )r>  )Úclsr@  rµ   s      rO   rE  zThen._from_chain¯  s   € ñ “ˆØˆŒØˆrX   c                ój   — | j                  | j                  «      }||_        t        |j                  Ž S r¨   )rE  r>  rR  r   rW  )r?  Úotherwise_valuerX  s      rO   Ú	otherwisezThen.otherwise·  s,   € Ø×Ñ §¡Ó,ˆØ)ˆŒÜT—[‘[Ð!Ð!rX   c                ó,   — t        |d| j                  iŽS )Nr@  )r9  r>  )r?  rA  s     rO   Úwhenz	Then.when¼  s   € ÜZÐ3 t§{¡{Ñ3Ð3rX   )rJ  útuple[ExprNode, ...])r\  rd  rJ  rK  )r@  rI  rJ  r!   )r`  rL  rJ  r   ©rA  rH  rJ  r9  )rM  rN  rO  Ú__annotations__rQ  rR  ÚpropertyrW  ÚsetterÚclassmethodrE  ra  rc  rÚ   rX   rO   rD  rD    sv   … Ø@Ó@Ø15€MÐ.Ó5Ø59€JÐ2Ó9àò"ó ð"ð* ‡]]ò#ó ð#ð ðØHðà	òó ðó"ô
4rX   rD  c                 ó   — t        | ddiŽS )uç  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.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> data = {"a": [1, 2, 3], "b": [5, 10, 15]}
        >>> df_native = pd.DataFrame(data)
        >>> nw.from_native(df_native).with_columns(
        ...     nw.when(nw.col("a") < 2)
        ...     .then(5)
        ...     .when(nw.col("a") < 3)
        ...     .then(6)
        ...     .otherwise(6)
        ...     .alias("a_when")
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |    a   b  a_when |
        | 0  1   5       5 |
        | 1  2  10       6 |
        | 2  3  15       6 |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r@  rÚ   )r9  )rA  s    rO   rc  rc  À  s   € ôP Ð& 2Ñ&Ð&rX   c                ó2   — t        dgt        |«      ¢­d| iŽS )uÆ  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.

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> data = {
        ...     "a": [False, False, True, True, False, None],
        ...     "b": [False, True, True, None, None, None],
        ... }
        >>> df_native = pa.table(data)
        >>> nw.from_native(df_native).select(
        ...     "a", "b", all=nw.all_horizontal("a", "b", ignore_nulls=False)
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |           Narwhals DataFrame            |
        |-----------------------------------------|
        |pyarrow.Table                            |
        |a: bool                                  |
        |b: bool                                  |
        |all: bool                                |
        |----                                     |
        |a: [[false,false,true,true,false,null]]  |
        |b: [[false,true,true,null,null,null]]    |
        |all: [[false,false,true,null,false,null]]|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r<  r;  r1  ©r;  r&  s     rO   r<  r<  ë  s)   € ôL $ØðÜ" 5›>òØ8Dñð rX   c                óf  — t        | «      rd}t        |«      ‚t        | «      ri| s|sed}t        |«      ‚t        | t        «      r-t        d„ | j                  «       D «       «      r(d}t        |«      ‚t        | d   «      rd}t        |«      ‚t        t        t        j                  d| |¬«      «      S )u  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.

    Examples:
        Scalar literals:

        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> df_nw = nw.from_native(pa.table({"a": [1, 2]}))
        >>> df_nw.with_columns(nw.lit(3))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        | pyarrow.Table    |
        | a: int64         |
        | literal: int64   |
        | ----             |
        | a: [[1,2]]       |
        | literal: [[3,3]] |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        List literals (creates a List column):

        >>> df_nw.with_columns(nw.lit([1, 2, 3]).alias("list_col"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |     Narwhals DataFrame      |
        |-----------------------------|
        |pyarrow.Table                |
        |a: int64                     |
        |list_col: list<item: int64>  |
        |  child 0, item: int64       |
        |----                         |
        |a: [[1,2]]                   |
        |list_col: [[[1,2,3],[1,2,3]]]|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        Dict literals (creates a Struct column):

        >>> df_nw.with_columns(nw.lit({"x": 1, "y": 2}).alias("struct_col"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |          Narwhals DataFrame          |
        |--------------------------------------|
        |pyarrow.Table                         |
        |a: int64                              |
        |struct_col: struct<x: int64, y: int64>|
        |  child 0, x: int64                   |
        |  child 1, y: int64                   |
        |----                                  |
        |a: [[1,2]]                            |
        |struct_col: [                         |
        |  -- is_valid: all not null           |
        |  -- child 0 type: int64              |
        |[1,1]                                 |
        |  -- child 1 type: int64              |
        |[2,2]]                                |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    zvnumpy arrays are not supported as literal values. Consider using `with_columns` to create a new column from the array.zZCannot infer dtype for empty nested structure. Please provide an explicit dtype parameter.c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr¨   )r   )rª   Úvs     rO   r¬   zlit.<locals>.<genexpr>c  s   è ø€ Ò@¨AÔ$ Q×'Ñ@ùó   ‚z7Nested structures with nested values are not supported.r   Úlit)r„   rV   )r   rC   r   r   rŸ   ÚanyrU   rE   r   r
   r	   ÚLITERAL)r„   rV   rK   s      rO   rq  rq    s§   € ôB eÔðSð 	ô ˜‹oÐÜ˜ÔÙÙØrÜ  “oÐ%Ü˜œtÔ$ÜÑ@°·±³Ô@Ô@ØOÜ)¨#Ó.Ð.Ü˜u Q™xÔ(ØKˆCÜ% cÓ*Ð*Ü”œ×)Ñ)¨5¸ÀUÔKÓLÐLrX   c                ó2   — t        dgt        |«      ¢­d| iŽS )u[  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.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>>
        >>> data = {
        ...     "a": [False, False, True, True, False, None],
        ...     "b": [False, True, True, None, None, None],
        ... }
        >>> df_native = pl.DataFrame(data)
        >>> nw.from_native(df_native).select(
        ...     "a", "b", any=nw.any_horizontal("a", "b", ignore_nulls=False)
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |   Narwhals DataFrame    |
        |-------------------------|
        |shape: (6, 3)            |
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚ a     â”† b     â”† any   â”‚|
        |â”‚ ---   â”† ---   â”† ---   â”‚|
        |â”‚ bool  â”† bool  â”† bool  â”‚|
        |â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡|
        |â”‚ false â”† false â”† false â”‚|
        |â”‚ false â”† true  â”† true  â”‚|
        |â”‚ true  â”† true  â”† true  â”‚|
        |â”‚ true  â”† null  â”† true  â”‚|
        |â”‚ false â”† null  â”† null  â”‚|
        |â”‚ null  â”† null  â”† null  â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úany_horizontalr;  r1  rl  s     rO   ru  ru  l  s)   € ôV $ØðÜ" 5›>òØ8Dñð rX   c                 ó,   — t        dgt        | «      ¢­Ž S )u‰  Compute the mean of all values horizontally across columns.

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

    Examples:
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>>
        >>> data = {"a": [1, 8, 3], "b": [4, 5, None], "c": ["x", "y", "z"]}
        >>> df_native = pa.table(data)

        We define a dataframe-agnostic function that computes the horizontal mean of "a"
        and "b" columns:

        >>> nw.from_native(df_native).select(nw.mean_horizontal("a", "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        | pyarrow.Table    |
        | a: double        |
        | ----             |
        | a: [[2.5,6.5,3]] |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Úmean_horizontalr1  r2  s    rO   rw  rw  œ  s   € ô6 $Ð$5ÐG¼À»ÒGÐGrX   r­   F©rÃ   r;  c               óT   — t        g t        | g«      ¢|¢«      }t        dg|¢­||dœŽS )uH  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.

    Examples:
        >>> import pandas as pd
        >>> import narwhals as nw
        >>>
        >>> data = {
        ...     "a": [1, 2, 3],
        ...     "b": ["dogs", "cats", None],
        ...     "c": ["play", "swim", "walk"],
        ... }
        >>> df_native = pd.DataFrame(data)
        >>> (
        ...     nw.from_native(df_native).select(
        ...         nw.concat_str(
        ...             [nw.col("a") * 2, nw.col("b"), nw.col("c")], separator=" "
        ...         ).alias("full_sentence")
        ...     )
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |   full_sentence  |
        | 0   2 dogs play  |
        | 1   4 cats swim  |
        | 2           NaN  |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    Ú
concat_strrx  )r   r)  )r&  rÃ   r;  Ú
more_exprsÚ
flat_exprss        rO   rz  rz  º  sC   € ôZ Ð9œ7 E 7Ó+Ð9¨jÐ9Ó:€JÜ#ØðØ!ñØ-6À\òð rX   c                óR  — t        g t        | g«      ¢|¢«      }|D cg c]*  }t        |t        «      st        |«      st	        |«      s|‘Œ, }}|r-dt        ›ddj                  d„ |D «       «      › }t        |«      ‚t        t        t        j                  d|d¬«      «      S c c}w )u  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.

    Examples:
        >>> import polars as pl
        >>> import narwhals as nw
        >>> data = [
        ...     (1, 5, None),
        ...     (None, 6, None),
        ...     (None, None, 9),
        ...     (4, 8, 10),
        ...     (None, None, None),
        ... ]
        >>> df = pl.DataFrame(data, schema=["a", "b", "c"], orient="row")
        >>> nw.from_native(df).select(nw.coalesce("a", "b", "c", nw.lit(-1)))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |Narwhals DataFrame|
        |------------------|
        |  shape: (5, 1)   |
        |  â”Œâ”€â”€â”€â”€â”€â”         |
        |  â”‚ a   â”‚         |
        |  â”‚ --- â”‚         |
        |  â”‚ i64 â”‚         |
        |  â•žâ•â•â•â•â•â•¡         |
        |  â”‚ 1   â”‚         |
        |  â”‚ 6   â”‚         |
        |  â”‚ 9   â”‚         |
        |  â”‚ 4   â”‚         |
        |  â”‚ -1  â”‚         |
        |  â””â”€â”€â”€â”€â”€â”˜         |
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    z,All arguments to `coalesce` must be of type zJ, Expr, or Series.
Got the following invalid arguments (type, value):
    z, c              3  óH   K  — | ]  }t        t        |«      |f«      –— Œ y ­wr¨   )Úreprr‹   ©rª   rm   s     rO   r¬   zcoalesce.<locals>.<genexpr>$  s   è ø€ ÒE°aœt¤T¨!£W¨a L×1ÑEùs   ‚ "ÚcoalesceTrU  )r   r   Ústrr   r   Újoinr   r   r
   r	   r(  )r&  r{  r|  rX  Ú	non_exprsrK   s         rO   r  r  í  s¾   € ôX Ð9œ7 E 7Ó+Ð9¨jÐ9Ó:€Jð öàÜ˜4¤Ô%¬°¬¼)ÀD¼/ò 	ð€Ið ñ
 à:¼3¸'ð Bà—Y‘YÑE¸9ÔEÓEÐFðHð 	ô
 ˜‹nÐäÜÜ× Ñ  *°JÐSWô	
óð ùòs   ž/B$c                ó‚  — | j                  d«      x}t        |«      k7  rd|› dt        |«      › d}t        |«      ‚g }t        |«      }t	        | j                  d«      «      D ]M  \  }}|dkD  r|j                  t        |«      «       t        |«      dkD  sŒ4|j                  t        |«      «       ŒO t        |d¬«      S )uH  Format expressions as a string.

    Arguments:
        f_string: A string that with placeholders.
        args: Expression(s) that fill the placeholders.

    Examples:
        >>> import duckdb
        >>> import narwhals as nw
        >>> rel = duckdb.sql("select * from values ('a', 1), ('b', 2), ('c', 3) df(a, b)")
        >>> df = nw.from_native(rel)
        >>> df.with_columns(formatted=nw.format("foo_{}_bar_{}", nw.col("a"), "b"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |       Narwhals LazyFrame        |
        |---------------------------------|
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚    a    â”‚   b   â”‚  formatted  â”‚|
        |â”‚ varchar â”‚ int32 â”‚   varchar   â”‚|
        |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
        |â”‚ a       â”‚     1 â”‚ foo_a_bar_1 â”‚|
        |â”‚ b       â”‚     2 â”‚ foo_b_bar_2 â”‚|
        |â”‚ c       â”‚     3 â”‚ foo_c_bar_3 â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    z{}zFnumber of placeholders should equal the number of arguments. Expected z arguments, got r‰   r   r­   rÒ   )
Úcountr  rC   ÚiterÚ	enumerateÚsplitÚappendÚnextrq  rz  )Úf_stringÚargsÚn_placeholdersrK   r&  ÚitÚiÚss           rO   rñ   rñ   /  sÇ   € ð4 #Ÿ.™.¨Ó.Ð.ˆ´3°t³9Ò<ØVÐWeÐVfÐfvÔwzÐ{ó  xAð  wBð  BCð  DˆÜ˜‹oÐà€EÜ	ˆd‹€BÜ˜(Ÿ.™.¨Ó.Ó/ò !‰ˆˆ1ØˆqŠ5ØL‰Lœ˜b›Ô"Üˆq‹6A‹:ØL‰Lœ˜Q›Õ ð	!ô
 e rÔ*Ð*rX   c                 óÂ   — g d„ t        | «      D «       ¢d„ |j                  «       D «       ¢}|sd}t        |«      ‚t        t	        t
        j                  d|d¬«      «      S )uì  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.

    Examples:
        Collect all columns of a dataframe into a struct by passing `pl.all()`.

        >>> import duckdb
        >>> import narwhals as nw
        >>> rel = duckdb.sql(
        ...     "select * from values (1, 'a', True, [1, 2]), (2, 'b', False, [3]) df(int, str, bool, list)"
        ... )
        >>> df = nw.from_native(rel)
        >>> df.select(nw.struct(nw.all()).alias("my_struct"))
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |                         Narwhals LazyFrame                         |
        |--------------------------------------------------------------------|
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚                            my_struct                             â”‚|
        |â”‚ struct("int" integer, str varchar, bool boolean, list integer[]) â”‚|
        |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
        |â”‚ {'int': 1, 'str': a, 'bool': true, 'list': [1, 2]}               â”‚|
        |â”‚ {'int': 2, 'str': b, 'bool': false, 'list': [3]}                 â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        It's possible to specify the column names directly and use named expressions:

        >>> df.select(
        ...     nw.struct("int", x=nw.col("str").str.len_chars(), q="bool").alias(
        ...         "my_struct"
        ...     )
        ... )
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        |              Narwhals LazyFrame              |
        |----------------------------------------------|
        |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
        |â”‚                 my_struct                  â”‚|
        |â”‚ struct("int" integer, x bigint, q boolean) â”‚|
        |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
        |â”‚ {'int': 1, 'x': 1, 'q': true}              â”‚|
        |â”‚ {'int': 2, 'x': 1, 'q': false}             â”‚|
        |â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr¨   )r   r€  s     rO   r¬   zstruct.<locals>.<genexpr>Œ  s   è ø€ Ò	6 !Ô
˜1×
Ñ	6ùrp  c              3  óV   K  — | ]!  \  }}t        |«      j                  |«      –— Œ# y ­wr¨   )r   rf   )rª   Únrm   s      rO   r¬   zstruct.<locals>.<genexpr>  s%   è ø€ Ò	G©4¨1¨aÔ
˜1Ó
×
#Ñ
# A×
&Ñ	Gùs   ‚')z*expected at least 1 expression in 'struct'ÚstructTrU  )r   rJ   rC   r   r
   r	   r(  )r&  Únamed_exprsr|  rK   s       rO   r–  r–  W  sj   € ðhÙ	6¤w¨u£~Ô	6ðá	G°;×3DÑ3DÓ3FÔ	Gð€Jñ Ø:ˆÜ˜‹oÐäÜÜ× Ñ  (°*ÐQUô	
óð rX   )rJ   zIterable[FrameT]r=   r/   rJ  r2   r¨   )
rT   r‚  rU   r   rV   úIntoDType | NonerR   úIntoBackend[EagerAllowed]rJ  zSeries[Any])
r{   zMapping[str, Any]rq   ú.IntoSchema | Mapping[str, DType | None] | NonerR   z IntoBackend[EagerAllowed] | Nonero   zModuleType | NonerJ  úDataFrame[Any])r{   zMapping[str, Series[Any] | Any]rJ  z/tuple[dict[str, Series[Any] | Any], ModuleType])r{   zSequence[Mapping[str, Any]]rq   rš  rR   r™  rJ  r›  )r{   r8   rq   r9   rR   r™  rJ  r›  )r‘   r   rJ  zTypeIs[_IntoSchema])r}   r'   rR   r™  rJ  r›  )rJ  zdict[str, str])rJ  rK  )rÃ   r‚  rÄ   ztuple[str, ...]rÅ   r   rJ  rK  )rÃ   r‚  rÅ   r   rJ  r   )
rÙ   r1   rR   r™  rÃ   r‚  rÅ   r   rJ  r›  )
rÙ   r1   rR   úIntoBackend[Backend]rÃ   r‚  rÅ   r   rJ  úLazyFrame[Any])rÙ   r1   rR   r™  rÅ   r   rJ  r›  )rÙ   r1   rR   rœ  rÅ   r   rJ  r  )r  zstr | Iterable[str]rJ  r   )r  zint | Sequence[int]rJ  r   )rJ  r   )r  r‚  rJ  r   )rT   r‚  r&  r4   rÅ   r   rJ  r   )Úpearson)r-  r4   r.  r4   r,  r0   rJ  r   )r&  rH  rJ  r   re  )r&  rH  r;  ÚboolrJ  r   )r„   r7   rV   r˜  rJ  r   )
r&  rH  r{  r4   rÃ   r‚  r;  rŸ  rJ  r   )r&  rH  r{  rL  rJ  r   )rŒ  r‚  r  r4   rJ  r   )r&  zIntoExpr | Sequence[IntoExpr]r—  r4   rJ  r   )xÚ
__future__r   rž   r›   Úcollections.abcr   r   r   Útypingr   r   Únarwhals._expression_parsingr	   r
   r   r   r   Únarwhals._utilsr   r   r   r   r   r   r   r   r   r   rB   r   r   r   r   Únarwhals.exceptionsr   Únarwhals.exprr   Únarwhals.translater   r   Útypesr    Útyping_extensionsr!   r"   r#   Únarwhals._nativer$   r%   r&   Únarwhals._translater'   Únarwhals._typingr(   r)   r*   Únarwhals.dataframer+   r,   Únarwhals.dtypesr-   Únarwhals.seriesr.   Únarwhals.typingr/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r:   rf  rH   rW   rS   rz   ru   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+  r0  r5  r7  r9  rD  rc  r<  rq  ru  rw  rz  r  rñ   r–  rÚ   rX   rO   ú<module>r±     s  ðÞ "ã Û 
ß 7Ñ 7ß %÷õ ÷÷ ÷ ÷ó õ 6Ý ß 5áÝ ç9Ñ9çOÑOÝ2ßCÑCß7Ý%Ý&÷÷ ÷ ð A€KÓ@ð <Fõ cðR #ð'BØ
ð'Bàð'Bð ð'Bð
 'ð'Bð ó'BðZ #ðØ
ðàðð ðð
 'ðð óñ< ¨Ô2ð >BðHð 15Ø*.ñHØ
ðHà:ðHð .ð	Hð
 (ðHð òHó 3ðHðV"Ø
)ð"à4ó"ð  >Bð9LØ
%ð9Là:ð9Lð 'ð	9Lð
 ó9Lð| 15ðNØ
ðNà-ðNð 'ð	Nð
 óNóbð;Ø ð;Ø.Gð;àó;ó|ó*$óN"ð&	!Øð	!Ø'6ð	!ØBEð	!à	ó	!óDð& ñ	H6ØðH6ð 'ðH6ð ð	H6ð
 ðH6ð óH6ð^ ñ	U,ØðU,ð "ðU,ð ð	U,ð
 ðU,ð óU,ðpF6ØðF6Ø$=ðF6ØILðF6àóF6ðRg,Øðg,Ø$8ðg,ØDGðg,àóg,óTAó<Xó:Eó@/ó*7ó2ó2 ó:"óBó:ó2ôUóBGóDGó@G÷D+ñ +ô.4ˆ4ô .4ób('óV(ôVSMól-ó`HðB Øñ	0Ø(ð0àð0ð ð0ð ð	0ð
 
ó0ðf?Ø(ð?Ø7Rð?à	ó?óD%+ôP@rX   