L ixddlmZddlmZmZmZmZddlmZm Z erddl m Z eddZ Gdd ee Z y ) ) annotations) TYPE_CHECKINGCallableGenericTypeVar)ExprKindExprNode)ExprExprTr )boundcDeZdZd dZd dZd dZd dZd dZd dZd dZ y)ExprNameNamespacec||_y)N)_expr)selfexprs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/narwhals/expr_name.py__init__zExprNameNamespace.__init__s  ch|jjttjdS)aKeep the original root name of the expression. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import pandas as pd >>> import narwhals as nw >>> df_native = pd.DataFrame({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> df.select(nw.col("foo").alias("alias_for_foo").name.keep()).columns ['foo'] z name.keepr _append_noder r ELEMENTWISErs rkeepzExprNameNamespace.keeps&zz&&x0D0Dk'RSSrcl|jjttjd|S)aRename the output of an expression by mapping a function over the root name. Arguments: function: Function that maps a root name to a new name. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import pandas as pd >>> import narwhals as nw >>> df_native = pd.DataFrame({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> renaming_func = lambda s: s[::-1] # reverse column name >>> df.select(nw.col("foo", "BAR").name.map(renaming_func)).columns ['oof', 'RAB'] zname.map)functionr)rrs rmapzExprNameNamespace.map!s-$zz&& X)): I  rcl|jjttjd|S)ajAdd a prefix to the root column name of the expression. Arguments: prefix: Prefix to add to the root column name. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import polars as pl >>> import narwhals as nw >>> df_native = pl.DataFrame({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> df.select(nw.col("foo", "BAR").name.prefix("with_prefix")).columns ['with_prefixfoo', 'with_prefixBAR'] z name.prefix)prefixr)rr s rr zExprNameNamespace.prefix7-"zz&& X))= H  rcl|jjttjd|S)amAdd a suffix to the root column name of the expression. Arguments: suffix: Suffix to add to the root column name. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import polars as pl >>> import narwhals as nw >>> df_native = pl.DataFrame({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> df.select(nw.col("foo", "BAR").name.suffix("_with_suffix")).columns ['foo_with_suffix', 'BAR_with_suffix'] z name.suffix)suffixr)rr#s rr#zExprNameNamespace.suffixLr!rch|jjttjdS)aMake the root column name lowercase. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import pyarrow as pa >>> import narwhals as nw >>> df_native = pa.table({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> df.select(nw.col("foo", "BAR").name.to_lowercase()).columns ['foo', 'bar'] zname.to_lowercaserrs r to_lowercasezExprNameNamespace.to_lowercasea,zz&& X))+> ?  rch|jjttjdS)aMake the root column name uppercase. Notes: For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression. Examples: >>> import pyarrow as pa >>> import narwhals as nw >>> df_native = pa.table({"foo": [1, 2], "BAR": [4, 5]}) >>> df = nw.from_native(df_native) >>> df.select(nw.col("foo", "BAR").name.to_uppercase()).columns ['FOO', 'BAR'] zname.to_uppercaserrs r to_uppercasezExprNameNamespace.to_uppercasesr&rN)rr returnNone)r)r )rzCallable[[str], str]r)r )r strr)r )r#r+r)r ) __name__ __module__ __qualname__rrrr r#r%r(rrrr s&T  , * * $ rrN) __future__rtypingrrrrnarwhals._expression_parsingrr narwhals.exprr r rr/rrr4s5"<<;"v&v v r