From 90feb0726cba764e503dd770085dac83f930fb25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:58:31 +0000 Subject: [PATCH] Deployed f710225 with MkDocs version: 1.5.3 --- .nojekyll | 0 404.html | 662 ++ api-reference/dataframe/index.html | 1802 +++++ api-reference/expressions/index.html | 1302 ++++ api-reference/lazyframe/index.html | 1287 ++++ api-reference/narwhals/index.html | 1276 ++++ api-reference/series/index.html | 1499 ++++ assets/_mkdocstrings.css | 109 + assets/image.png | Bin 0 -> 132699 bytes assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.bd41221c.min.js | 29 + assets/javascripts/bundle.bd41221c.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/stylesheets/main.7e359304.min.css | 1 + assets/stylesheets/main.7e359304.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + basics/column/index.html | 1126 +++ basics/complete_example/index.html | 954 +++ basics/dataframe/index.html | 886 +++ extending/index.html | 768 ++ generate_members.py | 43 + index.html | 790 ++ installation/index.html | 749 ++ objects.inv | Bin 0 -> 897 bytes quick_start/index.html | 849 +++ related/index.html | 873 +++ requirements-docs.txt | 4 + roadmap/index.html | 860 +++ search/search_index.json | 1 + sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes why/index.html | 764 ++ 68 files changed, 23897 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 api-reference/dataframe/index.html create mode 100644 api-reference/expressions/index.html create mode 100644 api-reference/lazyframe/index.html create mode 100644 api-reference/narwhals/index.html create mode 100644 api-reference/series/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/image.png create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.bd41221c.min.js create mode 100644 assets/javascripts/bundle.bd41221c.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/stylesheets/main.7e359304.min.css create mode 100644 assets/stylesheets/main.7e359304.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 basics/column/index.html create mode 100644 basics/complete_example/index.html create mode 100644 basics/dataframe/index.html create mode 100644 extending/index.html create mode 100644 generate_members.py create mode 100644 index.html create mode 100644 installation/index.html create mode 100644 objects.inv create mode 100644 quick_start/index.html create mode 100644 related/index.html create mode 100644 requirements-docs.txt create mode 100644 roadmap/index.html create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 why/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/404.html b/404.html new file mode 100644 index 0000000000..0ad80ced7c --- /dev/null +++ b/404.html @@ -0,0 +1,662 @@ + + + +
+ + + + + + + + + + + + + + +narwhals.DataFrame
shape: tuple[int, int]
+
+
+ property
+
+
+schema: dict[str, DType]
+
+
+ property
+
+
+Get a dict[column name, DataType].
+ + + +Examples:
+>>> import polars as pl
+>>> import narwhals as nw
+>>> df_pl = pl.DataFrame(
+... {
+... "foo": [1, 2, 3],
+... "bar": [6.0, 7.0, 8.0],
+... "ham": ["a", "b", "c"],
+... }
+... )
+>>> df = nw.DataFrame(df_pl)
+>>> df.schema
+OrderedDict({'foo': Int64, 'bar': Float64, 'ham': String})
+```
+
columns: list[str]
+
+
+ property
+
+
+Get column names.
+ + + +Examples:
+Get column names.
+>>> import polars as pl
+>>> import narwhals as nw
+>>> df_pl = pl.DataFrame(
+... {
+... "foo": [1, 2, 3],
+... "bar": [6, 7, 8],
+... "ham": ["a", "b", "c"],
+... }
+... )
+>>> df = nw.DataFrame(df_pl)
+>>> df.columns
+['foo', 'bar', 'ham']
+
to_pandas()
+
+to_numpy()
+
+__getitem__(col_name)
+
+to_dict(*, as_series=True)
+
+with_columns(*exprs, **named_exprs)
+
+Add columns to this DataFrame.
+Added columns will replace existing columns with the same name.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
*exprs |
+
+ IntoExpr | Iterable[IntoExpr]
+ |
+
+
+
+ Column(s) to add, specified as positional arguments. + Accepts expression input. Strings are parsed as column names, other + non-expression inputs are parsed as literals. + |
+
+ ()
+ |
+
**named_exprs |
+
+ IntoExpr
+ |
+
+
+
+ Additional columns to add, specified as keyword arguments. + The columns will be renamed to the keyword used. + |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
DataFrame |
+ Self
+ |
+
+
+
+ A new DataFrame with the columns added. + |
+
Creating a new DataFrame using this method does not create a new copy of +existing data.
+Examples:
+Pass an expression to add it as a new column.
+>>> import polars as pl
+>>> import narwhals as nw
+>>> df_pl = pl.DataFrame(
+... {
+... "a": [1, 2, 3, 4],
+... "b": [0.5, 4, 10, 13],
+... "c": [True, True, False, True],
+... }
+... )
+>>> df = nw.DataFrame(df_pl)
+>>> dframe = df.with_columns((nw.col("a") * 2).alias("a*2"))
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+
>>> nw.to_native(dframe)
+shape: (4, 4)
+┌─────┬──────┬───────┬─────┐
+│ a ┆ b ┆ c ┆ a*2 │
+│ --- ┆ --- ┆ --- ┆ --- │
+│ i64 ┆ f64 ┆ bool ┆ i64 │
+╞═════╪══════╪═══════╪═════╡
+│ 1 ┆ 0.5 ┆ true ┆ 2 │
+│ 2 ┆ 4.0 ┆ true ┆ 4 │
+│ 3 ┆ 10.0 ┆ false ┆ 6 │
+│ 4 ┆ 13.0 ┆ true ┆ 8 │
+└─────┴──────┴───────┴─────┘
+
select(*exprs, **named_exprs)
+
+Select columns from this DataFrame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
*exprs |
+
+ IntoExpr | Iterable[IntoExpr]
+ |
+
+
+
+ Column(s) to select, specified as positional arguments. + Accepts expression input. Strings are parsed as column names, + other non-expression inputs are parsed as literals. + |
+
+ ()
+ |
+
**named_exprs |
+
+ IntoExpr
+ |
+
+
+
+ Additional columns to select, specified as keyword arguments. + The columns will be renamed to the keyword used. + |
+
+ {}
+ |
+
Examples:
+Pass the name of a column to select that column.
+>>> import polars as pl
+>>> import narwhals as nw
+>>> df_pl = pl.DataFrame(
+... {
+... "foo": [1, 2, 3],
+... "bar": [6, 7, 8],
+... "ham": ["a", "b", "c"],
+... }
+... )
+>>> df = nw.DataFrame(df_pl)
+>>> dframe = df.select("foo")
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+>>> nw.to_native(dframe)
+shape: (3, 1)
+┌─────┐
+│ foo │
+│ --- │
+│ i64 │
+╞═════╡
+│ 1 │
+│ 2 │
+│ 3 │
+└─────┘
+
Multiple columns can be selected by passing a list of column names.
+>>> dframe = df.select(["foo", "bar"])
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+>>> nw.to_native(dframe)
+shape: (3, 2)
+┌─────┬─────┐
+│ foo ┆ bar │
+│ --- ┆ --- │
+│ i64 ┆ i64 │
+╞═════╪═════╡
+│ 1 ┆ 6 │
+│ 2 ┆ 7 │
+│ 3 ┆ 8 │
+└─────┴─────┘
+
Multiple columns can also be selected using positional arguments instead of a +list. Expressions are also accepted.
+>>> dframe = df.select(nw.col("foo"), nw.col("bar") + 1)
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+>>> nw.to_native(dframe)
+shape: (3, 2)
+┌─────┬─────┐
+│ foo ┆ bar │
+│ --- ┆ --- │
+│ i64 ┆ i64 │
+╞═════╪═════╡
+│ 1 ┆ 7 │
+│ 2 ┆ 8 │
+│ 3 ┆ 9 │
+└─────┴─────┘
+
Use keyword arguments to easily name your expression inputs.
+>>> dframe = df.select(threshold=nw.col('foo')*2)
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+>>> nw.to_native(dframe)
+shape: (3, 1)
+┌───────────┐
+│ threshold │
+│ --- │
+│ i64 │
+╞═══════════╡
+│ 2 │
+│ 4 │
+│ 6 │
+└───────────┘
+
rename(mapping)
+
+Rename column names.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mapping |
+
+ dict[str, str]
+ |
+
+
+
+ Key value pairs that map from old name to new name, or a function + that takes the old name as input and returns the new name. + |
+ + required + | +
Examples:
+>>> import polars as pl
+>>> import narwhals as nw
+>>> df_pl = pl.DataFrame(
+... {"foo": [1, 2, 3], "bar": [6, 7, 8], "ham": ["a", "b", "c"]}
+... )
+>>> df = nw.DataFrame(df_pl)
+>>> dframe = df.rename({"foo": "apple"})
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+
>>> nw.to_native(dframe)
+shape: (3, 3)
+┌───────┬─────┬─────┐
+│ apple ┆ bar ┆ ham │
+│ --- ┆ --- ┆ --- │
+│ i64 ┆ i64 ┆ str │
+╞═══════╪═════╪═════╡
+│ 1 ┆ 6 ┆ a │
+│ 2 ┆ 7 ┆ b │
+│ 3 ┆ 8 ┆ c │
+└───────┴─────┴─────┘
+>>> dframe = df.rename(lambda column_name: "f" + column_name[1:])
+>>> dframe
+┌─────────────────────────────────────────────────┐
+| Narwhals DataFrame |
+| Use `narwhals.to_native()` to see native output |
+└─────────────────────────────────────────────────┘
+>>> nw.to_native(dframe)
+shape: (3, 3)
+┌─────┬─────┬─────┐
+│ foo ┆ far ┆ fam │
+│ --- ┆ --- ┆ --- │
+│ i64 ┆ i64 ┆ str │
+╞═════╪═════╪═════╡
+│ 1 ┆ 6 ┆ a │
+│ 2 ┆ 7 ┆ b │
+│ 3 ┆ 8 ┆ c │
+└─────┴─────┴─────┘
+
head(n)
+
+drop(*columns)
+
+unique(subset)
+
+filter(*predicates)
+
+group_by(*keys)
+
+sort(by, *more_by, descending=False)
+
+join(other, *, how='inner', left_on, right_on)
+
+narwhals.Expr
str: ExprStringNamespace
+
+
+ property
+
+
+alias(name)
+
+cast(dtype)
+
+mean()
+
+sum()
+
+min()
+
+max()
+
+n_unique()
+
+unique()
+
+is_between(lower_bound, upper_bound, closed='both')
+
+is_in(other)
+
+is_null()
+
+drop_nulls()
+
+sample(n=None, fraction=None, *, with_replacement=False)
+
+narwhals.LazyFrame
schema: dict[str, DType]
+
+
+ property
+
+
+columns: list[str]
+
+
+ property
+
+
+with_columns(*exprs, **named_exprs)
+
+select(*exprs, **named_exprs)
+
+rename(mapping)
+
+head(n)
+
+drop(*columns)
+
+unique(subset)
+
+filter(*predicates)
+
+group_by(*keys)
+
+sort(by, *more_by, descending=False)
+
+join(other, *, how='inner', left_on, right_on)
+
+collect()
+
+narwhals
Here are the top-level functions available in Narwhals.
+ + +from_native(native_dataframe)
+
+Convert dataframe to Narwhals DataFrame or LazyFrame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
native_dataframe |
+
+ Any
+ |
+
+
+
+ Raw dataframe from user. +Input object can be: +
|
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ DataFrame | LazyFrame
+ |
+
+
+
+ narwhals.DataFrame or narwhals.LazyFrame + |
+
to_native(narwhals_object)
+
+Convert Narwhals object to native one.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
narwhals_object |
+
+ LazyFrame | DataFrame | Series
+ |
+
+
+
+ Narwhals object. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Any
+ |
+
+
+
+ Object of class that user started with. + |
+
col(*names)
+
+Instantiate an expression, similar to polars.col
.
min(*columns)
+
+Instantiate an expression representing the minimum of one or more columns, similar to polars.min
.
max(*columns)
+
+Instantiate an expression representing the maximum of one or more columns, similar to polars.max
.
mean(*columns)
+
+Instantiate an expression representing the mean of one or more columns, similar to polars.mean
.
sum(*columns)
+
+Instantiate an expression representing the sum of one or more columns, similar to polars.sum
.
len()
+
+Instantiate an expression representing the length of a dataframe, similar to polars.len
.
sum_horizontal(*exprs)
+
+Instantiate an expression representing the horizontal sum of one or more expressions, similar to polars.sum_horizontal
.
narwhals.Series
name: str
+
+
+ property
+
+
+dtype: Any
+
+
+ property
+
+
+shape: tuple[int]
+
+
+ property
+
+
+alias(name)
+
+rename(name)
+
+cast(dtype)
+
+item()
+
+is_between(lower_bound, upper_bound, closed='both')
+
+is_in(other)
+
+is_null()
+
+drop_nulls()
+
+n_unique()
+
+unique()
+
+zip_with(mask, other)
+
+sample(n=None, fraction=None, *, with_replacement=False)
+
+to_numpy()
+
+to_pandas()
+
+mean()
+
+std()
+
+