sdkagent

narwhals API reference

395 public APIs from narwhals (narwhals-dev/narwhals) — 57 classes, 115 functions, 223 methods. Signatures extracted by static analysis of the actual source.

Repository: narwhals-dev/narwhals

KindCount
Classes57
Functions115
Methods223

API list

funcsrc.narwhals._arrow.utils.is_array_or_scalar(obj:Any) -> TypeIs[ArrayOrScalar]
Return True for any base `pyarrow` container.
funcsrc.narwhals._arrow.utils.nulls_like(n:int, series:ArrowSeries) -> ArrayAny
Create a strongly-typed Array instance with all elements null.
funcsrc.narwhals._arrow.utils.parse_datetime_format(arr:ChunkedArrayAny) -> str
Try to infer datetime format from StringArray.
classsrc.narwhals._compliant.column.CompliantColumn
Common parts of `Expr`, `Series`.
classsrc.narwhals._compliant.dataframe.CompliantFrame
Common parts of `DataFrame`, `LazyFrame`.
methodsrc.narwhals._compliant.dataframe.CompliantFrame.simple_select(*column_names:str) -> Self
`select` where all args are column names.
classsrc.narwhals._compliant.namespace.AlignDiagonal
Mixin to help support `"diagonal*"` concatenation.
funcsrc.narwhals._duckdb.utils.concat_str(*separator:str='', *exprs:Expression) -> Expression
Concatenate many strings, NULL inputs are skipped.
funcsrc.narwhals._duckdb.utils.lambda_expr(params:str | Expression | tuple[Expression, ...], expr:Expression) -> Expression
Wraps [`duckdb.LambdaExpression`].
funcsrc.narwhals._exceptions.issue_deprecation_warning(message:str, _version:str) -> None
Issue a deprecation warning.
classsrc.narwhals._expression_parsing.ExprKind
Describe which kind of expression we are dealing with.
classsrc.narwhals._expression_parsing.ExprMetadata
Expression metadata.
classsrc.narwhals._expression_parsing.ExprNode
An operation to create or modify an expression.
funcsrc.narwhals._expression_parsing.combine_metadata(*to_single_output:bool, *current_node:ExprNode, *prev:ExprMetadata | None, *compliant_exprs:CompliantExprAny) -> ExprMetadata
Combine metadata from `args`.
funcsrc.narwhals._expression_parsing.is_expr(obj:Any) -> TypeIs[Expr]
Check whether `obj` is a Narwhals Expr.
funcsrc.narwhals._expression_parsing.is_series(obj:Any) -> TypeIs[Series[Any]]
Check whether `obj` is a Narwhals Expr.
funcsrc.narwhals._pandas_like.utils.align_and_extract_native(lhs:PandasLikeSeries, rhs:PandasLikeSeries | object) -> tuple[pd.Series[Any], pd.Series[Any] | object]
Validate RHS of binary operation.
funcsrc.narwhals._pandas_like.utils.get_dtype_backend(dtype:Any, implementation:Implementation) -> DTypeBackend
Get dtype backend for pandas type.
funcsrc.narwhals._pandas_like.utils.is_dtype_numpy_nullable(dtype:Any) -> TypeIs[BaseMaskedDtype]
Return `True` if `dtype` is `"numpy_nullable"`.
funcsrc.narwhals._pandas_like.utils.iter_dtype_backends(dtypes:Iterable[Any], implementation:Implementation) -> Iterator[DTypeBackend]
Yield a `DTypeBackend` per-dtype.
funcsrc.narwhals._pandas_like.utils.select_columns_by_name(df:NativeDataFrameT, column_names:list[str] | _1DArray, implementation:Implementation) -> NativeDataFrameT | Any
Select columns by name.
funcsrc.narwhals._pandas_like.utils.set_index(obj:NativeNDFrameT, index:Any, *implementation:Implementation) -> NativeNDFrameT
Wrapper around pandas' set_axis to set object index.
methodsrc.narwhals._utils.Implementation.is_cudf() -> bool
Return whether implementation is cuDF.
methodsrc.narwhals._utils.Implementation.is_dask() -> bool
Return whether implementation is Dask.
methodsrc.narwhals._utils.Implementation.is_duckdb() -> bool
Return whether implementation is DuckDB.
methodsrc.narwhals._utils.Implementation.is_ibis() -> bool
Return whether implementation is Ibis.
methodsrc.narwhals._utils.Implementation.is_modin() -> bool
Return whether implementation is Modin.
methodsrc.narwhals._utils.Implementation.is_pandas() -> bool
Return whether implementation is pandas.
methodsrc.narwhals._utils.Implementation.is_polars() -> bool
Return whether implementation is Polars.
methodsrc.narwhals._utils.Implementation.is_pyarrow() -> bool
Return whether implementation is PyArrow.
methodsrc.narwhals._utils.Implementation.is_pyspark() -> bool
Return whether implementation is PySpark.
methodsrc.narwhals._utils.Implementation.is_pyspark_connect() -> bool
Return whether implementation is PySpark.
methodsrc.narwhals._utils.Implementation.is_spark_like() -> bool
Return whether implementation is pyspark or sqlframe.
methodsrc.narwhals._utils.Implementation.is_sqlframe() -> bool
Return whether implementation is SQLFrame.
classsrc.narwhals._utils.Narwhals
Minimal *Narwhals-level* protocol.
funcsrc.narwhals._utils.can_lazyframe_collect(impl:Implementation) -> TypeIs[_LazyFrameCollectImpl]
Return True if `LazyFrame.collect(impl)` is allowed.
funcsrc.narwhals._utils.deep_getattr(obj:Any, name_1:str, *nested:str) -> Any
Perform a nested attribute lookup on `obj`.
funcsrc.narwhals._utils.is_eager_allowed(impl:Implementation) -> TypeIs[_EagerAllowedImpl]
Return True if `impl` allows eager operations.
funcsrc.narwhals._utils.is_lazy_allowed(impl:Implementation) -> TypeIs[_LazyAllowedImpl]
Return True if `DataFrame.lazy(impl)` is allowed.
classsrc.narwhals._utils.not_implemented
Mark some functionality as unsupported.
methodsrc.narwhals._utils.not_implemented.deprecated(message:LiteralString) -> Self
Alt constructor, wraps with `@deprecated`.
classsrc.narwhals._utils.requires
Method decorator for raising under certain constraints.
funcsrc.narwhals._utils.unstable(fn:_Fn) -> _Fn
Visual-only marker for unstable functionality.
classsrc.narwhals.dataframe.DataFrame
Narwhals DataFrame, backed by a native eager dataframe.
methodsrc.narwhals.dataframe.DataFrame.clone() -> Self
Create a copy of this DataFrame.
methodsrc.narwhals.dataframe.DataFrame.columns() -> list[str]
Get column names.
methodsrc.narwhals.dataframe.DataFrame.drop(*strict:bool=True, *columns:str | Iterable[str]) -> Self
Remove columns from the dataframe.
methodsrc.narwhals.dataframe.DataFrame.drop_nulls(subset:str | list[str] | None=None) -> Self
Drop rows that contain null values.
methodsrc.narwhals.dataframe.DataFrame.get_column(name:str) -> Series[Any]
Get a single column by name.
methodsrc.narwhals.dataframe.DataFrame.head(n:int=5) -> Self
Get the first `n` rows.
methodsrc.narwhals.dataframe.DataFrame.is_empty() -> bool
Check if the dataframe is empty.
methodsrc.narwhals.dataframe.DataFrame.is_unique() -> Series[Any]
Get a mask of all unique rows in this DataFrame.
methodsrc.narwhals.dataframe.DataFrame.join(other:Self, on:str | list[str] | None=None, how:JoinStrategy='inner', *left_on:str | list[str] | None=None, *right_on:str | list[str] | None=None, *suffix:str='_right') -> Self
Join in SQL-like fashion.
methodsrc.narwhals.dataframe.DataFrame.lazy(backend:IntoBackend[LazyAllowed] | None=None, *session:Any | None=None) -> LazyFrame[Any]
Restrict available API methods to lazy-only ones.
methodsrc.narwhals.dataframe.DataFrame.pipe(function:Callable[Concatenate[Self, PS], R], *args:PS.args, **kwargs:PS.kwargs) -> R
Pipe function call.
methodsrc.narwhals.dataframe.DataFrame.rename(mapping:dict[str, str]) -> Self
Rename column names.
methodsrc.narwhals.dataframe.DataFrame.row(index:int) -> tuple[Any, ...]
Get values at given row.
methodsrc.narwhals.dataframe.DataFrame.sample(n:int | None=None, *fraction:float | None=None, *with_replacement:bool=False, *seed:int | None=None) -> Self
Sample from this DataFrame.
methodsrc.narwhals.dataframe.DataFrame.select(*exprs:IntoExpr | Iterable[IntoExpr], **named_exprs:IntoExpr) -> Self
Select columns from this DataFrame.
methodsrc.narwhals.dataframe.DataFrame.shape() -> tuple[int, int]
Get the shape of the DataFrame.
methodsrc.narwhals.dataframe.DataFrame.sort(by:str | Iterable[str], *descending:bool | Sequence[bool]=False, *nulls_last:bool=False, *more_by:str) -> Self
Sort the dataframe by the given columns.
methodsrc.narwhals.dataframe.DataFrame.tail(n:int=5) -> Self
Get the last `n` rows.
methodsrc.narwhals.dataframe.DataFrame.to_arrow() -> pa.Table
Convert to arrow table.
methodsrc.narwhals.dataframe.DataFrame.to_native() -> DataFrameT
Convert Narwhals DataFrame to native one.
methodsrc.narwhals.dataframe.DataFrame.to_numpy() -> _2DArray
Convert this DataFrame to a NumPy ndarray.
methodsrc.narwhals.dataframe.DataFrame.to_pandas() -> pd.DataFrame
Convert this DataFrame to a pandas DataFrame.
methodsrc.narwhals.dataframe.DataFrame.to_polars() -> pl.DataFrame
Convert this DataFrame to a polars DataFrame.
methodsrc.narwhals.dataframe.DataFrame.top_k(k:int, *by:str | Iterable[str], *reverse:bool | Sequence[bool]=False) -> Self
Return the `k` largest rows.
methodsrc.narwhals.dataframe.DataFrame.with_columns(*exprs:IntoExpr | Iterable[IntoExpr], **named_exprs:IntoExpr) -> Self
Add columns to this DataFrame.
methodsrc.narwhals.dataframe.DataFrame.with_row_index(name:str='index', *order_by:str | Sequence[str] | None=None) -> Self
Insert column which enumerates rows.
methodsrc.narwhals.dataframe.DataFrame.write_parquet(file:str | Path | BytesIO) -> None
Write dataframe to parquet file.
classsrc.narwhals.dataframe.LazyFrame
Narwhals LazyFrame, backed by a native lazyframe.
methodsrc.narwhals.dataframe.LazyFrame.collect(backend:IntoBackend[Polars | Pandas | Arrow] | None=None, **kwargs:Any) -> DataFrame[Any]
Materialize this LazyFrame into a DataFrame.
methodsrc.narwhals.dataframe.LazyFrame.columns() -> list[str]
Get column names.
methodsrc.narwhals.dataframe.LazyFrame.drop(*strict:bool=True, *columns:str | Iterable[str]) -> Self
Remove columns from the LazyFrame.
methodsrc.narwhals.dataframe.LazyFrame.drop_nulls(subset:str | list[str] | None=None) -> Self
Drop rows that contain null values.
methodsrc.narwhals.dataframe.LazyFrame.head(n:int=5) -> Self
Get `n` rows.
methodsrc.narwhals.dataframe.LazyFrame.lazy() -> Self
Restrict available API methods to lazy-only ones.
methodsrc.narwhals.dataframe.LazyFrame.pipe(function:Callable[Concatenate[Self, PS], R], *args:PS.args, **kwargs:PS.kwargs) -> R
Pipe function call.
methodsrc.narwhals.dataframe.LazyFrame.rename(mapping:dict[str, str]) -> Self
Rename column names.
methodsrc.narwhals.dataframe.LazyFrame.select(*exprs:IntoExpr | Iterable[IntoExpr], **named_exprs:IntoExpr) -> Self
Select columns from this LazyFrame.
methodsrc.narwhals.dataframe.LazyFrame.sink_parquet(file:str | Path | BytesIO) -> None
Write LazyFrame to Parquet file.
methodsrc.narwhals.dataframe.LazyFrame.sort(by:str | Iterable[str], *descending:bool | Sequence[bool]=False, *nulls_last:bool=False, *more_by:str) -> Self
Sort the LazyFrame by the given columns.
methodsrc.narwhals.dataframe.LazyFrame.to_native() -> LazyFrameT
Convert Narwhals LazyFrame to native one.
methodsrc.narwhals.dataframe.LazyFrame.top_k(k:int, *by:str | Iterable[str], *reverse:bool | Sequence[bool]=False) -> Self
Return the `k` largest rows.
methodsrc.narwhals.dataframe.LazyFrame.unique(subset:str | list[str] | None=None, *keep:UniqueKeepStrategy='any', *order_by:str | Sequence[str] | None=None) -> Self
Drop duplicate rows from this LazyFrame.
methodsrc.narwhals.dataframe.LazyFrame.with_columns(*exprs:IntoExpr | Iterable[IntoExpr], **named_exprs:IntoExpr) -> Self
Add columns to this LazyFrame.
methodsrc.narwhals.dataframe.LazyFrame.with_row_index(name:str='index', *order_by:str | Sequence[str]) -> Self
Insert column which enumerates rows.
funcsrc.narwhals.dependencies.get_cudf() -> Any
Get cudf module (if already imported - else return None).
funcsrc.narwhals.dependencies.get_cupy() -> Any
Get cupy module (if already imported - else return None).
funcsrc.narwhals.dependencies.get_dask() -> Any
Get dask (if already imported - else return None).
funcsrc.narwhals.dependencies.get_ibis() -> Any
Get ibis module (if already imported - else return None).
funcsrc.narwhals.dependencies.get_numpy() -> Any
Get numpy module (if already imported - else return None).
funcsrc.narwhals.dependencies.get_pandas() -> Any
Get pandas module (if already imported - else return None).
funcsrc.narwhals.dependencies.is_cudf_index(index:Any) -> TypeIs[cudf.Index]
Check whether `index` is a cudf Index without importing cudf.
funcsrc.narwhals.dependencies.is_cudf_series(ser:Any) -> TypeIs[cudf.Series[Any]]
Check whether `ser` is a cudf Series without importing cudf.
funcsrc.narwhals.dependencies.is_dask_dataframe(df:Any) -> TypeIs[dd.DataFrame]
Check whether `df` is a Dask DataFrame without importing Dask.
funcsrc.narwhals.dependencies.is_ibis_table(df:Any) -> TypeIs[ibis.Table]
Check whether `df` is a Ibis Table without importing Ibis.
funcsrc.narwhals.dependencies.is_modin_series(ser:Any) -> TypeIs[mpd.Series]
Check whether `ser` is a modin Series without importing modin.
funcsrc.narwhals.dependencies.is_narwhals_dataframe(df:DataFrame[IntoDataFrameT] | Any) -> TypeIs[DataFrame[IntoDataFrameT]]
Check whether `df` is a Narwhals DataFrame.
funcsrc.narwhals.dependencies.is_narwhals_lazyframe(lf:Any | LazyFrame[IntoLazyFrameT]) -> TypeIs[LazyFrame[IntoLazyFrameT]]
Check whether `lf` is a Narwhals LazyFrame.
funcsrc.narwhals.dependencies.is_narwhals_series(ser:Any | Series[IntoSeriesT]) -> TypeIs[Series[IntoSeriesT]]
Check whether `ser` is a Narwhals Series.
funcsrc.narwhals.dependencies.is_numpy_array(arr:Any | _NDArray[_ShapeT]) -> TypeIs[_NDArray[_ShapeT]]
Check whether `arr` is a NumPy Array without importing NumPy.
funcsrc.narwhals.dependencies.is_numpy_array_1d(arr:Any) -> TypeIs[_1DArray]
Check whether `arr` is a 1D NumPy Array without importing NumPy.
funcsrc.narwhals.dependencies.is_numpy_array_2d(arr:Any) -> TypeIs[_2DArray]
Check whether `arr` is a 2D NumPy Array without importing NumPy.
funcsrc.narwhals.dependencies.is_pyarrow_table(df:Any) -> TypeIs[pa.Table]
Check whether `df` is a PyArrow Table without importing PyArrow.
classsrc.narwhals.dtypes.Array
Fixed length list type.
classsrc.narwhals.dtypes.Binary
Binary type.
classsrc.narwhals.dtypes.Boolean
Boolean type.
classsrc.narwhals.dtypes.Categorical
A categorical encoding of a set of strings.
classsrc.narwhals.dtypes.DType
Base class for all Narwhals data types.
methodsrc.narwhals.dtypes.DType.base_type() -> type[Self]
Return this DType's fundamental/root type class.
methodsrc.narwhals.dtypes.DType.is_boolean() -> bool
Check whether the data type is a boolean type.
methodsrc.narwhals.dtypes.DType.is_decimal() -> bool
Check whether the data type is a decimal type.
methodsrc.narwhals.dtypes.DType.is_float() -> bool
Check whether the data type is a floating point type.
methodsrc.narwhals.dtypes.DType.is_integer() -> bool
Check whether the data type is an integer type.
methodsrc.narwhals.dtypes.DType.is_nested() -> bool
Check whether the data type is a nested type.
methodsrc.narwhals.dtypes.DType.is_numeric() -> bool
Check whether the data type is a numeric type.
methodsrc.narwhals.dtypes.DType.is_signed_integer() -> bool
Check whether the data type is a signed integer type.
methodsrc.narwhals.dtypes.DType.is_temporal() -> bool
Check whether the data type is a temporal type.
classsrc.narwhals.dtypes.DTypeClass
Metaclass for DType classes.
classsrc.narwhals.dtypes.Date
Data type representing a calendar date.
classsrc.narwhals.dtypes.Datetime
Data type representing a calendar date and time of day.
classsrc.narwhals.dtypes.Duration
Data type representing a time duration.
classsrc.narwhals.dtypes.Enum
A fixed categorical encoding of a unique set of strings.
methodsrc.narwhals.dtypes.Enum.categories() -> tuple[str, ...]
The categories in the dataset.
classsrc.narwhals.dtypes.Field
Definition of a single field within a `Struct` DType.
classsrc.narwhals.dtypes.Float16
16-bit floating point type.
classsrc.narwhals.dtypes.Float32
32-bit floating point type.
classsrc.narwhals.dtypes.Float64
64-bit floating point type.
classsrc.narwhals.dtypes.FloatType
Base class for float data types.
classsrc.narwhals.dtypes.Int128
128-bit signed integer type.
classsrc.narwhals.dtypes.Int16
16-bit signed integer type.
classsrc.narwhals.dtypes.Int32
32-bit signed integer type.
classsrc.narwhals.dtypes.Int64
64-bit signed integer type.
classsrc.narwhals.dtypes.Int8
8-bit signed integer type.
classsrc.narwhals.dtypes.IntegerType
Base class for integer data types.
classsrc.narwhals.dtypes.List
Variable length list type.
classsrc.narwhals.dtypes.NestedType
Base class for nested data types.
classsrc.narwhals.dtypes.NumericType
Base class for numeric data types.
classsrc.narwhals.dtypes.Object
Data type for wrapping arbitrary Python objects.
classsrc.narwhals.dtypes.SignedIntegerType
Base class for signed integer data types.
classsrc.narwhals.dtypes.String
UTF-8 encoded string type.
classsrc.narwhals.dtypes.Struct
Struct composite type.
methodsrc.narwhals.dtypes.Struct.to_schema() -> OrderedDict[str, IntoDType]
Return Struct dtype as a schema dict.
classsrc.narwhals.dtypes.TemporalType
Base class for temporal data types.
classsrc.narwhals.dtypes.Time
Data type representing the time of day.
classsrc.narwhals.dtypes.UInt128
128-bit unsigned integer type.
classsrc.narwhals.dtypes.UInt16
16-bit unsigned integer type.
classsrc.narwhals.dtypes.UInt32
32-bit unsigned integer type.
classsrc.narwhals.dtypes.UInt64
64-bit unsigned integer type.
classsrc.narwhals.dtypes.UInt8
8-bit unsigned integer type.
classsrc.narwhals.dtypes.UnsignedIntegerType
Base class for unsigned integer data types.
classsrc.narwhals.exceptions.ColumnNotFoundError
Exception raised when column name isn't present.
classsrc.narwhals.exceptions.DuplicateError
Exception when duplicate column names are encountered.
classsrc.narwhals.exceptions.FormattedKeyError
KeyError with formatted error message.
classsrc.narwhals.exceptions.InvalidOperationError
Exception raised during invalid operations.
classsrc.narwhals.exceptions.NarwhalsError
Base class for all Narwhals exceptions.
methodsrc.narwhals.expr.Expr.abs() -> Self
Return absolute value of each element.
methodsrc.narwhals.expr.Expr.alias(name:str) -> Self
Rename the expression.
methodsrc.narwhals.expr.Expr.all() -> Self
Return whether all values in the column are `True`.
methodsrc.narwhals.expr.Expr.any() -> Self
Return whether any of the values in the column are `True`.
methodsrc.narwhals.expr.Expr.any_value(*ignore_nulls:bool=False) -> Self
Get a random value from the column.
methodsrc.narwhals.expr.Expr.cast(dtype:IntoDType) -> Self
Redefine an object's data type.
methodsrc.narwhals.expr.Expr.ceil() -> Self
Compute the numerical ceiling.
methodsrc.narwhals.expr.Expr.clip(lower_bound:IntoExpr | NumericLiteral | TemporalLiteral | None=None, upper_bound:IntoExpr | NumericLiteral | TemporalLiteral | None=None) -> Self
Clip values in the Series.
methodsrc.narwhals.expr.Expr.cos() -> Self
Compute the element-wise value for the cosine.
methodsrc.narwhals.expr.Expr.count() -> Self
Returns the number of non-null elements in the column.
methodsrc.narwhals.expr.Expr.cum_count(*reverse:bool=False) -> Self
Return the cumulative count of the non-null values in the column.
methodsrc.narwhals.expr.Expr.cum_max(*reverse:bool=False) -> Self
Return the cumulative max of the non-null values in the column.
methodsrc.narwhals.expr.Expr.cum_min(*reverse:bool=False) -> Self
Return the cumulative min of the non-null values in the column.
methodsrc.narwhals.expr.Expr.cum_prod(*reverse:bool=False) -> Self
Return the cumulative product of the non-null values in the column.
methodsrc.narwhals.expr.Expr.cum_sum(*reverse:bool=False) -> Self
Return cumulative sum.
methodsrc.narwhals.expr.Expr.drop_nulls() -> Self
Drop null values.
methodsrc.narwhals.expr.Expr.exp() -> Self
Compute the exponent.
methodsrc.narwhals.expr.Expr.fill_nan(value:float | None) -> Self
Fill floating point NaN values with given value.
methodsrc.narwhals.expr.Expr.fill_null(value:Expr | NonNestedLiteral=None, strategy:FillNullStrategy | None=None, limit:int | None=None) -> Self
Fill null values with given value.
methodsrc.narwhals.expr.Expr.filter(*predicates:Any) -> Self
Filters elements based on a condition, returning a new expression.
methodsrc.narwhals.expr.Expr.first(order_by:str | Iterable[str] | None=None) -> Self
Get the first value.
methodsrc.narwhals.expr.Expr.floor() -> Self
Compute the numerical floor.
methodsrc.narwhals.expr.Expr.is_close(other:Expr | Series[Any] | NumericLiteral, *abs_tol:float=0.0, *rel_tol:float=1e-09, *nans_equal:bool=False) -> Self
Check if this expression is close, i.e.
methodsrc.narwhals.expr.Expr.is_duplicated() -> Self
Return a boolean mask indicating duplicated values.
methodsrc.narwhals.expr.Expr.is_in(other:Any) -> Self
Check if elements of this expression are present in the other iterable.
methodsrc.narwhals.expr.Expr.is_nan() -> Self
Indicate which values are NaN.
methodsrc.narwhals.expr.Expr.is_null() -> Self
Returns a boolean Series indicating which values are null.
methodsrc.narwhals.expr.Expr.is_unique() -> Self
Return a boolean mask indicating unique values.
methodsrc.narwhals.expr.Expr.last(order_by:str | Iterable[str] | None=None) -> Self
Get the last value.
methodsrc.narwhals.expr.Expr.len() -> Self
Return the number of elements in the column.
methodsrc.narwhals.expr.Expr.log(base:float=math.e) -> Self
Compute the logarithm to a given base.
methodsrc.narwhals.expr.Expr.max() -> Self
Returns the maximum value(s) from a column(s).
methodsrc.narwhals.expr.Expr.mean() -> Self
Get mean value.
methodsrc.narwhals.expr.Expr.median() -> Self
Get median value.
methodsrc.narwhals.expr.Expr.min() -> Self
Returns the minimum value(s) from a column(s).
methodsrc.narwhals.expr.Expr.mode(*keep:ModeKeepStrategy='all') -> Self
Compute the most occurring value(s).
methodsrc.narwhals.expr.Expr.n_unique() -> Self
Returns count of unique values.
methodsrc.narwhals.expr.Expr.null_count() -> Self
Count null values.
methodsrc.narwhals.expr.Expr.pipe(function:Callable[Concatenate[Self, PS], R], *args:PS.args, **kwargs:PS.kwargs) -> R
Pipe function call.
methodsrc.narwhals.expr.Expr.quantile(quantile:float, interpolation:RollingInterpolationMethod) -> Self
Get quantile value.
methodsrc.narwhals.expr.Expr.rank(method:RankMethod='average', *descending:bool=False) -> Self
Assign ranks to data, dealing with ties appropriately.
methodsrc.narwhals.expr.Expr.rolling_mean(window_size:int, *min_samples:int | None=None, *center:bool=False) -> Self
Apply a rolling mean (moving mean) over the values.
methodsrc.narwhals.expr.Expr.rolling_sum(window_size:int, *min_samples:int | None=None, *center:bool=False) -> Self
Apply a rolling sum (moving sum) over the values.
methodsrc.narwhals.expr.Expr.round(decimals:int=0) -> Self
Round underlying floating point data by `decimals` digits.
methodsrc.narwhals.expr.Expr.shift(n:int) -> Self
Shift values by `n` positions.
methodsrc.narwhals.expr.Expr.sin() -> Self
Compute the element-wise value for the sine.
methodsrc.narwhals.expr.Expr.skew() -> Self
Calculate the sample skewness of a column.
methodsrc.narwhals.expr.Expr.sqrt() -> Self
Compute the square root of the elements.
methodsrc.narwhals.expr.Expr.std(*ddof:int=1) -> Self
Get standard deviation.
methodsrc.narwhals.expr.Expr.sum() -> Self
Return the sum value.
methodsrc.narwhals.expr.Expr.unique() -> Self
Return unique values of this expression.
methodsrc.narwhals.expr.Expr.var(*ddof:int=1) -> Self
Get variance.
funcsrc.narwhals.functions.all_() -> Expr
Instantiate an expression representing all columns.
funcsrc.narwhals.functions.all_horizontal(*ignore_nulls:bool, *exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the bitwise AND horizontally across columns.
funcsrc.narwhals.functions.any_horizontal(*ignore_nulls:bool, *exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the bitwise OR horizontally across columns.
funcsrc.narwhals.functions.cov(a:IntoExpr, b:IntoExpr, *ddof:int=1) -> Expr
Compute the covariance between two columns.
funcsrc.narwhals.functions.exclude(*names:str | Iterable[str]) -> Expr
Creates an expression that excludes columns by their name(s).
funcsrc.narwhals.functions.format(f_string:str, *args:IntoExpr) -> Expr
Format expressions as a string.
funcsrc.narwhals.functions.len_() -> Expr
Return the number of rows.
funcsrc.narwhals.functions.list_(*exprs:IntoExpr | Sequence[IntoExpr]) -> Expr
Collect columns into a list column.
funcsrc.narwhals.functions.lit(value:PythonLiteral, dtype:IntoDType | None=None) -> Expr
Return an expression representing a literal value.
funcsrc.narwhals.functions.max(*columns:str) -> Expr
Return the maximum value.
funcsrc.narwhals.functions.max_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Get the maximum value horizontally across columns.
funcsrc.narwhals.functions.mean(*columns:str) -> Expr
Get the mean value.
funcsrc.narwhals.functions.mean_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the mean of all values horizontally across columns.
funcsrc.narwhals.functions.median(*columns:str) -> Expr
Get the median value.
funcsrc.narwhals.functions.min(*columns:str) -> Expr
Return the minimum value.
funcsrc.narwhals.functions.min_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Get the minimum value horizontally across columns.
funcsrc.narwhals.functions.new_series(name:str, values:Any, dtype:IntoDType | None=None, *backend:IntoBackend[EagerAllowed | PluginName]) -> Series[Any]
Instantiate Narwhals Series from iterable (e.g.
funcsrc.narwhals.functions.read_csv(source:FileSource, *backend:IntoBackend[EagerAllowed | PluginName], *separator:str=',', **kwargs:Any) -> DataFrame[Any]
Read a CSV file into a DataFrame.
funcsrc.narwhals.functions.read_parquet(source:FileSource, *backend:IntoBackend[EagerAllowed | PluginName], **kwargs:Any) -> DataFrame[Any]
Read into a DataFrame from a parquet file.
funcsrc.narwhals.functions.scan_csv(source:FileSource, *backend:IntoBackend[Backend | PluginName], *separator:str=',', **kwargs:Any) -> LazyFrame[Any]
Lazily read from a CSV file.
funcsrc.narwhals.functions.scan_parquet(source:FileSource, *backend:IntoBackend[Backend | PluginName], **kwargs:Any) -> LazyFrame[Any]
Lazily read from a parquet file.
funcsrc.narwhals.functions.show_versions() -> None
Print useful debugging information.
funcsrc.narwhals.functions.struct(*exprs:IntoExpr | Sequence[IntoExpr], **named_exprs:IntoExpr) -> Expr
Collect columns into a struct column.
funcsrc.narwhals.functions.sum(*columns:str) -> Expr
Sum all values.
funcsrc.narwhals.functions.sum_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Sum all values horizontally across columns.
funcsrc.narwhals.functions.when(*predicates:IntoExpr | Iterable[IntoExpr]) -> When
Start a `when-then-otherwise` expression.
classsrc.narwhals.schema.Schema
Ordered mapping of column names to their data type.
methodsrc.narwhals.schema.Schema.dtypes() -> list[DType]
Get the data types of the schema.
methodsrc.narwhals.schema.Schema.from_arrow(schema:IntoArrowSchema) -> Self
Construct a Schema from a pyarrow Schema.
methodsrc.narwhals.schema.Schema.from_native(schema:IntoArrowSchema | IntoPolarsSchema | IntoPandasSchema) -> Self
Construct a Schema from a native schema representation.
methodsrc.narwhals.schema.Schema.from_pandas_like(schema:IntoPandasSchema) -> Self
Construct a Schema from a pandas-like schema representation.
methodsrc.narwhals.schema.Schema.from_polars(schema:IntoPolarsSchema) -> Self
Construct a Schema from a polars Schema.
methodsrc.narwhals.schema.Schema.len() -> int
Get the number of columns in the schema.
methodsrc.narwhals.schema.Schema.names() -> list[str]
Get the column names of the schema.
methodsrc.narwhals.schema.Schema.to_arrow() -> pa.Schema
Convert Schema to a pyarrow Schema.
methodsrc.narwhals.schema.Schema.to_polars() -> pl.Schema
Convert Schema to a polars Schema.
funcsrc.narwhals.selectors.all() -> Selector
Select all columns.
funcsrc.narwhals.selectors.boolean() -> Selector
Select boolean columns.
funcsrc.narwhals.selectors.by_dtype(*dtypes:DType | type[DType] | Iterable[DType | type[DType]]) -> Selector
Select columns based on their dtype.
funcsrc.narwhals.selectors.categorical() -> Selector
Select categorical columns.
funcsrc.narwhals.selectors.enum() -> Selector
Select enum columns.
funcsrc.narwhals.selectors.matches(pattern:str) -> Selector
Select all columns that match the given regex pattern.
funcsrc.narwhals.selectors.numeric() -> Selector
Select numeric columns.
funcsrc.narwhals.selectors.string() -> Selector
Select string columns.
classsrc.narwhals.series.Series
Narwhals Series, backed by a native series.
methodsrc.narwhals.series.Series.abs() -> Self
Calculate the absolute value of each element.
methodsrc.narwhals.series.Series.alias(name:str) -> Self
Rename the Series.
methodsrc.narwhals.series.Series.all() -> bool
Return whether all values in the Series are True.
methodsrc.narwhals.series.Series.any() -> bool
Return whether any of the values in the Series are True.
methodsrc.narwhals.series.Series.any_value(*ignore_nulls:bool=False) -> PythonLiteral
Get a random value from the column.
methodsrc.narwhals.series.Series.arg_max() -> int
Returns the index of the maximum value.
methodsrc.narwhals.series.Series.arg_min() -> int
Returns the index of the minimum value.
methodsrc.narwhals.series.Series.arg_true() -> Self
Find elements where boolean Series is True.
methodsrc.narwhals.series.Series.cast(dtype:IntoDType) -> Self
Cast between data types.
methodsrc.narwhals.series.Series.ceil() -> Self
Compute the numerical ceiling.
methodsrc.narwhals.series.Series.clip(lower_bound:Self | NumericLiteral | TemporalLiteral | None=None, upper_bound:Self | NumericLiteral | TemporalLiteral | None=None) -> Self
Clip values in the Series.
methodsrc.narwhals.series.Series.cos() -> Self
Compute the element-wise value for the cosine.
methodsrc.narwhals.series.Series.count() -> int
Returns the number of non-null elements in the Series.
methodsrc.narwhals.series.Series.cum_count(*reverse:bool=False) -> Self
Return the cumulative count of the non-null values in the series.
methodsrc.narwhals.series.Series.cum_max(*reverse:bool=False) -> Self
Return the cumulative max of the non-null values in the series.
methodsrc.narwhals.series.Series.cum_min(*reverse:bool=False) -> Self
Return the cumulative min of the non-null values in the series.
methodsrc.narwhals.series.Series.cum_sum(*reverse:bool=False) -> Self
Calculate the cumulative sum.
methodsrc.narwhals.series.Series.drop_nulls() -> Self
Drop null values.
methodsrc.narwhals.series.Series.dtype() -> DType
Get the data type of the Series.
methodsrc.narwhals.series.Series.exp() -> Self
Compute the exponent.
methodsrc.narwhals.series.Series.fill_nan(value:float | None) -> Self
Fill floating point NaN values with given value.
methodsrc.narwhals.series.Series.fill_null(value:Self | NonNestedLiteral=None, strategy:FillNullStrategy | None=None, limit:int | None=None) -> Self
Fill null values using the specified value.
methodsrc.narwhals.series.Series.filter(predicate:Any) -> Self
Filter elements in the Series based on a condition.
methodsrc.narwhals.series.Series.first() -> PythonLiteral
Get the first element of the Series.
methodsrc.narwhals.series.Series.floor() -> Self
Compute the numerical floor.
methodsrc.narwhals.series.Series.from_iterable(name:str, values:Iterable[Any], dtype:IntoDType | None=None, *backend:IntoBackend[EagerAllowed | PluginName]) -> Series[Any]
Construct a Series from an iterable.
methodsrc.narwhals.series.Series.from_numpy(name:str, values:_1DArray, dtype:IntoDType | None=None, *backend:IntoBackend[EagerAllowed | PluginName]) -> Series[Any]
Construct a Series from a NumPy ndarray.
methodsrc.narwhals.series.Series.gather_every(n:int, offset:int=0) -> Self
Take every nth value in the Series and return as new Series.
methodsrc.narwhals.series.Series.head(n:int=10) -> Self
Get the first `n` rows.
methodsrc.narwhals.series.Series.is_duplicated() -> Self
Get a mask of all duplicated rows in the Series.
methodsrc.narwhals.series.Series.is_empty() -> bool
Check if the series is empty.
methodsrc.narwhals.series.Series.is_in(other:Any) -> Self
Check if the elements of this Series are in the other sequence.
methodsrc.narwhals.series.Series.is_nan() -> Self
Returns a boolean Series indicating which values are NaN.
methodsrc.narwhals.series.Series.is_null() -> Self
Returns a boolean Series indicating which values are null.
methodsrc.narwhals.series.Series.is_sorted(*descending:bool=False) -> bool
Check if the Series is sorted.
methodsrc.narwhals.series.Series.is_unique() -> Self
Get a mask of all unique rows in the Series.
methodsrc.narwhals.series.Series.last() -> PythonLiteral
Get the last element of the Series.
methodsrc.narwhals.series.Series.len() -> int
Return the number of elements in the Series.
methodsrc.narwhals.series.Series.log(base:float=math.e) -> Self
Compute the logarithm to a given base.
methodsrc.narwhals.series.Series.max() -> Any
Get the maximum value in this Series.
methodsrc.narwhals.series.Series.mean() -> float
Reduce this Series to the mean value.
methodsrc.narwhals.series.Series.median() -> float
Reduce this Series to the median value.
methodsrc.narwhals.series.Series.min() -> Any
Get the minimal value in this Series.
methodsrc.narwhals.series.Series.n_unique() -> int
Count the number of unique values.
methodsrc.narwhals.series.Series.name() -> str
Get the name of the Series.
methodsrc.narwhals.series.Series.null_count() -> int
Count the number of null values.
methodsrc.narwhals.series.Series.pipe(function:Callable[[Any], Self], *args:Any, **kwargs:Any) -> Self
Pipe function call.
methodsrc.narwhals.series.Series.quantile(quantile:float, interpolation:RollingInterpolationMethod) -> float
Get quantile value of the series.
methodsrc.narwhals.series.Series.rank(method:RankMethod='average', *descending:bool=False) -> Self
Assign ranks to data, dealing with ties appropriately.
methodsrc.narwhals.series.Series.rename(name:str) -> Self
Rename the Series.
methodsrc.narwhals.series.Series.rolling_mean(window_size:int, *min_samples:int | None=None, *center:bool=False) -> Self
Apply a rolling mean (moving mean) over the values.
methodsrc.narwhals.series.Series.rolling_sum(window_size:int, *min_samples:int | None=None, *center:bool=False) -> Self
Apply a rolling sum (moving sum) over the values.
methodsrc.narwhals.series.Series.round(decimals:int=0) -> Self
Round underlying floating point data by `decimals` digits.
methodsrc.narwhals.series.Series.sample(n:int | None=None, *fraction:float | None=None, *with_replacement:bool=False, *seed:int | None=None) -> Self
Sample randomly from this Series.
methodsrc.narwhals.series.Series.scatter(indices:Self | Iterable[int] | int, values:Self | Iterable[PythonLiteral] | PythonLiteral) -> Self
Set value(s) at the given index location(s).
methodsrc.narwhals.series.Series.shape() -> tuple[int]
Get the shape of the Series.
methodsrc.narwhals.series.Series.shift(n:int) -> Self
Shift values by `n` positions.
methodsrc.narwhals.series.Series.sin() -> Self
Compute the element-wise value for the sine.
methodsrc.narwhals.series.Series.skew() -> float | None
Calculate the sample skewness of the Series.
methodsrc.narwhals.series.Series.sort(*descending:bool=False, *nulls_last:bool=False) -> Self
Sort this Series.
methodsrc.narwhals.series.Series.sqrt() -> Self
Compute the square root.
methodsrc.narwhals.series.Series.std(*ddof:int=1) -> float
Get the standard deviation of this Series.
methodsrc.narwhals.series.Series.sum() -> float
Reduce this Series to the sum value.
methodsrc.narwhals.series.Series.tail(n:int=10) -> Self
Get the last `n` rows.
methodsrc.narwhals.series.Series.to_arrow() -> pa.Array[Any]
Convert to arrow.
methodsrc.narwhals.series.Series.to_dummies(*separator:str='_', *drop_first:bool=False) -> DataFrame[Any]
Get dummy/indicator variables.
methodsrc.narwhals.series.Series.to_frame() -> DataFrame[Any]
Convert to dataframe.
methodsrc.narwhals.series.Series.to_list() -> list[Any]
Convert to list.
methodsrc.narwhals.series.Series.to_native() -> IntoSeriesT
Convert Narwhals series to native series.
methodsrc.narwhals.series.Series.to_numpy() -> _1DArray
Convert to numpy.
methodsrc.narwhals.series.Series.to_pandas() -> pd.Series[Any]
Convert to pandas Series.
methodsrc.narwhals.series.Series.to_polars() -> pl.Series
Convert to polars Series.
methodsrc.narwhals.series.Series.unique(*maintain_order:bool=False) -> Self
Returns unique values of the series.
methodsrc.narwhals.series.Series.value_counts(*sort:bool=False, *parallel:bool=False, *name:str | None=None, *normalize:bool=False) -> DataFrame[Any]
Count the occurrences of unique values.
methodsrc.narwhals.series.Series.var(*ddof:int=1) -> float
Get the variance of this Series.
methodsrc.narwhals.series.Series.zip_with(mask:Self, other:Self) -> Self
Take values from self or other based on the given mask.
classsrc.narwhals.sql.SQLTable
A LazyFrame with an additional `to_sql` method.
methodsrc.narwhals.sql.SQLTable.to_sql(*pretty:bool=False) -> str
Convert to SQL query.
funcsrc.narwhals.sql.table(name:str, schema:IntoSchema) -> SQLTable
Generate standalone LazyFrame which you can use to generate SQL.
methodsrc.narwhals.stable.v1.Expr.arg_max() -> Self
Returns the index of the maximum value.
methodsrc.narwhals.stable.v1.Expr.arg_min() -> Self
Returns the index of the minimum value.
methodsrc.narwhals.stable.v1.Expr.arg_true() -> Self
Find elements where boolean expression is True.
methodsrc.narwhals.stable.v1.Expr.first() -> Self
Get the first value.
methodsrc.narwhals.stable.v1.Expr.gather_every(n:int, offset:int=0) -> Self
Take every nth value in the Series and return as new Series.
methodsrc.narwhals.stable.v1.Expr.head(n:int=10) -> Self
Get the first `n` rows.
methodsrc.narwhals.stable.v1.Expr.last() -> Self
Get the last value.
methodsrc.narwhals.stable.v1.Expr.sample(n:int | None=None, *fraction:float | None=None, *with_replacement:bool=False, *seed:int | None=None) -> Self
Sample randomly from this expression.
methodsrc.narwhals.stable.v1.Expr.sort(*descending:bool=False, *nulls_last:bool=False) -> Self
Sort this column.
methodsrc.narwhals.stable.v1.Expr.tail(n:int=10) -> Self
Get the last `n` rows.
methodsrc.narwhals.stable.v1.Expr.unique(*maintain_order:bool | None=None) -> Self
Return unique values of this expression.
methodsrc.narwhals.stable.v1.LazyFrame.tail(n:int=5) -> Self
Get the last `n` rows.
classsrc.narwhals.stable.v1._dtypes.Enum
A fixed categorical encoding of a unique set of strings.
funcsrc.narwhals.stable.v1.cov(a:IntoExpr, b:IntoExpr, *ddof:int=1) -> Expr
Compute the covariance between two columns.
funcsrc.narwhals.stable.v1.format(f_string:str, *args:IntoExpr) -> Expr
Format expressions as a string.
funcsrc.narwhals.stable.v1.read_csv(source:FileSource, *backend:IntoBackend[EagerAllowed | PluginName] | None=None, *native_namespace:ModuleType | None=None, **kwargs:Any) -> DataFrame[Any]
Read a CSV file into a DataFrame.
funcsrc.narwhals.stable.v1.scan_csv(source:FileSource, *backend:IntoBackend[Backend | PluginName] | None=None, *native_namespace:ModuleType | None=None, **kwargs:Any) -> LazyFrame[Any]
Lazily read from a CSV file.
funcsrc.narwhals.stable.v1.scan_parquet(source:FileSource, *backend:IntoBackend[Backend | PluginName] | None=None, *native_namespace:ModuleType | None=None, **kwargs:Any) -> LazyFrame[Any]
Lazily read from a parquet file.
funcsrc.narwhals.stable.v1.struct(*exprs:IntoExpr | Sequence[IntoExpr], **named_exprs:IntoExpr) -> Expr
Collect columns into a struct column.
methodsrc.narwhals.stable.v2.Expr.first() -> Self
Get the first value.
methodsrc.narwhals.stable.v2.Expr.last() -> Self
Get the last value.
funcsrc.narwhals.stable.v2.all() -> Expr
Instantiate an expression representing all columns.
funcsrc.narwhals.stable.v2.all_horizontal(*ignore_nulls:bool, *exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the bitwise AND horizontally across columns.
funcsrc.narwhals.stable.v2.any_horizontal(*ignore_nulls:bool, *exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the bitwise OR horizontally across columns.
funcsrc.narwhals.stable.v2.cov(a:IntoExpr, b:IntoExpr, *ddof:int=1) -> Expr
Compute the covariance between two columns.
funcsrc.narwhals.stable.v2.exclude(*names:str | Iterable[str]) -> Expr
Creates an expression that excludes columns by their name(s).
funcsrc.narwhals.stable.v2.format(f_string:str, *args:IntoExpr) -> Expr
Format expressions as a string.
funcsrc.narwhals.stable.v2.len() -> Expr
Return the number of rows.
funcsrc.narwhals.stable.v2.lit(value:NonNestedLiteral, dtype:IntoDType | None=None) -> Expr
Return an expression representing a literal value.
funcsrc.narwhals.stable.v2.max(*columns:str) -> Expr
Return the maximum value.
funcsrc.narwhals.stable.v2.max_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Get the maximum value horizontally across columns.
funcsrc.narwhals.stable.v2.mean(*columns:str) -> Expr
Get the mean value.
funcsrc.narwhals.stable.v2.mean_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Compute the mean of all values horizontally across columns.
funcsrc.narwhals.stable.v2.median(*columns:str) -> Expr
Get the median value.
funcsrc.narwhals.stable.v2.min(*columns:str) -> Expr
Return the minimum value.
funcsrc.narwhals.stable.v2.min_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Get the minimum value horizontally across columns.
funcsrc.narwhals.stable.v2.new_series(name:str, values:Any, dtype:IntoDType | None=None, *backend:IntoBackend[EagerAllowed | PluginName]) -> Series[Any]
Instantiate Narwhals Series from iterable (e.g.
funcsrc.narwhals.stable.v2.read_csv(source:str, *backend:IntoBackend[EagerAllowed | PluginName], *separator:str=',', **kwargs:Any) -> DataFrame[Any]
Read a CSV file into a DataFrame.
funcsrc.narwhals.stable.v2.read_parquet(source:str, *backend:IntoBackend[EagerAllowed | PluginName], **kwargs:Any) -> DataFrame[Any]
Read into a DataFrame from a parquet file.
funcsrc.narwhals.stable.v2.scan_csv(source:str, *backend:IntoBackend[Backend | PluginName], *separator:str=',', **kwargs:Any) -> LazyFrame[Any]
Lazily read from a CSV file.
funcsrc.narwhals.stable.v2.scan_parquet(source:str, *backend:IntoBackend[Backend | PluginName], **kwargs:Any) -> LazyFrame[Any]
Lazily read from a parquet file.
funcsrc.narwhals.stable.v2.struct(*exprs:IntoExpr | Sequence[IntoExpr], **named_exprs:IntoExpr) -> Expr
Collect columns into a struct column.
funcsrc.narwhals.stable.v2.sum(*columns:str) -> Expr
Sum all values.
funcsrc.narwhals.stable.v2.sum_horizontal(*exprs:IntoExpr | Iterable[IntoExpr]) -> Expr
Sum all values horizontally across columns.
funcsrc.narwhals.stable.v2.when(*predicates:IntoExpr | Iterable[IntoExpr]) -> When
Start a `when-then-otherwise` expression.
funcsrc.narwhals.translate.get_native_namespace(*obj:Frame | Series[Any] | IntoFrame | IntoSeries) -> Any
Get native namespace from object.
funcsrc.narwhals.translate.to_py_scalar(scalar_like:Any) -> Any
If a scalar is not Python native, converts it to Python native.
methodtpch.classes.Query.inputs(backend:Backend) -> tuple[nw.LazyFrame[Any], ...]
Get the frame inputs for this query at the given scale factor.
classtpch.classes.TableLogger
A logger that streams table rows with box-drawing characters.
methodtpch.classes.TableLogger.format_size(n_bytes:float) -> str
Return the best human-readable size and unit for the given byte count.
funcutils.check_dist_content.git_tracked(*pathspecs:str) -> set[str]
Return the set of git-tracked files under the given pathspecs.
funcutils.check_docstrings.cleanup_temp_files(temp_files:list[tuple[Path, str]]) -> None
Remove all temporary files.
funcutils.check_docstrings.extract_docstring_examples(files:list[str]) -> list[tuple[Path, str, str]]
Extract examples from docstrings in Python files.
funcutils.check_docstrings.find_ruff_bin() -> Path
Return the ruff binary path.
funcutils.check_docstrings.report_errors(completed:CompletedProcess[str] | None, temp_files:list[tuple[Path, str]]) -> None
Map errors back to original examples and report them.
methodutils.generate_backend_completeness.Backend.is_eager_allowed() -> bool
Check if a backend supports eager evaluation.
funcutils.generate_backend_completeness.generate_completeness_tables() -> None
Generate all backend completeness tables.
funcutils.generate_backend_completeness.get_narwhals_methods(module_name:str, class_name:str) -> set[str]
Get all public methods from a narwhals top-level class.
funcutils.generate_backend_completeness.render_table_and_write_to_output(df:pl.DataFrame, title:str, output_filename:str) -> None
Render a markdown table and write it to a file.
funcutils.sort_api_reference.sort_list(match:re.Match[str]) -> str
Sort a matched members list section.
funcutils.sort_api_reference.sort_members_in_markdown(file_path:Path) -> int
Sort members lists in a markdown file alphabetically.

About this data

These signatures were extracted from the public source of narwhals-dev/narwhals using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries