diff --git a/.build b/.build index cb8dbf6e3..b6cc1e08f 100644 --- a/.build +++ b/.build @@ -12,15 +12,6 @@ Explorer.Query.html Explorer.Series.html Explorer.TensorFrame.html Explorer.html -FSS.HTTP.Config.html -FSS.HTTP.Entry.html -FSS.HTTP.html -FSS.Local.Entry.html -FSS.Local.html -FSS.S3.Config.html -FSS.S3.Entry.html -FSS.S3.html -FSS.html api-reference.html assets/logo.png changelog.html @@ -51,8 +42,8 @@ dist/merriweather-latin-ext-300-normal-K6L27CZ5.woff2 dist/merriweather-vietnamese-300-italic-EHHNZPUO.woff2 dist/merriweather-vietnamese-300-normal-U376L4Z4.woff2 dist/remixicon-NKANDIL5.woff2 -dist/search_data-45C0429C.js -dist/sidebar_items-115BAD9F.js +dist/search_data-8C0D2CAA.js +dist/sidebar_items-1155EA65.js exploring_explorer.html index.html search.html diff --git a/404.html b/404.html index ce2d71e13..c1cd2774a 100644 --- a/404.html +++ b/404.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Backend.DataFrame.html b/Explorer.Backend.DataFrame.html index 6c588816d..1aaf7fa20 100644 --- a/Explorer.Backend.DataFrame.html +++ b/Explorer.Backend.DataFrame.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Backend.LazyFrame.html b/Explorer.Backend.LazyFrame.html index 8b0b88aac..ae1501feb 100644 --- a/Explorer.Backend.LazyFrame.html +++ b/Explorer.Backend.LazyFrame.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Backend.LazySeries.html b/Explorer.Backend.LazySeries.html index 7334f9977..cd8be4ed3 100644 --- a/Explorer.Backend.LazySeries.html +++ b/Explorer.Backend.LazySeries.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Backend.Series.html b/Explorer.Backend.Series.html index 670f151ea..28598c2cf 100644 --- a/Explorer.Backend.Series.html +++ b/Explorer.Backend.Series.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Backend.html b/Explorer.Backend.html index e41c1ec1b..d77a81aa3 100644 --- a/Explorer.Backend.html +++ b/Explorer.Backend.html @@ -13,7 +13,7 @@ - + @@ -216,9 +216,9 @@

put(backend)

Examples -
iex> Explorer.Backend.put(Lib.CustomBackend)
+
iex> Explorer.Backend.put(Lib.CustomBackend)
 Explorer.PolarsBackend
-iex> Explorer.Backend.get()
+iex> Explorer.Backend.get()
 Lib.CustomBackend
diff --git a/Explorer.DataFrame.html b/Explorer.DataFrame.html index 15ad84cab..61fe54fa6 100644 --- a/Explorer.DataFrame.html +++ b/Explorer.DataFrame.html @@ -13,7 +13,7 @@ - + @@ -113,38 +113,38 @@

The DataFrame struct and API.

Dataframes are two-dimensional tabular data structures similar to a spreadsheet. -For example, the Iris dataset:

iex> Explorer.Datasets.iris()
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
-  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->

This dataframe has 150 rows and five columns. Each column is an Explorer.Series -of the same size (150):

iex> df = Explorer.Datasets.iris()
-iex> df["sepal_length"]
-#Explorer.Series<
-  Polars[150]
-  float [5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8, 4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5.4, 5.1, 4.6, 5.1, 4.8, 5.0, 5.0, 5.2, 5.2, 4.7, 4.8, 5.4, 5.2, 5.5, 4.9, 5.0, 5.5, 4.9, 4.4, 5.1, 5.0, 4.5, 4.4, 5.0, 5.1, 4.8, 5.1, 4.6, 5.3, 5.0, ...]
->

+For example, the Iris dataset:

iex> Explorer.Datasets.iris()
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
+  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>

This dataframe has 150 rows and five columns. Each column is an Explorer.Series +of the same size (150):

iex> df = Explorer.Datasets.iris()
+iex> df["sepal_length"]
+#Explorer.Series<
+  Polars[150]
+  float [5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.4, 4.8, 4.8, 4.3, 5.8, 5.7, 5.4, 5.1, 5.7, 5.1, 5.4, 5.1, 4.6, 5.1, 4.8, 5.0, 5.0, 5.2, 5.2, 4.7, 4.8, 5.4, 5.2, 5.5, 4.9, 5.0, 5.5, 4.9, 4.4, 5.1, 5.0, 4.5, 4.4, 5.0, 5.1, 4.8, 5.1, 4.6, 5.3, 5.0, ...]
+>

Creating dataframes

Dataframes can be created from normal Elixir terms. The main way you might do this is -with the new/1 function. For example:

iex> Explorer.DataFrame.new(a: ["a", "b"], b: [1, 2])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a string ["a", "b"]
-  b integer [1, 2]
->

Or with a list of maps:

iex> Explorer.DataFrame.new([%{"col1" => "a", "col2" => 1}, %{"col1" => "b", "col2" => 2}])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  col1 string ["a", "b"]
-  col2 integer [1, 2]
->

+with the new/1 function. For example:

iex> Explorer.DataFrame.new(a: ["a", "b"], b: [1, 2])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a string ["a", "b"]
+  b integer [1, 2]
+>

Or with a list of maps:

iex> Explorer.DataFrame.new([%{"col1" => "a", "col2" => 1}, %{"col1" => "b", "col2" => 2}])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  col1 string ["a", "b"]
+  col2 integer [1, 2]
+>

Verbs @@ -182,16 +182,16 @@

Explorer supports reading and writing of:

The convention Explorer uses is to have from_* and to_* functions to read and write to files in the formats above. load_* and dump_* versions are also available to read and write those formats directly in memory.

Files can be fetched from local or remote file system, such as S3, using the following formats:

# path to a file in disk
-Explorer.DataFrame.from_parquet("/path/to/file.parquet")
+Explorer.DataFrame.from_parquet("/path/to/file.parquet")
 
 # path to a URL schema (with optional configuration)
-Explorer.DataFrame.from_parquet("s3://bucket/file.parquet", config: FSS.S3.config_from_system_env())
+Explorer.DataFrame.from_parquet("s3://bucket/file.parquet", config: FSS.S3.config_from_system_env())
 
 # it's possible to configure using keyword lists
-Explorer.DataFrame.from_parquet("s3://bucket/file.parquet", config: [access_key_id: "my-key", secret_access_key: "my-secret"])
+Explorer.DataFrame.from_parquet("s3://bucket/file.parquet", config: [access_key_id: "my-key", secret_access_key: "my-secret"])
 
 # a FSS entry (it already includes its config)
-Explorer.DataFrame.from_parquet(FSS.S3.parse("s3://bucket/file.parquet"))

The :config option of from_* functions is only required if the filename is a path +Explorer.DataFrame.from_parquet(FSS.S3.parse("s3://bucket/file.parquet"))

The :config option of from_* functions is only required if the filename is a path to a remote resource. In case it's a FSS entry, the requirement is that the config is passed inside the entry struct.

@@ -203,40 +203,40 @@

forth accept a single or multiple columns as arguments. The columns can be specified in a variety of formats, which we describe below.

Explorer.DataFrame also implements the Access behaviour (also known as the brackets syntax). This should be familiar for users coming from other language with dataframes -such as R or Python. For example:

iex> df = Explorer.Datasets.wine()
-iex> df["class"]
-#Explorer.Series<
-  Polars[178]
-  integer [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
->

Accessing the dataframe with a column name either as a string or an atom, will return -the column. You can also pass an integer representing the column order:

iex> df = Explorer.Datasets.wine()
-iex> df[0]
-#Explorer.Series<
-  Polars[178]
-  integer [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
->

You can also pass a list, a range, or a regex to return a dataframe matching -the given data type. For example, by passing a list:

iex> df = Explorer.Datasets.wine()
-iex> df[["class", "hue"]]
-#Explorer.DataFrame<
-  Polars[178 x 2]
-  class integer [1, 1, 1, 1, 1, ...]
-  hue float [1.04, 1.05, 1.03, 0.86, 1.04, ...]
->

Or a range for the given positions:

iex> df = Explorer.Datasets.wine()
-iex> df[0..2]
-#Explorer.DataFrame<
-  Polars[178 x 3]
-  class integer [1, 1, 1, 1, 1, ...]
-  alcohol float [14.23, 13.2, 13.16, 14.37, 13.24, ...]
-  malic_acid float [1.71, 1.78, 2.36, 1.95, 2.59, ...]
->

Or a regex to keep only columns matching a given pattern:

iex> df = Explorer.Datasets.wine()
-iex> df[~r/(class|hue)/]
-#Explorer.DataFrame<
-  Polars[178 x 2]
-  class integer [1, 1, 1, 1, 1, ...]
-  hue float [1.04, 1.05, 1.03, 0.86, 1.04, ...]
->

Given you can also access a series using its index, you can use -multiple accesses to select a column and row at the same time:

iex> df = Explorer.Datasets.wine()
-iex> df["class"][3]
+such as R or Python. For example:

iex> df = Explorer.Datasets.wine()
+iex> df["class"]
+#Explorer.Series<
+  Polars[178]
+  integer [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
+>

Accessing the dataframe with a column name either as a string or an atom, will return +the column. You can also pass an integer representing the column order:

iex> df = Explorer.Datasets.wine()
+iex> df[0]
+#Explorer.Series<
+  Polars[178]
+  integer [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...]
+>

You can also pass a list, a range, or a regex to return a dataframe matching +the given data type. For example, by passing a list:

iex> df = Explorer.Datasets.wine()
+iex> df[["class", "hue"]]
+#Explorer.DataFrame<
+  Polars[178 x 2]
+  class integer [1, 1, 1, 1, 1, ...]
+  hue float [1.04, 1.05, 1.03, 0.86, 1.04, ...]
+>

Or a range for the given positions:

iex> df = Explorer.Datasets.wine()
+iex> df[0..2]
+#Explorer.DataFrame<
+  Polars[178 x 3]
+  class integer [1, 1, 1, 1, 1, ...]
+  alcohol float [14.23, 13.2, 13.16, 14.37, 13.24, ...]
+  malic_acid float [1.71, 1.78, 2.36, 1.95, 2.59, ...]
+>

Or a regex to keep only columns matching a given pattern:

iex> df = Explorer.Datasets.wine()
+iex> df[~r/(class|hue)/]
+#Explorer.DataFrame<
+  Polars[178 x 2]
+  class integer [1, 1, 1, 1, 1, ...]
+  hue float [1.04, 1.05, 1.03, 0.86, 1.04, ...]
+>

Given you can also access a series using its index, you can use +multiple accesses to select a column and row at the same time:

iex> df = Explorer.Datasets.wine()
+iex> df["class"][3]
 1
@@ -1461,7 +1461,7 @@

fs_entry()

-
@type fs_entry() :: FSS.Local.Entry.t() | FSS.S3.Entry.t() | FSS.HTTP.Entry.t()
+
@type fs_entry() :: FSS.Local.Entry.t() | FSS.S3.Entry.t() | FSS.HTTP.Entry.t()
@@ -1593,15 +1593,15 @@

Series can be given either as keyword lists or maps -where the keys are the name and the values are series:

iex> Explorer.DataFrame.new(%{
-...>   floats: Explorer.Series.from_list([1.0, 2.0]),
-...>   ints: Explorer.Series.from_list([1, nil])
-...> })
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  floats float [1.0, 2.0]
-  ints integer [1, nil]
->

+where the keys are the name and the values are series:

iex> Explorer.DataFrame.new(%{
+...>   floats: Explorer.Series.from_list([1.0, 2.0]),
+...>   ints: Explorer.Series.from_list([1, nil])
+...> })
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  floats float [1.0, 2.0]
+  ints integer [1, nil]
+>

From tensors @@ -1609,77 +1609,77 @@

To create dataframe from tensors, you can pass a matrix as argument. Each matrix column becomes a dataframe column with names x1, x2, x3, -etc:

iex> Explorer.DataFrame.new(Nx.tensor([
-...>   [1, 2, 3],
-...>   [4, 5, 6]
-...> ]))
-#Explorer.DataFrame<
-  Polars[2 x 3]
-  x1 integer [1, 4]
-  x2 integer [2, 5]
-  x3 integer [3, 6]
->

Explorer expects tensors to have certain types, so you may need to cast -the data accordingly. See Explorer.Series.from_tensor/2 for more info.

You can also pass a keyword list or maps of vectors (rank 1 tensors):

iex> Explorer.DataFrame.new(%{
-...>   floats: Nx.tensor([1.0, 2.0], type: :f64),
-...>   ints: Nx.tensor([3, 4])
-...> })
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  floats float [1.0, 2.0]
-  ints integer [3, 4]
->

Use dtypes to force a particular representation:

iex> Explorer.DataFrame.new([
-...>   floats: Nx.tensor([1.0, 2.0], type: :f64),
-...>   times: Nx.tensor([3_000, 4_000])
-...> ], dtypes: [times: :time])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  floats float [1.0, 2.0]
-  times time [00:00:00.000003, 00:00:00.000004]
->

+etc:

iex> Explorer.DataFrame.new(Nx.tensor([
+...>   [1, 2, 3],
+...>   [4, 5, 6]
+...> ]))
+#Explorer.DataFrame<
+  Polars[2 x 3]
+  x1 integer [1, 4]
+  x2 integer [2, 5]
+  x3 integer [3, 6]
+>

Explorer expects tensors to have certain types, so you may need to cast +the data accordingly. See Explorer.Series.from_tensor/2 for more info.

You can also pass a keyword list or maps of vectors (rank 1 tensors):

iex> Explorer.DataFrame.new(%{
+...>   floats: Nx.tensor([1.0, 2.0], type: :f64),
+...>   ints: Nx.tensor([3, 4])
+...> })
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  floats float [1.0, 2.0]
+  ints integer [3, 4]
+>

Use dtypes to force a particular representation:

iex> Explorer.DataFrame.new([
+...>   floats: Nx.tensor([1.0, 2.0], type: :f64),
+...>   times: Nx.tensor([3_000, 4_000])
+...> ], dtypes: [times: :time])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  floats float [1.0, 2.0]
+  times time [00:00:00.000003, 00:00:00.000004]
+>

From tabular

Tabular data can be either columnar or row-based. -Let's start with column data:

iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, nil]})
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  floats float [1.0, 2.0]
-  ints integer [1, nil]
->
-
-iex> Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  floats float [1.0, 2.0]
-  ints integer [1, nil]
->
-
-iex> Explorer.DataFrame.new([floats: [1.0, 2.0], ints: [1, nil], binaries: [<<239, 191, 19>>, nil]], dtypes: [{:binaries, :binary}])
-#Explorer.DataFrame<
-  Polars[2 x 3]
-  floats float [1.0, 2.0]
-  ints integer [1, nil]
-  binaries binary [<<239, 191, 19>>, nil]
->
-
-iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, "wrong"]})
-** (ArgumentError) cannot create series "ints": the value "wrong" does not match the inferred series dtype :integer

From row data:

iex> rows = [%{id: 1, name: "JosƩ"}, %{id: 2, name: "Christopher"}, %{id: 3, name: "Cristine"}]
-iex> Explorer.DataFrame.new(rows)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  id integer [1, 2, 3]
-  name string ["JosƩ", "Christopher", "Cristine"]
->
-
-iex> rows = [[id: 1, name: "JosƩ"], [id: 2, name: "Christopher"], [id: 3, name: "Cristine"]]
-iex> Explorer.DataFrame.new(rows)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  id integer [1, 2, 3]
-  name string ["JosƩ", "Christopher", "Cristine"]
->
+Let's start with column data:

iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, nil]})
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  floats float [1.0, 2.0]
+  ints integer [1, nil]
+>
+
+iex> Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  floats float [1.0, 2.0]
+  ints integer [1, nil]
+>
+
+iex> Explorer.DataFrame.new([floats: [1.0, 2.0], ints: [1, nil], binaries: [<<239, 191, 19>>, nil]], dtypes: [{:binaries, :binary}])
+#Explorer.DataFrame<
+  Polars[2 x 3]
+  floats float [1.0, 2.0]
+  ints integer [1, nil]
+  binaries binary [<<239, 191, 19>>, nil]
+>
+
+iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, "wrong"]})
+** (ArgumentError) cannot create series "ints": the value "wrong" does not match the inferred series dtype :integer

From row data:

iex> rows = [%{id: 1, name: "JosƩ"}, %{id: 2, name: "Christopher"}, %{id: 3, name: "Cristine"}]
+iex> Explorer.DataFrame.new(rows)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  id integer [1, 2, 3]
+  name string ["JosƩ", "Christopher", "Cristine"]
+>
+
+iex> rows = [[id: 1, name: "JosƩ"], [id: 2, name: "Christopher"], [id: 3, name: "Cristine"]]
+iex> Explorer.DataFrame.new(rows)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  id integer [1, 2, 3]
+  name string ["JosƩ", "Christopher", "Cristine"]
+>
@@ -1725,13 +1725,13 @@

to_columns(df, opts \\ [])

Examples

-
iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])
-iex> Explorer.DataFrame.to_columns(df)
-%{"floats" => [1.0, 2.0], "ints" => [1, nil]}
+
iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])
+iex> Explorer.DataFrame.to_columns(df)
+%{"floats" => [1.0, 2.0], "ints" => [1, nil]}
 
-iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-iex> Explorer.DataFrame.to_columns(df, atom_keys: true)
-%{floats: [1.0, 2.0], ints: [1, nil]}
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil]) +iex> Explorer.DataFrame.to_columns(df, atom_keys: true) +%{floats: [1.0, 2.0], ints: [1, nil]}
@@ -1805,13 +1805,13 @@

to_rows(df, opts \\ [])

Examples

-
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-iex> Explorer.DataFrame.to_rows(df)
-[%{"floats" => 1.0, "ints" => 1}, %{"floats" => 2.0 ,"ints" => nil}]
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
+iex> Explorer.DataFrame.to_rows(df)
+[%{"floats" => 1.0, "ints" => 1}, %{"floats" => 2.0 ,"ints" => nil}]
 
-iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-iex> Explorer.DataFrame.to_rows(df, atom_keys: true)
-[%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil]) +iex> Explorer.DataFrame.to_rows(df, atom_keys: true) +[%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]
@@ -1855,13 +1855,13 @@

to_rows_stream(df, opts \\ [])

Examples -
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-iex> Explorer.DataFrame.to_rows_stream(df) |> Enum.map(& &1)
-[%{"floats" => 1.0, "ints" => 1}, %{"floats" => 2.0 ,"ints" => nil}]
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
+iex> Explorer.DataFrame.to_rows_stream(df) |> Enum.map(& &1)
+[%{"floats" => 1.0, "ints" => 1}, %{"floats" => 2.0 ,"ints" => nil}]
 
-iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])
-iex> Explorer.DataFrame.to_rows_stream(df, atom_keys: true) |> Enum.map(& &1)
-[%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil]) +iex> Explorer.DataFrame.to_rows_stream(df, atom_keys: true) |> Enum.map(& &1) +[%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]
@@ -1904,12 +1904,12 @@

to_series(df, opts \\ [])

Examples -
iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])
-iex> map = Explorer.DataFrame.to_series(df)
-iex> Explorer.Series.to_list(map["floats"])
-[1.0, 2.0]
-iex> Explorer.Series.to_list(map["ints"])
-[1, nil]
+
iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])
+iex> map = Explorer.DataFrame.to_series(df)
+iex> Explorer.Series.to_list(map["floats"])
+[1.0, 2.0]
+iex> Explorer.Series.to_list(map["ints"])
+[1, nil]
@@ -1952,33 +1952,33 @@

arrange(df, query)

Examples -

A single column name will sort ascending by that column:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
-iex> Explorer.DataFrame.arrange(df, a)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["a", "b", "c"]
-  b integer [3, 1, 2]
->

You can also sort descending:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
-iex> Explorer.DataFrame.arrange(df, desc: a)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["c", "b", "a"]
-  b integer [2, 1, 3]
->

Sorting by more than one column sorts them in the order they are entered:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.arrange(df, asc: total, desc: country)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2010, 2010, 2011, 2011, 2012, ...]
-  country string ["NIUE", "TUVALU", "TUVALU", "NIUE", "NIUE", ...]
-  total integer [1, 2, 2, 2, 2, ...]
-  solid_fuel integer [0, 0, 0, 0, 0, ...]
-  liquid_fuel integer [1, 2, 2, 2, 2, ...]
-  gas_fuel integer [0, 0, 0, 0, 0, ...]
-  cement integer [0, 0, 0, 0, 0, ...]
-  gas_flaring integer [0, 0, 0, 0, 0, ...]
-  per_capita float [0.52, 0.0, 0.0, 1.04, 1.04, ...]
-  bunker_fuels integer [0, 0, 0, 0, 0, ...]
->

+

A single column name will sort ascending by that column:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
+iex> Explorer.DataFrame.arrange(df, a)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["a", "b", "c"]
+  b integer [3, 1, 2]
+>

You can also sort descending:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
+iex> Explorer.DataFrame.arrange(df, desc: a)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["c", "b", "a"]
+  b integer [2, 1, 3]
+>

Sorting by more than one column sorts them in the order they are entered:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.arrange(df, asc: total, desc: country)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2010, 2010, 2011, 2011, 2012, ...]
+  country string ["NIUE", "TUVALU", "TUVALU", "NIUE", "NIUE", ...]
+  total integer [1, 2, 2, 2, 2, ...]
+  solid_fuel integer [0, 0, 0, 0, 0, ...]
+  liquid_fuel integer [1, 2, 2, 2, 2, ...]
+  gas_fuel integer [0, 0, 0, 0, 0, ...]
+  cement integer [0, 0, 0, 0, 0, ...]
+  gas_flaring integer [0, 0, 0, 0, 0, ...]
+  per_capita float [0.52, 0.0, 0.0, 1.04, 1.04, ...]
+  bunker_fuels integer [0, 0, 0, 0, 0, ...]
+>

Grouped examples @@ -1989,18 +1989,18 @@

arrange(df, query)

is also a group, the sorting for that column is not going to work. It is necessary to first summarise the desired column and then arrange it.

Here is an example using the Iris dataset. We group by species and then we try to sort the dataframe by species and petal length, but only "petal length" is taken into account -because "species" is a group.

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.arrange(grouped, desc: species, asc: sepal_width)
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  Groups: ["species"]
-  sepal_length float [4.5, 4.4, 4.9, 4.8, 4.3, ...]
-  sepal_width float [2.3, 2.9, 3.0, 3.0, 3.0, ...]
-  petal_length float [1.3, 1.4, 1.4, 1.4, 1.1, ...]
-  petal_width float [0.3, 0.2, 0.2, 0.1, 0.1, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+because "species" is a group.

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.arrange(grouped, desc: species, asc: sepal_width)
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  Groups: ["species"]
+  sepal_length float [4.5, 4.4, 4.9, 4.8, 4.3, ...]
+  sepal_width float [2.3, 2.9, 3.0, 3.0, 3.0, ...]
+  petal_length float [1.3, 1.4, 1.4, 1.4, 1.1, ...]
+  petal_width float [0.3, 0.2, 0.2, 0.1, 0.1, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -2042,42 +2042,42 @@

arrange_with(df, fun)

Examples

-

A single column name will sort ascending by that column:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
-iex> Explorer.DataFrame.arrange_with(df, &(&1["a"]))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["a", "b", "c"]
-  b integer [3, 1, 2]
->

You can also sort descending:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
-iex> Explorer.DataFrame.arrange_with(df, &[desc: &1["a"]])
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["c", "b", "a"]
-  b integer [2, 1, 3]
->

Sorting by more than one column sorts them in the order they are entered:

iex> df = Explorer.DataFrame.new(a: [3, 1, 3], b: [2, 1, 3])
-iex> Explorer.DataFrame.arrange_with(df, &[desc: &1["a"], asc: &1["b"]])
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [3, 3, 1]
-  b integer [2, 3, 1]
->

+

A single column name will sort ascending by that column:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
+iex> Explorer.DataFrame.arrange_with(df, &(&1["a"]))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["a", "b", "c"]
+  b integer [3, 1, 2]
+>

You can also sort descending:

iex> df = Explorer.DataFrame.new(a: ["b", "c", "a"], b: [1, 2, 3])
+iex> Explorer.DataFrame.arrange_with(df, &[desc: &1["a"]])
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["c", "b", "a"]
+  b integer [2, 1, 3]
+>

Sorting by more than one column sorts them in the order they are entered:

iex> df = Explorer.DataFrame.new(a: [3, 1, 3], b: [2, 1, 3])
+iex> Explorer.DataFrame.arrange_with(df, &[desc: &1["a"], asc: &1["b"]])
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [3, 3, 1]
+  b integer [2, 3, 1]
+>

Grouped examples

-
iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.arrange_with(grouped, &[desc: &1["species"], asc: &1["sepal_width"]])
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  Groups: ["species"]
-  sepal_length float [4.5, 4.4, 4.9, 4.8, 4.3, ...]
-  sepal_width float [2.3, 2.9, 3.0, 3.0, 3.0, ...]
-  petal_length float [1.3, 1.4, 1.4, 1.4, 1.1, ...]
-  petal_width float [0.3, 0.2, 0.2, 0.1, 0.1, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+
iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.arrange_with(grouped, &[desc: &1["species"], asc: &1["sepal_width"]])
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  Groups: ["species"]
+  sepal_length float [4.5, 4.4, 4.9, 4.8, 4.3, ...]
+  sepal_width float [2.3, 2.9, 3.0, 3.0, 3.0, ...]
+  petal_length float [1.3, 1.4, 1.4, 1.4, 1.1, ...]
+  petal_width float [0.3, 0.2, 0.2, 0.1, 0.1, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -2119,25 +2119,25 @@

describe(df, opts \\ [])

Examples -
iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [1, 2, 3], c: ["a", "b", "c"])
-iex> Explorer.DataFrame.describe(df)
-#Explorer.DataFrame<
-  Polars[9 x 4]
-  describe string ["count", "null_count", "mean", "std", "min", ...]
-  a string ["3", "1", nil, nil, "d", ...]
-  b float [3.0, 0.0, 2.0, 1.0, 1.0, ...]
-  c string ["3", "0", nil, nil, "a", ...]
->
-
-iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [1, 2, 3], c: ["a", "b", "c"])
-iex> Explorer.DataFrame.describe(df, percentiles: [0.3, 0.5, 0.8])
-#Explorer.DataFrame<
-  Polars[9 x 4]
-  describe string ["count", "null_count", "mean", "std", "min", ...]
-  a string ["3", "1", nil, nil, "d", ...]
-  b float [3.0, 0.0, 2.0, 1.0, 1.0, ...]
-  c string ["3", "0", nil, nil, "a", ...]
->
+
iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [1, 2, 3], c: ["a", "b", "c"])
+iex> Explorer.DataFrame.describe(df)
+#Explorer.DataFrame<
+  Polars[9 x 4]
+  describe string ["count", "null_count", "mean", "std", "min", ...]
+  a string ["3", "1", nil, nil, "d", ...]
+  b float [3.0, 0.0, 2.0, 1.0, 1.0, ...]
+  c string ["3", "0", nil, nil, "a", ...]
+>
+
+iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [1, 2, 3], c: ["a", "b", "c"])
+iex> Explorer.DataFrame.describe(df, percentiles: [0.3, 0.5, 0.8])
+#Explorer.DataFrame<
+  Polars[9 x 4]
+  describe string ["count", "null_count", "mean", "std", "min", ...]
+  a string ["3", "1", nil, nil, "d", ...]
+  b float [3.0, 0.0, 2.0, 1.0, 1.0, ...]
+  c string ["3", "0", nil, nil, "a", ...]
+>
@@ -2172,36 +2172,36 @@

discard(df, columns_or_column)

Examples -
iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.discard(df, ["b"])
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a string ["a", "b", "c"]
->
-
-iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
-iex> Explorer.DataFrame.discard(df, ["a", "b"])
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  c integer [4, 5, 6]
->

Ranges, regexes, and functions are also accepted in column names, as in select/2.

+
iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.discard(df, ["b"])
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a string ["a", "b", "c"]
+>
+
+iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
+iex> Explorer.DataFrame.discard(df, ["a", "b"])
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  c integer [4, 5, 6]
+>

Ranges, regexes, and functions are also accepted in column names, as in select/2.

Grouped examples

-

You cannot discard grouped columns. You need to ungroup before removing them:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.discard(grouped, ["species"])
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
-  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+

You cannot discard grouped columns. You need to ungroup before removing them:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.discard(grouped, ["species"])
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
+  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -2246,42 +2246,42 @@

distinct(df, columns \\ 0..-1//1, opts \\ [ Examples

-

By default will return unique values of the requested columns:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.distinct(df, ["year", "country"])
-#Explorer.DataFrame<
-  Polars[1094 x 2]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
->

If keep_all is set to true, then the first value of each column not in the requested -columns will be returned:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.distinct(df, ["year", "country"], keep_all: true)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

A callback on the dataframe's names can be passed instead of a list (like select/2):

iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: ["a", "c", "c"], y1: [1, 2, 3])
-iex> Explorer.DataFrame.distinct(df, &String.starts_with?(&1, "x"))
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  x1 integer [1, 3]
-  x2 string ["a", "c"]
->

If the dataframe has groups, then the columns of each group will be added to the distinct columns:

iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: ["a", "c", "c"], y1: [1, 2, 3])
-iex> df = Explorer.DataFrame.group_by(df, "x1")
-iex> Explorer.DataFrame.distinct(df, ["x2"])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  Groups: ["x1"]
-  x1 integer [1, 3]
-  x2 string ["a", "c"]
->
+

By default will return unique values of the requested columns:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.distinct(df, ["year", "country"])
+#Explorer.DataFrame<
+  Polars[1094 x 2]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+>

If keep_all is set to true, then the first value of each column not in the requested +columns will be returned:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.distinct(df, ["year", "country"], keep_all: true)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

A callback on the dataframe's names can be passed instead of a list (like select/2):

iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: ["a", "c", "c"], y1: [1, 2, 3])
+iex> Explorer.DataFrame.distinct(df, &String.starts_with?(&1, "x"))
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  x1 integer [1, 3]
+  x2 string ["a", "c"]
+>

If the dataframe has groups, then the columns of each group will be added to the distinct columns:

iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: ["a", "c", "c"], y1: [1, 2, 3])
+iex> df = Explorer.DataFrame.group_by(df, "x1")
+iex> Explorer.DataFrame.distinct(df, ["x2"])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  Groups: ["x1"]
+  x1 integer [1, 3]
+  x2 string ["a", "c"]
+>
@@ -2317,26 +2317,26 @@

drop_nil(df, columns_or_column \\ 0..-1//1) Examples

-

To drop nils on all columns:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])
-iex> Explorer.DataFrame.drop_nil(df)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  a integer [1]
-  b integer [1]
->

To drop nils on a single column:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])
-iex> Explorer.DataFrame.drop_nil(df, :a)
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a integer [1, 2]
-  b integer [1, nil]
->

To drop some columns:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3], c: [nil, 5, 6])
-iex> Explorer.DataFrame.drop_nil(df, [:a, :c])
-#Explorer.DataFrame<
-  Polars[1 x 3]
-  a integer [2]
-  b integer [nil]
-  c integer [5]
->

Ranges, regexes, and functions are also accepted in column names, as in select/2.

+

To drop nils on all columns:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])
+iex> Explorer.DataFrame.drop_nil(df)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  a integer [1]
+  b integer [1]
+>

To drop nils on a single column:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])
+iex> Explorer.DataFrame.drop_nil(df, :a)
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a integer [1, 2]
+  b integer [1, nil]
+>

To drop some columns:

iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3], c: [nil, 5, 6])
+iex> Explorer.DataFrame.drop_nil(df, [:a, :c])
+#Explorer.DataFrame<
+  Polars[1 x 3]
+  a integer [2]
+  b integer [nil]
+  c integer [5]
+>

Ranges, regexes, and functions are also accepted in column names, as in select/2.

@@ -2370,31 +2370,31 @@

dummies(df, columns_or_column)

Examples -

To mark a single column as dummy:

iex> df = Explorer.DataFrame.new(col_x: ["a", "b", "a", "c"], col_y: ["b", "a", "b", "d"])
-iex> Explorer.DataFrame.dummies(df, "col_x")
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  col_x_a integer [1, 0, 1, 0]
-  col_x_b integer [0, 1, 0, 0]
-  col_x_c integer [0, 0, 0, 1]
->

Or multiple columns:

iex> df = Explorer.DataFrame.new(col_x: ["a", "b", "a", "c"], col_y: ["b", "a", "b", "d"])
-iex> Explorer.DataFrame.dummies(df, ["col_x", "col_y"])
-#Explorer.DataFrame<
-  Polars[4 x 6]
-  col_x_a integer [1, 0, 1, 0]
-  col_x_b integer [0, 1, 0, 0]
-  col_x_c integer [0, 0, 0, 1]
-  col_y_b integer [1, 0, 1, 0]
-  col_y_a integer [0, 1, 0, 0]
-  col_y_d integer [0, 0, 0, 1]
->

Or all string columns:

iex> df = Explorer.DataFrame.new(num: [1, 2, 3, 4], col_y: ["b", "a", "b", "d"])
-iex> Explorer.DataFrame.dummies(df, fn _name, type -> type == :string end)
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  col_y_b integer [1, 0, 1, 0]
-  col_y_a integer [0, 1, 0, 0]
-  col_y_d integer [0, 0, 0, 1]
->

Ranges, regexes, and functions are also accepted in column names, as in select/2.

+

To mark a single column as dummy:

iex> df = Explorer.DataFrame.new(col_x: ["a", "b", "a", "c"], col_y: ["b", "a", "b", "d"])
+iex> Explorer.DataFrame.dummies(df, "col_x")
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  col_x_a integer [1, 0, 1, 0]
+  col_x_b integer [0, 1, 0, 0]
+  col_x_c integer [0, 0, 0, 1]
+>

Or multiple columns:

iex> df = Explorer.DataFrame.new(col_x: ["a", "b", "a", "c"], col_y: ["b", "a", "b", "d"])
+iex> Explorer.DataFrame.dummies(df, ["col_x", "col_y"])
+#Explorer.DataFrame<
+  Polars[4 x 6]
+  col_x_a integer [1, 0, 1, 0]
+  col_x_b integer [0, 1, 0, 0]
+  col_x_c integer [0, 0, 0, 1]
+  col_y_b integer [1, 0, 1, 0]
+  col_y_a integer [0, 1, 0, 0]
+  col_y_d integer [0, 0, 0, 1]
+>

Or all string columns:

iex> df = Explorer.DataFrame.new(num: [1, 2, 3, 4], col_y: ["b", "a", "b", "d"])
+iex> Explorer.DataFrame.dummies(df, fn _name, type -> type == :string end)
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  col_y_b integer [1, 0, 1, 0]
+  col_y_a integer [0, 1, 0, 0]
+  col_y_d integer [0, 0, 0, 1]
+>

Ranges, regexes, and functions are also accepted in column names, as in select/2.

@@ -2430,55 +2430,55 @@

filter(df, query)

Examples -
iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, col2 > 2)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["c"]
-  col2 integer [3]
->
-
-iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, col1 == "b")
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["b"]
-  col2 integer [2]
->
-
-iex> df = Explorer.DataFrame.new(col1: [5, 4, 3], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, [col1 > 3, col2 < 3])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  col1 integer [5, 4]
-  col2 integer [1, 2]
->

Returning a non-boolean expression errors:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, cumulative_max(col2))
-** (ArgumentError) expecting the function to return a boolean LazySeries, but instead it returned a LazySeries of type :integer

Which can be addressed by converting it to boolean:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, cumulative_max(col2) == 1)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["a"]
-  col2 integer [1]
->

+
iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, col2 > 2)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["c"]
+  col2 integer [3]
+>
+
+iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, col1 == "b")
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["b"]
+  col2 integer [2]
+>
+
+iex> df = Explorer.DataFrame.new(col1: [5, 4, 3], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, [col1 > 3, col2 < 3])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  col1 integer [5, 4]
+  col2 integer [1, 2]
+>

Returning a non-boolean expression errors:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, cumulative_max(col2))
+** (ArgumentError) expecting the function to return a boolean LazySeries, but instead it returned a LazySeries of type :integer

Which can be addressed by converting it to boolean:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, cumulative_max(col2) == 1)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["a"]
+  col2 integer [1]
+>

Grouped examples

In a grouped dataframe, the aggregation is calculated within each group.

In the following example we select the flowers of the Iris dataset that have the "petal length" -above the average of each species group.

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.filter(grouped, petal_length > mean(petal_length))
-#Explorer.DataFrame<
-  Polars[79 x 5]
-  Groups: ["species"]
-  sepal_length float [4.6, 5.4, 5.0, 4.9, 5.4, ...]
-  sepal_width float [3.1, 3.9, 3.4, 3.1, 3.7, ...]
-  petal_length float [1.5, 1.7, 1.5, 1.5, 1.5, ...]
-  petal_width float [0.2, 0.4, 0.2, 0.1, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+above the average of each species group.

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.filter(grouped, petal_length > mean(petal_length))
+#Explorer.DataFrame<
+  Polars[79 x 5]
+  Groups: ["species"]
+  sepal_length float [4.6, 5.4, 5.0, 4.9, 5.4, ...]
+  sepal_width float [3.1, 3.9, 3.4, 3.1, 3.7, ...]
+  petal_length float [1.5, 1.7, 1.5, 1.5, 1.5, ...]
+  petal_width float [0.2, 0.4, 0.2, 0.1, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -2517,39 +2517,39 @@

filter_with(df, fun)

Examples -
iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1["col2"], 2))
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["c"]
-  col2 integer [3]
->
-
-iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.equal(df["col1"], "b") end)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["b"]
-  col2 integer [2]
->

+
iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1["col2"], 2))
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["c"]
+  col2 integer [3]
+>
+
+iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.equal(df["col1"], "b") end)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["b"]
+  col2 integer [2]
+>

Grouped examples

In a grouped dataframe, the aggregation is calculated within each group.

In the following example we select the flowers of the Iris dataset that have the "petal length" -above the average of each species group.

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.filter_with(grouped, &Explorer.Series.greater(&1["petal_length"], Explorer.Series.mean(&1["petal_length"])))
-#Explorer.DataFrame<
-  Polars[79 x 5]
-  Groups: ["species"]
-  sepal_length float [4.6, 5.4, 5.0, 4.9, 5.4, ...]
-  sepal_width float [3.1, 3.9, 3.4, 3.1, 3.7, ...]
-  petal_length float [1.5, 1.7, 1.5, 1.5, 1.5, ...]
-  petal_width float [0.2, 0.4, 0.2, 0.1, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+above the average of each species group.

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.filter_with(grouped, &Explorer.Series.greater(&1["petal_length"], Explorer.Series.mean(&1["petal_length"])))
+#Explorer.DataFrame<
+  Polars[79 x 5]
+  Groups: ["species"]
+  sepal_length float [4.6, 5.4, 5.0, 4.9, 5.4, ...]
+  sepal_width float [3.1, 3.9, 3.4, 3.1, 3.7, ...]
+  petal_length float [1.5, 1.7, 1.5, 1.5, 1.5, ...]
+  petal_width float [0.2, 0.4, 0.2, 0.1, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -2583,14 +2583,14 @@

frequencies(df, columns)

Examples -
iex> df = Explorer.DataFrame.new(a: ["a", "a", "b"], b: [1, 1, nil])
-iex> Explorer.DataFrame.frequencies(df, [:a, :b])
-#Explorer.DataFrame<
-  Polars[2 x 3]
-  a string ["a", "b"]
-  b integer [1, nil]
-  counts integer [2, 1]
->
+
iex> df = Explorer.DataFrame.new(a: ["a", "a", "b"], b: [1, 1, nil])
+iex> Explorer.DataFrame.frequencies(df, [:a, :b])
+#Explorer.DataFrame<
+  Polars[2 x 3]
+  a string ["a", "b"]
+  b integer [1, nil]
+  counts integer [2, 1]
+>
@@ -2625,52 +2625,52 @@

group_by(df, group)

Examples -

You can group by a single variable:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.group_by(df, "country")
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  Groups: ["country"]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Or you can group by multiple columns in a given list:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.group_by(df, ["country", "year"])
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  Groups: ["country", "year"]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Or by a range:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.group_by(df, 0..1)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  Groups: ["year", "country"]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Regexes and functions are also accepted in column names, as in select/2.

+

You can group by a single variable:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.group_by(df, "country")
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  Groups: ["country"]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Or you can group by multiple columns in a given list:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.group_by(df, ["country", "year"])
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  Groups: ["country", "year"]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Or by a range:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.group_by(df, 0..1)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  Groups: ["year", "country"]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Regexes and functions are also accepted in column names, as in select/2.

@@ -2706,26 +2706,26 @@

mask(df, mask)

This function must only be used when you need to select rows based on external values that are not available to the dataframe. For example, -you can pass a list:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.mask(df, [false, true, false])
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  col1 string ["b"]
-  col2 integer [2]
->

You must avoid using masks when the masks themselves are computed from -other columns. For example, DO NOT do this:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.mask(df, Explorer.Series.greater(df["col2"], 1))
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  col1 string ["b", "c"]
-  col2 integer [2, 3]
->

Instead, do this:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
-iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df["col2"], 1) end)
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  col1 string ["b", "c"]
-  col2 integer [2, 3]
->

The filter_with/2 version is much more efficient because it doesn't need +you can pass a list:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.mask(df, [false, true, false])
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  col1 string ["b"]
+  col2 integer [2]
+>

You must avoid using masks when the masks themselves are computed from +other columns. For example, DO NOT do this:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.mask(df, Explorer.Series.greater(df["col2"], 1))
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  col1 string ["b", "c"]
+  col2 integer [2, 3]
+>

Instead, do this:

iex> df = Explorer.DataFrame.new(col1: ["a", "b", "c"], col2: [1, 2, 3])
+iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df["col2"], 1) end)
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  col1 string ["b", "c"]
+  col2 integer [2, 3]
+>

The filter_with/2 version is much more efficient because it doesn't need to create intermediate series representations to apply the mask.

@@ -2764,39 +2764,39 @@

mutate(df, mutations)

Examples -

Mutations are useful to add or modify columns in your dataframe:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate(df, c: b + 1)
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a string ["a", "b", "c"]
-  b integer [1, 2, 3]
-  c integer [2, 3, 4]
->

It's also possible to overwrite existing columns:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate(df, a: b * 2)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [2, 4, 6]
-  b integer [1, 2, 3]
->

Scalar values are repeated to fill the series:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate(df, a: 4)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [4, 4, 4]
-  b integer [1, 2, 3]
->

It's also possible to use functions from the Series module, like Explorer.Series.window_sum/3:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.mutate(df, b: window_sum(a, 2))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [1, 2, 3]
-  b integer [1, 3, 5]
->

Alternatively, all of the above works with a map instead of a keyword list:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate(df, %{"c" => cast(b, :float)})
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a string ["a", "b", "c"]
-  b integer [1, 2, 3]
-  c float [1.0, 2.0, 3.0]
->

+

Mutations are useful to add or modify columns in your dataframe:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate(df, c: b + 1)
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a string ["a", "b", "c"]
+  b integer [1, 2, 3]
+  c integer [2, 3, 4]
+>

It's also possible to overwrite existing columns:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate(df, a: b * 2)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [2, 4, 6]
+  b integer [1, 2, 3]
+>

Scalar values are repeated to fill the series:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate(df, a: 4)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [4, 4, 4]
+  b integer [1, 2, 3]
+>

It's also possible to use functions from the Series module, like Explorer.Series.window_sum/3:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
+iex> Explorer.DataFrame.mutate(df, b: window_sum(a, 2))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [1, 2, 3]
+  b integer [1, 3, 5]
+>

Alternatively, all of the above works with a map instead of a keyword list:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate(df, %{"c" => cast(b, :float)})
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a string ["a", "b", "c"]
+  b integer [1, 2, 3]
+  c float [1.0, 2.0, 3.0]
+>

Grouped examples @@ -2806,28 +2806,28 @@

mutate(df, mutations)

This enables some aggregations to be made considering each group. It's almost like
summarise/2, but repeating the results for each member in the group. For example, if we want to count how many elements of a given group, we can add a new -column with that aggregation:

iex> df = Explorer.DataFrame.new(id: ["a", "a", "b"], b: [1, 2, 3])
-iex> grouped = Explorer.DataFrame.group_by(df, :id)
-iex> Explorer.DataFrame.mutate(grouped, count: count(b))
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  Groups: ["id"]
-  id string ["a", "a", "b"]
-  b integer [1, 2, 3]
-  count integer [2, 2, 1]
->

In case we want to get the average size of the petal length from the Iris dataset, we can:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.mutate(grouped, petal_length_avg: mean(petal_length))
-#Explorer.DataFrame<
-  Polars[150 x 6]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
-  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
-  petal_length_avg float [1.4640000000000004, 1.4640000000000004, 1.4640000000000004, 1.4640000000000004, 1.4640000000000004, ...]
->
+column with that aggregation:

iex> df = Explorer.DataFrame.new(id: ["a", "a", "b"], b: [1, 2, 3])
+iex> grouped = Explorer.DataFrame.group_by(df, :id)
+iex> Explorer.DataFrame.mutate(grouped, count: count(b))
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  Groups: ["id"]
+  id string ["a", "a", "b"]
+  b integer [1, 2, 3]
+  count integer [2, 2, 1]
+>

In case we want to get the average size of the petal length from the Iris dataset, we can:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.mutate(grouped, petal_length_avg: mean(petal_length))
+#Explorer.DataFrame<
+  Polars[150 x 6]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
+  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+  petal_length_avg float [1.4640000000000004, 1.4640000000000004, 1.4640000000000004, 1.4640000000000004, 1.4640000000000004, ...]
+>
@@ -2870,31 +2870,31 @@

mutate_with(df, fun)

Examples

-

Here is an example of a new column that sums the value of two other columns:

iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate_with(df, &[c: Explorer.Series.add(&1["a"], &1["b"])])
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a integer [4, 5, 6]
-  b integer [1, 2, 3]
-  c integer [5, 7, 9]
->

You can overwrite existing columns as well:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate_with(df, &[b: Explorer.Series.pow(&1["b"], 2)])
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["a", "b", "c"]
-  b float [1.0, 4.0, 9.0]
->

It's possible to "reuse" a variable for different computations:

iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])
-iex> Explorer.DataFrame.mutate_with(df, fn ldf ->
-iex>   c = Explorer.Series.add(ldf["a"], ldf["b"])
-iex>   [c: c, d: Explorer.Series.window_sum(c, 2)]
-iex> end)
-#Explorer.DataFrame<
-  Polars[3 x 4]
-  a integer [4, 5, 6]
-  b integer [1, 2, 3]
-  c integer [5, 7, 9]
-  d integer [5, 12, 16]
->

+

Here is an example of a new column that sums the value of two other columns:

iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate_with(df, &[c: Explorer.Series.add(&1["a"], &1["b"])])
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a integer [4, 5, 6]
+  b integer [1, 2, 3]
+  c integer [5, 7, 9]
+>

You can overwrite existing columns as well:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate_with(df, &[b: Explorer.Series.pow(&1["b"], 2)])
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["a", "b", "c"]
+  b float [1.0, 4.0, 9.0]
+>

It's possible to "reuse" a variable for different computations:

iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])
+iex> Explorer.DataFrame.mutate_with(df, fn ldf ->
+iex>   c = Explorer.Series.add(ldf["a"], ldf["b"])
+iex>   [c: c, d: Explorer.Series.window_sum(c, 2)]
+iex> end)
+#Explorer.DataFrame<
+  Polars[3 x 4]
+  a integer [4, 5, 6]
+  b integer [1, 2, 3]
+  c integer [5, 7, 9]
+  d integer [5, 12, 16]
+>

Grouped examples @@ -2902,16 +2902,16 @@

mutate_with(df, fun)

Mutations in grouped dataframes takes the context of the group. For example, if we want to count how many elements of a given group, -we can add a new column with that aggregation:

iex> df = Explorer.DataFrame.new(id: ["a", "a", "b"], b: [1, 2, 3])
-iex> grouped = Explorer.DataFrame.group_by(df, :id)
-iex> Explorer.DataFrame.mutate_with(grouped, &[count: Explorer.Series.count(&1["b"])])
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  Groups: ["id"]
-  id string ["a", "a", "b"]
-  b integer [1, 2, 3]
-  count integer [2, 2, 1]
->
+we can add a new column with that aggregation:

iex> df = Explorer.DataFrame.new(id: ["a", "a", "b"], b: [1, 2, 3])
+iex> grouped = Explorer.DataFrame.group_by(df, :id)
+iex> Explorer.DataFrame.mutate_with(grouped, &[count: Explorer.Series.count(&1["b"])])
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  Groups: ["id"]
+  id string ["a", "a", "b"]
+  b integer [1, 2, 3]
+  count integer [2, 2, 1]
+>
@@ -2945,14 +2945,14 @@

nil_count(df)

Examples
-
iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [nil, 2, nil], c: ["a", "b", "c"])
-iex> Explorer.DataFrame.nil_count(df)
-#Explorer.DataFrame<
-  Polars[1 x 3]
-  a integer [1]
-  b integer [2]
-  c integer [0]
->
+
iex> df = Explorer.DataFrame.new(a: ["d", nil, "f"], b: [nil, 2, nil], c: ["a", "b", "c"])
+iex> Explorer.DataFrame.nil_count(df)
+#Explorer.DataFrame<
+  Polars[1 x 3]
+  a integer [1]
+  b integer [2]
+  c integer [0]
+>
@@ -3009,47 +3009,47 @@

pivot_longer(df, columns_to_pivot, opts \\ Examples

-
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, "fuel"))
-#Explorer.DataFrame<
-  Polars[3282 x 9]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
-  variable string ["solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", ...]
-  value integer [627, 117, 332, 0, 0, ...]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, "fuel"), select: ["year", "country"])
-#Explorer.DataFrame<
-  Polars[3282 x 4]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  variable string ["solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", ...]
-  value integer [627, 117, 332, 0, 0, ...]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pivot_longer(df, ["total"], select: ["year", "country"], discard: ["country"])
-#Explorer.DataFrame<
-  Polars[1094 x 3]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  variable string ["total", "total", "total", "total", "total", ...]
-  value integer [2308, 1254, 32500, 141, 7924, ...]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pivot_longer(df, ["total"], select: [], names_to: "my_var", values_to: "my_value")
-#Explorer.DataFrame<
-  Polars[1094 x 2]
-  my_var string ["total", "total", "total", "total", "total", ...]
-  my_value integer [2308, 1254, 32500, 141, 7924, ...]
->

+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, "fuel"))
+#Explorer.DataFrame<
+  Polars[3282 x 9]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+  variable string ["solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", ...]
+  value integer [627, 117, 332, 0, 0, ...]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, "fuel"), select: ["year", "country"])
+#Explorer.DataFrame<
+  Polars[3282 x 4]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  variable string ["solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", "solid_fuel", ...]
+  value integer [627, 117, 332, 0, 0, ...]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pivot_longer(df, ["total"], select: ["year", "country"], discard: ["country"])
+#Explorer.DataFrame<
+  Polars[1094 x 3]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  variable string ["total", "total", "total", "total", "total", ...]
+  value integer [2308, 1254, 32500, 141, 7924, ...]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pivot_longer(df, ["total"], select: [], names_to: "my_var", values_to: "my_value")
+#Explorer.DataFrame<
+  Polars[1094 x 2]
+  my_var string ["total", "total", "total", "total", "total", ...]
+  my_value integer [2308, 1254, 32500, 141, 7924, ...]
+>

Grouped examples @@ -3057,31 +3057,31 @@

pivot_longer(df, columns_to_pivot, opts \\

In the following example we want to take the Iris dataset and increase the number of rows by pivoting the "sepal_length" column. This dataset is grouped by "species", so the resultant -dataframe is going to keep the "species" group:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.pivot_longer(grouped, ["sepal_length"])
-#Explorer.DataFrame<
-  Polars[150 x 6]
-  Groups: ["species"]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
-  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
-  variable string ["sepal_length", "sepal_length", "sepal_length", "sepal_length", "sepal_length", ...]
-  value float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
->

Now we want to do something different: we want to pivot the "species" column that is also a group. -This is going to remove the group in the resultant dataframe:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.pivot_longer(grouped, ["species"])
-#Explorer.DataFrame<
-  Polars[150 x 6]
-  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
-  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
-  variable string ["species", "species", "species", "species", "species", ...]
-  value string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+dataframe is going to keep the "species" group:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.pivot_longer(grouped, ["sepal_length"])
+#Explorer.DataFrame<
+  Polars[150 x 6]
+  Groups: ["species"]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
+  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+  variable string ["sepal_length", "sepal_length", "sepal_length", "sepal_length", "sepal_length", ...]
+  value float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
+>

Now we want to do something different: we want to pivot the "species" column that is also a group. +This is going to remove the group in the resultant dataframe:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.pivot_longer(grouped, ["species"])
+#Explorer.DataFrame<
+  Polars[150 x 6]
+  sepal_length float [5.1, 4.9, 4.7, 4.6, 5.0, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  petal_length float [1.4, 1.4, 1.3, 1.5, 1.4, ...]
+  petal_width float [0.2, 0.2, 0.2, 0.2, 0.2, ...]
+  variable string ["species", "species", "species", "species", "species", ...]
+  value string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>

@@ -3140,12 +3140,12 @@

pivot_wider(df, names_from, values_from, op

Suppose we have a basketball court and multiple teams that want to train in that court. They need to share a schedule with the hours each team is going to use it. Here is a dataframe representing -that schedule:

iex> Explorer.DataFrame.new(
-iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
-iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
-iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
-iex> )

This dataframe is going to look like this - using table/2:

  +----------------------------------------------+
-  |  Explorer DataFrame: [rows: 10, columns: 3]  |
+that schedule:

iex> Explorer.DataFrame.new(
+iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
+iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
+iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
+iex> )

This dataframe is going to look like this - using table/2:

  +----------------------------------------------+
+  |  Explorer DataFrame: [rows: 10, columns: 3]  |
   +---------------+--------------+---------------+
   |    weekday    |     team     |     hour      |
   |   <string>    |   <string>   |   <integer>   |
@@ -3171,22 +3171,22 @@ 

pivot_wider(df, names_from, values_from, op | Friday | A | 16 | +---------------+--------------+---------------+

You can see that the "weekday" repeats, and it's not clear how free the agenda is. We can solve that by pivoting the "weekday" column in multiple columns, making each weekday -a new column in the resultant dataframe.

iex> df = Explorer.DataFrame.new(
-iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
-iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
-iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
-iex> )
-iex> Explorer.DataFrame.pivot_wider(df, "weekday", "hour")
-#Explorer.DataFrame<
-  Polars[3 x 6]
-  team string ["A", "B", "C"]
-  Monday integer [10, nil, 15]
-  Tuesday integer [14, 9, nil]
-  Wednesday integer [nil, 16, 10]
-  Thursday integer [10, nil, 14]
-  Friday integer [16, 11, nil]
->

Now if we print that same dataframe with table/2, we get a better picture of the schedule:

  +----------------------------------------------------------------------+
-  |              Explorer DataFrame: [rows: 3, columns: 6]               |
+a new column in the resultant dataframe.

iex> df = Explorer.DataFrame.new(
+iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
+iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
+iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
+iex> )
+iex> Explorer.DataFrame.pivot_wider(df, "weekday", "hour")
+#Explorer.DataFrame<
+  Polars[3 x 6]
+  team string ["A", "B", "C"]
+  Monday integer [10, nil, 15]
+  Tuesday integer [14, 9, nil]
+  Wednesday integer [nil, 16, 10]
+  Thursday integer [10, nil, 14]
+  Friday integer [16, 11, nil]
+>

Now if we print that same dataframe with table/2, we get a better picture of the schedule:

  +----------------------------------------------------------------------+
+  |              Explorer DataFrame: [rows: 3, columns: 6]               |
   +----------+-----------+-----------+-----------+-----------+-----------+
   |   team   |  Monday   |  Tuesday  | Wednesday | Thursday  |  Friday   |
   | <string> | <integer> | <integer> | <integer> | <integer> | <integer> |
@@ -3197,93 +3197,93 @@ 

pivot_wider(df, names_from, values_from, op +----------+-----------+-----------+-----------+-----------+-----------+ | C | 15 | | 10 | 14 | | +----------+-----------+-----------+-----------+-----------+-----------+

Pivot wider can create unpredictable column names, and sometimes they can conflict with ID columns. -In that scenario, we add a number as suffix to duplicated column names. Here is an example:

iex> df = Explorer.DataFrame.new(
-iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
-iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
-iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40]
-iex> )
-iex> Explorer.DataFrame.pivot_wider(df, "property", "property_value")
-#Explorer.DataFrame<
-  Polars[2 x 5]
-  product_id integer [1, 2]
-  product_id_1 integer [1, 2]
-  width_cm integer [42, 35]
-  height_cm integer [40, 20]
-  length_cm integer [64, 40]
->

But if the option :names_prefix is used, that suffix is not added:

iex> df = Explorer.DataFrame.new(
-iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
-iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
-iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40]
-iex> )
-iex> Explorer.DataFrame.pivot_wider(df, "property", "property_value", names_prefix: "col_")
-#Explorer.DataFrame<
-  Polars[2 x 5]
-  product_id integer [1, 2]
-  col_product_id integer [1, 2]
-  col_width_cm integer [42, 35]
-  col_height_cm integer [40, 20]
-  col_length_cm integer [64, 40]
->

Multiple columns are accepted for the values_from parameter, but the behaviour is slightly +In that scenario, we add a number as suffix to duplicated column names. Here is an example:

iex> df = Explorer.DataFrame.new(
+iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
+iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
+iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40]
+iex> )
+iex> Explorer.DataFrame.pivot_wider(df, "property", "property_value")
+#Explorer.DataFrame<
+  Polars[2 x 5]
+  product_id integer [1, 2]
+  product_id_1 integer [1, 2]
+  width_cm integer [42, 35]
+  height_cm integer [40, 20]
+  length_cm integer [64, 40]
+>

But if the option :names_prefix is used, that suffix is not added:

iex> df = Explorer.DataFrame.new(
+iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
+iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
+iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40]
+iex> )
+iex> Explorer.DataFrame.pivot_wider(df, "property", "property_value", names_prefix: "col_")
+#Explorer.DataFrame<
+  Polars[2 x 5]
+  product_id integer [1, 2]
+  col_product_id integer [1, 2]
+  col_width_cm integer [42, 35]
+  col_height_cm integer [40, 20]
+  col_length_cm integer [64, 40]
+>

Multiple columns are accepted for the values_from parameter, but the behaviour is slightly different for the naming of new columns in the resultant dataframe. The new columns are going to be prefixed by the name of the original value column, followed by an underscore and the -original column name, followed by the name of the variable.

iex> df = Explorer.DataFrame.new(
-iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
-iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
-iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40],
-iex>   another_value: [1, 43, 41, 65, 2, 36, 21, 42]
-iex> )
-iex> Explorer.DataFrame.pivot_wider(df, "property", ["property_value", "another_value"])
-#Explorer.DataFrame<
-  Polars[2 x 9]
-  product_id integer [1, 2]
-  property_value_property_product_id integer [1, 2]
-  property_value_property_width_cm integer [42, 35]
-  property_value_property_height_cm integer [40, 20]
-  property_value_property_length_cm integer [64, 40]
-  another_value_property_product_id integer [1, 2]
-  another_value_property_width_cm integer [43, 36]
-  another_value_property_height_cm integer [41, 21]
-  another_value_property_length_cm integer [65, 42]
->

+original column name, followed by the name of the variable.

iex> df = Explorer.DataFrame.new(
+iex>   product_id: [1, 1, 1, 1, 2, 2, 2, 2],
+iex>   property: ["product_id", "width_cm", "height_cm", "length_cm", "product_id", "width_cm", "height_cm", "length_cm"],
+iex>   property_value: [1, 42, 40, 64, 2, 35, 20, 40],
+iex>   another_value: [1, 43, 41, 65, 2, 36, 21, 42]
+iex> )
+iex> Explorer.DataFrame.pivot_wider(df, "property", ["property_value", "another_value"])
+#Explorer.DataFrame<
+  Polars[2 x 9]
+  product_id integer [1, 2]
+  property_value_property_product_id integer [1, 2]
+  property_value_property_width_cm integer [42, 35]
+  property_value_property_height_cm integer [40, 20]
+  property_value_property_length_cm integer [64, 40]
+  another_value_property_product_id integer [1, 2]
+  another_value_property_width_cm integer [43, 36]
+  another_value_property_height_cm integer [41, 21]
+  another_value_property_length_cm integer [65, 42]
+>

Grouped examples

Now using the same idea, we can see that there is not much difference for grouped dataframes. -The only detail is that groups that are not ID columns are discarded.

iex> df = Explorer.DataFrame.new(
-iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
-iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
-iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
-iex> )
-iex> grouped = Explorer.DataFrame.group_by(df, "team")
-iex> Explorer.DataFrame.pivot_wider(grouped, "weekday", "hour")
-#Explorer.DataFrame<
-  Polars[3 x 6]
-  Groups: ["team"]
-  team string ["A", "B", "C"]
-  Monday integer [10, nil, 15]
-  Tuesday integer [14, 9, nil]
-  Wednesday integer [nil, 16, 10]
-  Thursday integer [10, nil, 14]
-  Friday integer [16, 11, nil]
->

In the following example the group "weekday" is going to be removed, because the column is going -to be pivoted in multiple columns:

iex> df = Explorer.DataFrame.new(
-iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
-iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
-iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
-iex> )
-iex> grouped = Explorer.DataFrame.group_by(df, "weekday")
-iex> Explorer.DataFrame.pivot_wider(grouped, "weekday", "hour")
-#Explorer.DataFrame<
-  Polars[3 x 6]
-  team string ["A", "B", "C"]
-  Monday integer [10, nil, 15]
-  Tuesday integer [14, 9, nil]
-  Wednesday integer [nil, 16, 10]
-  Thursday integer [10, nil, 14]
-  Friday integer [16, 11, nil]
->
+The only detail is that groups that are not ID columns are discarded.

iex> df = Explorer.DataFrame.new(
+iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
+iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
+iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
+iex> )
+iex> grouped = Explorer.DataFrame.group_by(df, "team")
+iex> Explorer.DataFrame.pivot_wider(grouped, "weekday", "hour")
+#Explorer.DataFrame<
+  Polars[3 x 6]
+  Groups: ["team"]
+  team string ["A", "B", "C"]
+  Monday integer [10, nil, 15]
+  Tuesday integer [14, 9, nil]
+  Wednesday integer [nil, 16, 10]
+  Thursday integer [10, nil, 14]
+  Friday integer [16, 11, nil]
+>

In the following example the group "weekday" is going to be removed, because the column is going +to be pivoted in multiple columns:

iex> df = Explorer.DataFrame.new(
+iex>   weekday: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
+iex>   team: ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"],
+iex>   hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]
+iex> )
+iex> grouped = Explorer.DataFrame.group_by(df, "weekday")
+iex> Explorer.DataFrame.pivot_wider(grouped, "weekday", "hour")
+#Explorer.DataFrame<
+  Polars[3 x 6]
+  team string ["A", "B", "C"]
+  Monday integer [10, nil, 15]
+  Tuesday integer [14, 9, nil]
+  Wednesday integer [nil, 16, 10]
+  Thursday integer [10, nil, 14]
+  Friday integer [16, 11, nil]
+>
@@ -3318,19 +3318,19 @@

pull(df, column)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pull(df, "total")
-#Explorer.Series<
-  Polars[1094]
-  integer [2308, 1254, 32500, 141, 7924, 41, 143, 51246, 1150, 684, 106589, 18408, 8366, 451, 7981, 16345, 403, 17192, 30222, 147, 1388, 166, 133, 5802, 1278, 114468, 47, 2237, 12030, 535, 58, 1367, 145806, 152, 152, 72, 141, 19703, 2393248, 20773, 44, 540, 19, 2064, 1900, 5501, 10465, 2102, 30428, 18122, ...]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.pull(df, 2)
-#Explorer.Series<
-  Polars[1094]
-  integer [2308, 1254, 32500, 141, 7924, 41, 143, 51246, 1150, 684, 106589, 18408, 8366, 451, 7981, 16345, 403, 17192, 30222, 147, 1388, 166, 133, 5802, 1278, 114468, 47, 2237, 12030, 535, 58, 1367, 145806, 152, 152, 72, 141, 19703, 2393248, 20773, 44, 540, 19, 2064, 1900, 5501, 10465, 2102, 30428, 18122, ...]
->
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pull(df, "total")
+#Explorer.Series<
+  Polars[1094]
+  integer [2308, 1254, 32500, 141, 7924, 41, 143, 51246, 1150, 684, 106589, 18408, 8366, 451, 7981, 16345, 403, 17192, 30222, 147, 1388, 166, 133, 5802, 1278, 114468, 47, 2237, 12030, 535, 58, 1367, 145806, 152, 152, 72, 141, 19703, 2393248, 20773, 44, 540, 19, 2064, 1900, 5501, 10465, 2102, 30428, 18122, ...]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.pull(df, 2)
+#Explorer.Series<
+  Polars[1094]
+  integer [2308, 1254, 32500, 141, 7924, 41, 143, 51246, 1150, 684, 106589, 18408, 8366, 451, 7981, 16345, 403, 17192, 30222, 147, 1388, 166, 133, 5802, 1278, 114468, 47, 2237, 12030, 535, 58, 1367, 145806, 152, 152, 72, 141, 19703, 2393248, 20773, 44, 540, 19, 2064, 1900, 5501, 10465, 2102, 30428, 18122, ...]
+>
@@ -3368,99 +3368,99 @@

put(df, column_name, series_or_tensor_or_li Examples

-
iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.put(df, :b, Explorer.Series.transform(df[:a], fn n -> n * 2 end))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [1, 2, 3]
-  b integer [2, 4, 6]
->
-
-iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.put(df, :b, Explorer.Series.from_list([4, 5, 6]))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a integer [1, 2, 3]
-  b integer [4, 5, 6]
->

+
iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
+iex> Explorer.DataFrame.put(df, :b, Explorer.Series.transform(df[:a], fn n -> n * 2 end))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [1, 2, 3]
+  b integer [2, 4, 6]
+>
+
+iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
+iex> Explorer.DataFrame.put(df, :b, Explorer.Series.from_list([4, 5, 6]))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a integer [1, 2, 3]
+  b integer [4, 5, 6]
+>

Grouped examples

If the dataframe is grouped, put/3 is going to ignore the groups. -So the series must be of the same size of the entire dataframe.

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> grouped = Explorer.DataFrame.group_by(df, "a")
-iex> series = Explorer.Series.from_list([9, 8, 7])
-iex> Explorer.DataFrame.put(grouped, :b, series)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  Groups: ["a"]
-  a integer [1, 2, 3]
-  b integer [9, 8, 7]
->

+So the series must be of the same size of the entire dataframe.

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
+iex> grouped = Explorer.DataFrame.group_by(df, "a")
+iex> series = Explorer.Series.from_list([9, 8, 7])
+iex> Explorer.DataFrame.put(grouped, :b, series)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  Groups: ["a"]
+  a integer [1, 2, 3]
+  b integer [9, 8, 7]
+>

Tensor examples

-

You can also put tensors into the dataframe:

iex> df = Explorer.DataFrame.new([])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]))
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a integer [1, 2, 3]
->

You can specify which dtype the tensor represents. +

You can also put tensors into the dataframe:

iex> df = Explorer.DataFrame.new([])
+iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]))
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a integer [1, 2, 3]
+>

You can specify which dtype the tensor represents. For example, a tensor of s64 represents integers by default, but it may also represent timestamps -in microseconds from the Unix epoch:

iex> df = Explorer.DataFrame.new([])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]), dtype: {:datetime, :microsecond})
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a datetime[Ī¼s] [1970-01-01 00:00:00.000001, 1970-01-01 00:00:00.000002, 1970-01-01 00:00:00.000003]
->

If there is already a column where we want to place the tensor, +in microseconds from the Unix epoch:

iex> df = Explorer.DataFrame.new([])
+iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]), dtype: {:datetime, :microsecond})
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a datetime[Ī¼s] [1970-01-01 00:00:00.000001, 1970-01-01 00:00:00.000002, 1970-01-01 00:00:00.000003]
+>

If there is already a column where we want to place the tensor, the column dtype will be automatically used, this means that updating dataframes in place while preserving their types is -straight-forward:

iex> df = Explorer.DataFrame.new(a: [~N[1970-01-01 00:00:00]])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor(529550625987654))
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  a datetime[Ī¼s] [1986-10-13 01:23:45.987654]
->

This is particularly useful for categorical columns:

iex> cat = Explorer.Series.from_list(["foo", "bar", "baz"], dtype: :category)
-iex> df = Explorer.DataFrame.new(a: cat)
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor([2, 1, 0]))
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a category ["baz", "bar", "foo"]
->

On the other hand, if you try to put a floating tensor on +straight-forward:

iex> df = Explorer.DataFrame.new(a: [~N[1970-01-01 00:00:00]])
+iex> Explorer.DataFrame.put(df, :a, Nx.tensor(529550625987654))
+#Explorer.DataFrame<
+  Polars[1 x 1]
+  a datetime[Ī¼s] [1986-10-13 01:23:45.987654]
+>

This is particularly useful for categorical columns:

iex> cat = Explorer.Series.from_list(["foo", "bar", "baz"], dtype: :category)
+iex> df = Explorer.DataFrame.new(a: cat)
+iex> Explorer.DataFrame.put(df, :a, Nx.tensor([2, 1, 0]))
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a category ["baz", "bar", "foo"]
+>

On the other hand, if you try to put a floating tensor on an integer column, an error will be raised unless a dtype -or dtype: :infer is given:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64))
+or dtype: :infer is given:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
+iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64))
 ** (ArgumentError) dtype integer expects a tensor of type {:s, 64} but got type {:f, 64}
 
-iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :float)
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a float [1.0, 1.0, 1.0]
->
-
-iex> df = Explorer.DataFrame.new(a: [1, 2, 3])
-iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :infer)
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a float [1.0, 1.0, 1.0]
->

+iex> df = Explorer.DataFrame.new(a: [1, 2, 3]) +iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :float) +#Explorer.DataFrame< + Polars[3 x 1] + a float [1.0, 1.0, 1.0] +> + +iex> df = Explorer.DataFrame.new(a: [1, 2, 3]) +iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :infer) +#Explorer.DataFrame< + Polars[3 x 1] + a float [1.0, 1.0, 1.0] +>

List examples

-

Similar to tensors, we can also put lists in the dataframe:

iex> df = Explorer.DataFrame.new([])
-iex> Explorer.DataFrame.put(df, :a, [1, 2, 3])
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a integer [1, 2, 3]
->

The same considerations as above apply.

+

Similar to tensors, we can also put lists in the dataframe:

iex> df = Explorer.DataFrame.new([])
+iex> Explorer.DataFrame.put(df, :a, [1, 2, 3])
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a integer [1, 2, 3]
+>

The same considerations as above apply.

@@ -3507,30 +3507,30 @@

relocate(df, columns_or_column, opts)

Examples -

Relocate a single column

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1], c: [nil, 5, 6])
-iex> Explorer.DataFrame.relocate(df, "a", after: "c")
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  b integer [1, 3, 1]
-  c integer [nil, 5, 6]
-  a string ["a", "b", "a"]
->

Relocate (and reorder) multiple columns to the beginning

iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: ["yes", "no"])
-iex> Explorer.DataFrame.relocate(df, ["d", 1], before: 0)
-#Explorer.DataFrame<
-  Polars[2 x 4]
-  d string ["yes", "no"]
-  b float [5.1, 5.2]
-  a integer [1, 2]
-  c integer [4, 5]
->

Relocate before another column

iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: ["yes", "no"])
-iex> Explorer.DataFrame.relocate(df, ["a", "c"], before: "b")
-#Explorer.DataFrame<
-  Polars[2 x 4]
-  a integer [1, 2]
-  c integer [4, 5]
-  b float [5.1, 5.2]
-  d string ["yes", "no"]
->
+

Relocate a single column

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1], c: [nil, 5, 6])
+iex> Explorer.DataFrame.relocate(df, "a", after: "c")
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  b integer [1, 3, 1]
+  c integer [nil, 5, 6]
+  a string ["a", "b", "a"]
+>

Relocate (and reorder) multiple columns to the beginning

iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: ["yes", "no"])
+iex> Explorer.DataFrame.relocate(df, ["d", 1], before: 0)
+#Explorer.DataFrame<
+  Polars[2 x 4]
+  d string ["yes", "no"]
+  b float [5.1, 5.2]
+  a integer [1, 2]
+  c integer [4, 5]
+>

Relocate before another column

iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: ["yes", "no"])
+iex> Explorer.DataFrame.relocate(df, ["a", "c"], before: "b")
+#Explorer.DataFrame<
+  Polars[2 x 4]
+  a integer [1, 2]
+  c integer [4, 5]
+  b float [5.1, 5.2]
+  d string ["yes", "no"]
+>
@@ -3568,25 +3568,25 @@

rename(df, names)

Examples -

You can pass in a list of new names:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
-iex> Explorer.DataFrame.rename(df, ["c", "d"])
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  c string ["a", "b", "a"]
-  d integer [1, 3, 1]
->

Or you can rename individual columns using keyword args:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
-iex> Explorer.DataFrame.rename(df, a: "first")
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  first string ["a", "b", "a"]
-  b integer [1, 3, 1]
->

Or you can rename individual columns using a map:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
-iex> Explorer.DataFrame.rename(df, %{"a" => "first"})
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  first string ["a", "b", "a"]
-  b integer [1, 3, 1]
->
+

You can pass in a list of new names:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
+iex> Explorer.DataFrame.rename(df, ["c", "d"])
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  c string ["a", "b", "a"]
+  d integer [1, 3, 1]
+>

Or you can rename individual columns using keyword args:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
+iex> Explorer.DataFrame.rename(df, a: "first")
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  first string ["a", "b", "a"]
+  b integer [1, 3, 1]
+>

Or you can rename individual columns using a map:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "a"], b: [1, 3, 1])
+iex> Explorer.DataFrame.rename(df, %{"a" => "first"})
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  first string ["a", "b", "a"]
+  b integer [1, 3, 1]
+>
@@ -3622,49 +3622,49 @@

rename_with(df, columns \\ 0..-1//1, callba Examples

-

If no columns are specified, it will apply the function to all column names:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.rename_with(df, &String.upcase/1)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  YEAR integer [2010, 2010, 2010, 2010, 2010, ...]
-  COUNTRY string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  TOTAL integer [2308, 1254, 32500, 141, 7924, ...]
-  SOLID_FUEL integer [627, 117, 332, 0, 0, ...]
-  LIQUID_FUEL integer [1601, 953, 12381, 141, 3649, ...]
-  GAS_FUEL integer [74, 7, 14565, 0, 374, ...]
-  CEMENT integer [5, 177, 2598, 0, 204, ...]
-  GAS_FLARING integer [0, 0, 2623, 0, 3697, ...]
-  PER_CAPITA float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  BUNKER_FUELS integer [9, 7, 663, 0, 321, ...]
->

A callback can be used to filter the column names that will be renamed, similarly to select/2:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.rename_with(df, &String.ends_with?(&1, "_fuel"), &String.trim_trailing(&1, "_fuel"))
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid integer [627, 117, 332, 0, 0, ...]
-  liquid integer [1601, 953, 12381, 141, 3649, ...]
-  gas integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Or you can just pass in the list of column names you'd like to apply the function to:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.rename_with(df, ["total", "cement"], &String.upcase/1)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  TOTAL integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  CEMENT integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Ranges, regexes, and functions are also accepted in column names, as in select/2.

+

If no columns are specified, it will apply the function to all column names:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.rename_with(df, &String.upcase/1)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  YEAR integer [2010, 2010, 2010, 2010, 2010, ...]
+  COUNTRY string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  TOTAL integer [2308, 1254, 32500, 141, 7924, ...]
+  SOLID_FUEL integer [627, 117, 332, 0, 0, ...]
+  LIQUID_FUEL integer [1601, 953, 12381, 141, 3649, ...]
+  GAS_FUEL integer [74, 7, 14565, 0, 374, ...]
+  CEMENT integer [5, 177, 2598, 0, 204, ...]
+  GAS_FLARING integer [0, 0, 2623, 0, 3697, ...]
+  PER_CAPITA float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  BUNKER_FUELS integer [9, 7, 663, 0, 321, ...]
+>

A callback can be used to filter the column names that will be renamed, similarly to select/2:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.rename_with(df, &String.ends_with?(&1, "_fuel"), &String.trim_trailing(&1, "_fuel"))
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid integer [627, 117, 332, 0, 0, ...]
+  liquid integer [1601, 953, 12381, 141, 3649, ...]
+  gas integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Or you can just pass in the list of column names you'd like to apply the function to:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.rename_with(df, ["total", "cement"], &String.upcase/1)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  TOTAL integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  CEMENT integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Ranges, regexes, and functions are also accepted in column names, as in select/2.

@@ -3699,61 +3699,61 @@

select(df, columns_or_column)

Examples -

You can select a single column:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.select(df, "a")
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a string ["a", "b", "c"]
->

Or a list of names:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.select(df, ["a"])
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  a string ["a", "b", "c"]
->

You can also use a range or a list of integers:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
-iex> Explorer.DataFrame.select(df, [0, 1])
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["a", "b", "c"]
-  b integer [1, 2, 3]
->
-
-iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
-iex> Explorer.DataFrame.select(df, 0..1)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  a string ["a", "b", "c"]
-  b integer [1, 2, 3]
->

Or you can use a callback function that takes the dataframe's names as its first argument:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.select(df, &String.starts_with?(&1, "b"))
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  b integer [1, 2, 3]
->

Or, if you prefer, a regex:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.select(df, ~r/^b$/)
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  b integer [1, 2, 3]
->

Or a callback function that takes names and types:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
-iex> Explorer.DataFrame.select(df, fn _name, type -> type == :integer end)
-#Explorer.DataFrame<
-  Polars[3 x 1]
-  b integer [1, 2, 3]
->

+

You can select a single column:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.select(df, "a")
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a string ["a", "b", "c"]
+>

Or a list of names:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.select(df, ["a"])
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  a string ["a", "b", "c"]
+>

You can also use a range or a list of integers:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
+iex> Explorer.DataFrame.select(df, [0, 1])
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["a", "b", "c"]
+  b integer [1, 2, 3]
+>
+
+iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3], c: [4, 5, 6])
+iex> Explorer.DataFrame.select(df, 0..1)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  a string ["a", "b", "c"]
+  b integer [1, 2, 3]
+>

Or you can use a callback function that takes the dataframe's names as its first argument:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.select(df, &String.starts_with?(&1, "b"))
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  b integer [1, 2, 3]
+>

Or, if you prefer, a regex:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.select(df, ~r/^b$/)
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  b integer [1, 2, 3]
+>

Or a callback function that takes names and types:

iex> df = Explorer.DataFrame.new(a: ["a", "b", "c"], b: [1, 2, 3])
+iex> Explorer.DataFrame.select(df, fn _name, type -> type == :integer end)
+#Explorer.DataFrame<
+  Polars[3 x 1]
+  b integer [1, 2, 3]
+>

Grouped examples

Columns that are also groups cannot be removed, -you need to ungroup before removing these columns.

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.select(grouped, ["sepal_width"])
-#Explorer.DataFrame<
-  Polars[150 x 2]
-  Groups: ["species"]
-  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+you need to ungroup before removing these columns.

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.select(grouped, ["sepal_width"])
+#Explorer.DataFrame<
+  Polars[150 x 2]
+  Groups: ["species"]
+  sepal_width float [3.5, 3.0, 3.2, 3.1, 3.6, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -3788,29 +3788,29 @@

summarise(df, query)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> grouped_df = Explorer.DataFrame.group_by(df, "year")
-iex> Explorer.DataFrame.summarise(grouped_df, total_max: max(total), total_min: min(total))
-#Explorer.DataFrame<
-  Polars[5 x 3]
-  year integer [2010, 2011, 2012, 2013, 2014]
-  total_max integer [2393248, 2654360, 2734817, 2797384, 2806634]
-  total_min integer [1, 2, 2, 2, 3]
->

Suppose you want to get the mean petal length of each Iris species. You could do something -like this:

iex> df = Explorer.Datasets.iris()
-iex> grouped_df = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.summarise(grouped_df, mean_petal_length: mean(petal_length))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  species string ["Iris-setosa", "Iris-versicolor", "Iris-virginica"]
-  mean_petal_length float [1.464, 4.26, 5.552]
->

In case aggregations for all the dataframe is what you want, you can use ungrouped -dataframes:

iex> df = Explorer.Datasets.iris()
-iex> Explorer.DataFrame.summarise(df, mean_petal_length: mean(petal_length))
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  mean_petal_length float [3.758666666666667]
->
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> grouped_df = Explorer.DataFrame.group_by(df, "year")
+iex> Explorer.DataFrame.summarise(grouped_df, total_max: max(total), total_min: min(total))
+#Explorer.DataFrame<
+  Polars[5 x 3]
+  year integer [2010, 2011, 2012, 2013, 2014]
+  total_max integer [2393248, 2654360, 2734817, 2797384, 2806634]
+  total_min integer [1, 2, 2, 2, 3]
+>

Suppose you want to get the mean petal length of each Iris species. You could do something +like this:

iex> df = Explorer.Datasets.iris()
+iex> grouped_df = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.summarise(grouped_df, mean_petal_length: mean(petal_length))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  species string ["Iris-setosa", "Iris-versicolor", "Iris-virginica"]
+  mean_petal_length float [1.464, 4.26, 5.552]
+>

In case aggregations for all the dataframe is what you want, you can use ungrouped +dataframes:

iex> df = Explorer.Datasets.iris()
+iex> Explorer.DataFrame.summarise(df, mean_petal_length: mean(petal_length))
+#Explorer.DataFrame<
+  Polars[1 x 1]
+  mean_petal_length float [3.758666666666667]
+>
@@ -3851,24 +3851,24 @@

summarise_with(df, fun)

Examples -
iex> alias Explorer.{DataFrame, Series}
-iex> df = Explorer.Datasets.fossil_fuels() |> DataFrame.group_by("year")
-iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1["total"]), countries: Series.n_distinct(&1["country"])])
-#Explorer.DataFrame<
-  Polars[5 x 3]
-  year integer [2010, 2011, 2012, 2013, 2014]
-  total_max integer [2393248, 2654360, 2734817, 2797384, 2806634]
-  countries integer [217, 217, 220, 220, 220]
->
-
-iex> alias Explorer.{DataFrame, Series}
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1["total"]), countries: Series.n_distinct(&1["country"])])
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  total_max integer [2806634]
-  countries integer [222]
->
+
iex> alias Explorer.{DataFrame, Series}
+iex> df = Explorer.Datasets.fossil_fuels() |> DataFrame.group_by("year")
+iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1["total"]), countries: Series.n_distinct(&1["country"])])
+#Explorer.DataFrame<
+  Polars[5 x 3]
+  year integer [2010, 2011, 2012, 2013, 2014]
+  total_max integer [2393248, 2654360, 2734817, 2797384, 2806634]
+  countries integer [217, 217, 220, 220, 220]
+>
+
+iex> alias Explorer.{DataFrame, Series}
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1["total"]), countries: Series.n_distinct(&1["country"])])
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  total_max integer [2806634]
+  countries integer [222]
+>
@@ -3906,38 +3906,38 @@

ungroup(df, groups \\ 0..-1//1)

Examples -

Ungroups all by default:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> df = Explorer.DataFrame.group_by(df, ["country", "year"])
-iex> Explorer.DataFrame.ungroup(df)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Ungrouping a single column:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> df = Explorer.DataFrame.group_by(df, ["country", "year"])
-iex> Explorer.DataFrame.ungroup(df, "country")
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  Groups: ["year"]
-  year integer [2010, 2010, 2010, 2010, 2010, ...]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
-  total integer [2308, 1254, 32500, 141, 7924, ...]
-  solid_fuel integer [627, 117, 332, 0, 0, ...]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
-  gas_fuel integer [74, 7, 14565, 0, 374, ...]
-  cement integer [5, 177, 2598, 0, 204, ...]
-  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
-  bunker_fuels integer [9, 7, 663, 0, 321, ...]
->

Lists, ranges, regexes, and functions are also accepted in column names, as in select/2.

+

Ungroups all by default:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> df = Explorer.DataFrame.group_by(df, ["country", "year"])
+iex> Explorer.DataFrame.ungroup(df)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Ungrouping a single column:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> df = Explorer.DataFrame.group_by(df, ["country", "year"])
+iex> Explorer.DataFrame.ungroup(df, "country")
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  Groups: ["year"]
+  year integer [2010, 2010, 2010, 2010, 2010, ...]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA", ...]
+  total integer [2308, 1254, 32500, 141, 7924, ...]
+  solid_fuel integer [627, 117, 332, 0, 0, ...]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649, ...]
+  gas_fuel integer [74, 7, 14565, 0, 374, ...]
+  cement integer [5, 177, 2598, 0, 204, ...]
+  gas_flaring integer [0, 0, 2623, 0, 3697, ...]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37, ...]
+  bunker_fuels integer [9, 7, 663, 0, 321, ...]
+>

Lists, ranges, regexes, and functions are also accepted in column names, as in select/2.

@@ -3987,25 +3987,25 @@

concat_columns(dfs)

Examples -
iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
-iex> df2 = Explorer.DataFrame.new(z: [4, 5, 6], a: ["d", "e", "f"])
-iex> Explorer.DataFrame.concat_columns([df1, df2])
-#Explorer.DataFrame<
-  Polars[3 x 4]
-  x integer [1, 2, 3]
-  y string ["a", "b", "c"]
-  z integer [4, 5, 6]
-  a string ["d", "e", "f"]
->

Conflicting names are suffixed with the index of the dataframe in the array:

iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
-iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], a: ["d", "e", "f"])
-iex> Explorer.DataFrame.concat_columns([df1, df2])
-#Explorer.DataFrame<
-  Polars[3 x 4]
-  x integer [1, 2, 3]
-  y string ["a", "b", "c"]
-  x_1 integer [4, 5, 6]
-  a string ["d", "e", "f"]
->
+
iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
+iex> df2 = Explorer.DataFrame.new(z: [4, 5, 6], a: ["d", "e", "f"])
+iex> Explorer.DataFrame.concat_columns([df1, df2])
+#Explorer.DataFrame<
+  Polars[3 x 4]
+  x integer [1, 2, 3]
+  y string ["a", "b", "c"]
+  z integer [4, 5, 6]
+  a string ["d", "e", "f"]
+>

Conflicting names are suffixed with the index of the dataframe in the array:

iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
+iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], a: ["d", "e", "f"])
+iex> Explorer.DataFrame.concat_columns([df1, df2])
+#Explorer.DataFrame<
+  Polars[3 x 4]
+  x integer [1, 2, 3]
+  y string ["a", "b", "c"]
+  x_1 integer [4, 5, 6]
+  a string ["d", "e", "f"]
+>
@@ -4070,23 +4070,23 @@

concat_rows(dfs)

Examples -
iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
-iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], y: ["d", "e", "f"])
-iex> Explorer.DataFrame.concat_rows([df1, df2])
-#Explorer.DataFrame<
-  Polars[6 x 2]
-  x integer [1, 2, 3, 4, 5, ...]
-  y string ["a", "b", "c", "d", "e", ...]
->
-
-iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
-iex> df2 = Explorer.DataFrame.new(x: [4.2, 5.3, 6.4], y: ["d", "e", "f"])
-iex> Explorer.DataFrame.concat_rows([df1, df2])
-#Explorer.DataFrame<
-  Polars[6 x 2]
-  x float [1.0, 2.0, 3.0, 4.2, 5.3, ...]
-  y string ["a", "b", "c", "d", "e", ...]
->
+
iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
+iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], y: ["d", "e", "f"])
+iex> Explorer.DataFrame.concat_rows([df1, df2])
+#Explorer.DataFrame<
+  Polars[6 x 2]
+  x integer [1, 2, 3, 4, 5, ...]
+  y string ["a", "b", "c", "d", "e", ...]
+>
+
+iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: ["a", "b", "c"])
+iex> df2 = Explorer.DataFrame.new(x: [4.2, 5.3, 6.4], y: ["d", "e", "f"])
+iex> Explorer.DataFrame.concat_rows([df1, df2])
+#Explorer.DataFrame<
+  Polars[6 x 2]
+  x float [1.0, 2.0, 3.0, 4.2, 5.3, ...]
+  y string ["a", "b", "c", "d", "e", ...]
+>
@@ -4163,119 +4163,119 @@

join(left, right, opts \\ [])

Examples -

Inner join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right)
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a integer [1, 2, 2]
-  b string ["a", "b", "b"]
-  c string ["d", "e", "f"]
->

Left join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right, how: :left)
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  a integer [1, 2, 2, 3]
-  b string ["a", "b", "b", "c"]
-  c string ["d", "e", "f", nil]
->

Right join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right, how: :right)
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a integer [1, 2, 4]
-  c string ["d", "e", "f"]
-  b string ["a", "b", nil]
->

Outer join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right, how: :outer)
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  a integer [1, 2, 4, 3]
-  b string ["a", "b", nil, "c"]
-  c string ["d", "e", "f", nil]
->

Cross join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right, how: :cross)
-#Explorer.DataFrame<
-  Polars[9 x 4]
-  a integer [1, 1, 1, 2, 2, ...]
-  b string ["a", "a", "a", "b", "b", ...]
-  a_right integer [1, 2, 4, 1, 2, ...]
-  c string ["d", "e", "f", "d", "e", ...]
->

Inner join with different names:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(d: [1, 2, 2], c: ["d", "e", "f"])
-iex> Explorer.DataFrame.join(left, right, on: [{"a", "d"}])
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  a integer [1, 2, 2]
-  b string ["a", "b", "b"]
-  c string ["d", "e", "f"]
->

+

Inner join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right)
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a integer [1, 2, 2]
+  b string ["a", "b", "b"]
+  c string ["d", "e", "f"]
+>

Left join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right, how: :left)
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  a integer [1, 2, 2, 3]
+  b string ["a", "b", "b", "c"]
+  c string ["d", "e", "f", nil]
+>

Right join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right, how: :right)
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a integer [1, 2, 4]
+  c string ["d", "e", "f"]
+  b string ["a", "b", nil]
+>

Outer join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right, how: :outer)
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  a integer [1, 2, 4, 3]
+  b string ["a", "b", nil, "c"]
+  c string ["d", "e", "f", nil]
+>

Cross join:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right, how: :cross)
+#Explorer.DataFrame<
+  Polars[9 x 4]
+  a integer [1, 1, 1, 2, 2, ...]
+  b string ["a", "a", "a", "b", "b", ...]
+  a_right integer [1, 2, 4, 1, 2, ...]
+  c string ["d", "e", "f", "d", "e", ...]
+>

Inner join with different names:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(d: [1, 2, 2], c: ["d", "e", "f"])
+iex> Explorer.DataFrame.join(left, right, on: [{"a", "d"}])
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  a integer [1, 2, 2]
+  b string ["a", "b", "b"]
+  c string ["d", "e", "f"]
+>

Grouped examples

When doing a join operation with grouped dataframes, the joined dataframe -may keep the groups from only one side.

An inner join operation will keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
-iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
-iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
-iex> Explorer.DataFrame.join(grouped_left, grouped_right)
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  Groups: ["b"]
-  a integer [1, 2, 2]
-  b string ["a", "b", "b"]
-  c string ["d", "e", "f"]
->

A left join operation will keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
-iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
-iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
-iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :left)
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  Groups: ["b"]
-  a integer [1, 2, 2, 3]
-  b string ["a", "b", "b", "c"]
-  c string ["d", "e", "f", nil]
->

A right join operation will keep the groups from the right-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
-iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
-iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :right)
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  Groups: ["c"]
-  a integer [1, 2, 4]
-  c string ["d", "e", "f"]
-  b string ["a", "b", nil]
->

An outer join operation is going to keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
-iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
-iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :outer)
-#Explorer.DataFrame<
-  Polars[4 x 3]
-  Groups: ["b"]
-  a integer [1, 2, 4, 3]
-  b string ["a", "b", nil, "c"]
-  c string ["d", "e", "f", nil]
->

A cross join operation is going to keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
-iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
-iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
-iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :cross)
-#Explorer.DataFrame<
-  Polars[9 x 4]
-  Groups: ["b"]
-  a integer [1, 1, 1, 2, 2, ...]
-  b string ["a", "a", "a", "b", "b", ...]
-  a_right integer [1, 2, 4, 1, 2, ...]
-  c string ["d", "e", "f", "d", "e", ...]
->
+may keep the groups from only one side.

An inner join operation will keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
+iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
+iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
+iex> Explorer.DataFrame.join(grouped_left, grouped_right)
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  Groups: ["b"]
+  a integer [1, 2, 2]
+  b string ["a", "b", "b"]
+  c string ["d", "e", "f"]
+>

A left join operation will keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: ["d", "e", "f"])
+iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
+iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
+iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :left)
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  Groups: ["b"]
+  a integer [1, 2, 2, 3]
+  b string ["a", "b", "b", "c"]
+  c string ["d", "e", "f", nil]
+>

A right join operation will keep the groups from the right-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
+iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
+iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :right)
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  Groups: ["c"]
+  a integer [1, 2, 4]
+  c string ["d", "e", "f"]
+  b string ["a", "b", nil]
+>

An outer join operation is going to keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
+iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
+iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :outer)
+#Explorer.DataFrame<
+  Polars[4 x 3]
+  Groups: ["b"]
+  a integer [1, 2, 4, 3]
+  b string ["a", "b", nil, "c"]
+  c string ["d", "e", "f", nil]
+>

A cross join operation is going to keep the groups from the left-hand side dataframe:

iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: ["d", "e", "f"])
+iex> grouped_left = Explorer.DataFrame.group_by(left, "b")
+iex> grouped_right = Explorer.DataFrame.group_by(right, "c")
+iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :cross)
+#Explorer.DataFrame<
+  Polars[9 x 4]
+  Groups: ["b"]
+  a integer [1, 1, 1, 2, 2, ...]
+  b string ["a", "a", "a", "b", "b", ...]
+  a_right integer [1, 2, 4, 1, 2, ...]
+  c string ["d", "e", "f", "d", "e", ...]
+>
@@ -4324,55 +4324,55 @@

head(df, nrows \\ 5)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.head(df)
-#Explorer.DataFrame<
-  Polars[5 x 10]
-  year integer [2010, 2010, 2010, 2010, 2010]
-  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA"]
-  total integer [2308, 1254, 32500, 141, 7924]
-  solid_fuel integer [627, 117, 332, 0, 0]
-  liquid_fuel integer [1601, 953, 12381, 141, 3649]
-  gas_fuel integer [74, 7, 14565, 0, 374]
-  cement integer [5, 177, 2598, 0, 204]
-  gas_flaring integer [0, 0, 2623, 0, 3697]
-  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37]
-  bunker_fuels integer [9, 7, 663, 0, 321]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.head(df, 2)
-#Explorer.DataFrame<
-  Polars[2 x 10]
-  year integer [2010, 2010]
-  country string ["AFGHANISTAN", "ALBANIA"]
-  total integer [2308, 1254]
-  solid_fuel integer [627, 117]
-  liquid_fuel integer [1601, 953]
-  gas_fuel integer [74, 7]
-  cement integer [5, 177]
-  gas_flaring integer [0, 0]
-  per_capita float [0.08, 0.43]
-  bunker_fuels integer [9, 7]
->

+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.head(df)
+#Explorer.DataFrame<
+  Polars[5 x 10]
+  year integer [2010, 2010, 2010, 2010, 2010]
+  country string ["AFGHANISTAN", "ALBANIA", "ALGERIA", "ANDORRA", "ANGOLA"]
+  total integer [2308, 1254, 32500, 141, 7924]
+  solid_fuel integer [627, 117, 332, 0, 0]
+  liquid_fuel integer [1601, 953, 12381, 141, 3649]
+  gas_fuel integer [74, 7, 14565, 0, 374]
+  cement integer [5, 177, 2598, 0, 204]
+  gas_flaring integer [0, 0, 2623, 0, 3697]
+  per_capita float [0.08, 0.43, 0.9, 1.68, 0.37]
+  bunker_fuels integer [9, 7, 663, 0, 321]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.head(df, 2)
+#Explorer.DataFrame<
+  Polars[2 x 10]
+  year integer [2010, 2010]
+  country string ["AFGHANISTAN", "ALBANIA"]
+  total integer [2308, 1254]
+  solid_fuel integer [627, 117]
+  liquid_fuel integer [1601, 953]
+  gas_fuel integer [74, 7]
+  cement integer [5, 177]
+  gas_flaring integer [0, 0]
+  per_capita float [0.08, 0.43]
+  bunker_fuels integer [9, 7]
+>

Grouped examples

Using grouped dataframes makes head/2 return n rows from each group. -Here is an example using the Iris dataset, and returning two rows from each group:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.head(grouped, 2)
-#Explorer.DataFrame<
-  Polars[6 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.9, 7.0, 6.4, 6.3, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.3, ...]
-  petal_length float [1.4, 1.4, 4.7, 4.5, 6.0, ...]
-  petal_width float [0.2, 0.2, 1.4, 1.5, 2.5, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
->
+Here is an example using the Iris dataset, and returning two rows from each group:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.head(grouped, 2)
+#Explorer.DataFrame<
+  Polars[6 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.9, 7.0, 6.4, 6.3, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.3, ...]
+  petal_length float [1.4, 1.4, 4.7, 4.5, 6.0, ...]
+  petal_width float [0.2, 0.2, 1.4, 1.5, 2.5, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
+>
@@ -4421,35 +4421,35 @@

sample(df, n_or_frac, opts \\ [])

Examples -

You can sample N rows:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.sample(df, 3, seed: 100)
-#Explorer.DataFrame<
-  Polars[3 x 10]
-  year integer [2011, 2012, 2011]
-  country string ["SERBIA", "FALKLAND ISLANDS (MALVINAS)", "SWAZILAND"]
-  total integer [13422, 15, 286]
-  solid_fuel integer [9355, 3, 102]
-  liquid_fuel integer [2537, 12, 184]
-  gas_fuel integer [1188, 0, 0]
-  cement integer [342, 0, 0]
-  gas_flaring integer [0, 0, 0]
-  per_capita float [1.49, 5.21, 0.24]
-  bunker_fuels integer [39, 0, 1]
->

Or you can sample a proportion of rows:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.sample(df, 0.03, seed: 100)
-#Explorer.DataFrame<
-  Polars[32 x 10]
-  year integer [2011, 2012, 2012, 2013, 2010, ...]
-  country string ["URUGUAY", "FRENCH POLYNESIA", "ICELAND", "PERU", "TUNISIA", ...]
-  total integer [2117, 222, 491, 15586, 7543, ...]
-  solid_fuel integer [1, 0, 96, 784, 15, ...]
-  liquid_fuel integer [1943, 222, 395, 7097, 3138, ...]
-  gas_fuel integer [40, 0, 0, 3238, 3176, ...]
-  cement integer [132, 0, 0, 1432, 1098, ...]
-  gas_flaring integer [0, 0, 0, 3036, 116, ...]
-  per_capita float [0.63, 0.81, 1.52, 0.51, 0.71, ...]
-  bunker_fuels integer [401, 45, 170, 617, 219, ...]
->

+

You can sample N rows:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.sample(df, 3, seed: 100)
+#Explorer.DataFrame<
+  Polars[3 x 10]
+  year integer [2011, 2012, 2011]
+  country string ["SERBIA", "FALKLAND ISLANDS (MALVINAS)", "SWAZILAND"]
+  total integer [13422, 15, 286]
+  solid_fuel integer [9355, 3, 102]
+  liquid_fuel integer [2537, 12, 184]
+  gas_fuel integer [1188, 0, 0]
+  cement integer [342, 0, 0]
+  gas_flaring integer [0, 0, 0]
+  per_capita float [1.49, 5.21, 0.24]
+  bunker_fuels integer [39, 0, 1]
+>

Or you can sample a proportion of rows:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.sample(df, 0.03, seed: 100)
+#Explorer.DataFrame<
+  Polars[32 x 10]
+  year integer [2011, 2012, 2012, 2013, 2010, ...]
+  country string ["URUGUAY", "FRENCH POLYNESIA", "ICELAND", "PERU", "TUNISIA", ...]
+  total integer [2117, 222, 491, 15586, 7543, ...]
+  solid_fuel integer [1, 0, 96, 784, 15, ...]
+  liquid_fuel integer [1943, 222, 395, 7097, 3138, ...]
+  gas_fuel integer [40, 0, 0, 3238, 3176, ...]
+  cement integer [132, 0, 0, 1432, 1098, ...]
+  gas_flaring integer [0, 0, 0, 3036, 116, ...]
+  per_capita float [0.63, 0.81, 1.52, 0.51, 0.71, ...]
+  bunker_fuels integer [401, 45, 170, 617, 219, ...]
+>

Grouped examples @@ -4457,30 +4457,30 @@

sample(df, n_or_frac, opts \\ [])

In the following example we have the Iris dataset grouped by species, and we want to take a sample of two plants from each group. Since we have three species, the -resultant dataframe is going to have six rows (2 * 3).

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.sample(grouped, 2, seed: 100)
-#Explorer.DataFrame<
-  Polars[6 x 5]
-  Groups: ["species"]
-  sepal_length float [5.3, 5.1, 5.1, 5.6, 6.2, ...]
-  sepal_width float [3.7, 3.8, 2.5, 2.7, 3.4, ...]
-  petal_length float [1.5, 1.9, 3.0, 4.2, 5.4, ...]
-  petal_width float [0.2, 0.4, 1.1, 1.3, 2.3, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
->

The behaviour is similar when you want to take a fraction of the rows from each group. The main -difference is that each group can have more or less rows, depending on its size.

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.sample(grouped, 0.1, seed: 100)
-#Explorer.DataFrame<
-  Polars[15 x 5]
-  Groups: ["species"]
-  sepal_length float [5.3, 5.1, 4.7, 5.7, 5.1, ...]
-  sepal_width float [3.7, 3.8, 3.2, 3.8, 3.5, ...]
-  petal_length float [1.5, 1.9, 1.3, 1.7, 1.4, ...]
-  petal_width float [0.2, 0.4, 0.2, 0.3, 0.3, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->
+resultant dataframe is going to have six rows (2 * 3).

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.sample(grouped, 2, seed: 100)
+#Explorer.DataFrame<
+  Polars[6 x 5]
+  Groups: ["species"]
+  sepal_length float [5.3, 5.1, 5.1, 5.6, 6.2, ...]
+  sepal_width float [3.7, 3.8, 2.5, 2.7, 3.4, ...]
+  petal_length float [1.5, 1.9, 3.0, 4.2, 5.4, ...]
+  petal_width float [0.2, 0.4, 1.1, 1.3, 2.3, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
+>

The behaviour is similar when you want to take a fraction of the rows from each group. The main +difference is that each group can have more or less rows, depending on its size.

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.sample(grouped, 0.1, seed: 100)
+#Explorer.DataFrame<
+  Polars[15 x 5]
+  Groups: ["species"]
+  sepal_length float [5.3, 5.1, 4.7, 5.7, 5.1, ...]
+  sepal_width float [3.7, 3.8, 3.2, 3.8, 3.5, ...]
+  petal_length float [1.5, 1.9, 1.3, 1.7, 1.4, ...]
+  petal_width float [0.2, 0.4, 0.2, 0.3, 0.3, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>
@@ -4523,21 +4523,21 @@

shuffle(df, opts \\ [])

Examples
-
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.shuffle(df, seed: 100)
-#Explorer.DataFrame<
-  Polars[1094 x 10]
-  year integer [2014, 2014, 2014, 2012, 2010, ...]
-  country string ["ISRAEL", "ARGENTINA", "NETHERLANDS", "YEMEN", "GRENADA", ...]
-  total integer [17617, 55638, 45624, 5091, 71, ...]
-  solid_fuel integer [6775, 1588, 9070, 129, 0, ...]
-  liquid_fuel integer [6013, 25685, 18272, 4173, 71, ...]
-  gas_fuel integer [3930, 26368, 18010, 414, 0, ...]
-  cement integer [898, 1551, 272, 375, 0, ...]
-  gas_flaring integer [0, 446, 0, 0, 0, ...]
-  per_capita float [2.22, 1.29, 2.7, 0.2, 0.68, ...]
-  bunker_fuels integer [1011, 2079, 14210, 111, 4, ...]
->
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.shuffle(df, seed: 100)
+#Explorer.DataFrame<
+  Polars[1094 x 10]
+  year integer [2014, 2014, 2014, 2012, 2010, ...]
+  country string ["ISRAEL", "ARGENTINA", "NETHERLANDS", "YEMEN", "GRENADA", ...]
+  total integer [17617, 55638, 45624, 5091, 71, ...]
+  solid_fuel integer [6775, 1588, 9070, 129, 0, ...]
+  liquid_fuel integer [6013, 25685, 18272, 4173, 71, ...]
+  gas_fuel integer [3930, 26368, 18010, 414, 0, ...]
+  cement integer [898, 1551, 272, 375, 0, ...]
+  gas_flaring integer [0, 446, 0, 0, 0, ...]
+  per_capita float [2.22, 1.29, 2.7, 0.2, 0.68, ...]
+  bunker_fuels integer [1011, 2079, 14210, 111, 4, ...]
+>
@@ -4571,31 +4571,31 @@

slice(df, row_indices)

Examples -
iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> Explorer.DataFrame.slice(df, [0, 2])
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a integer [1, 3]
-  b string ["a", "c"]
->

With a series

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> Explorer.DataFrame.slice(df, Explorer.Series.from_list([0, 2]))
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a integer [1, 3]
-  b string ["a", "c"]
->

With a range:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> Explorer.DataFrame.slice(df, 1..2)
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a integer [2, 3]
-  b string ["b", "c"]
->

With a range with negative first and last:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
-iex> Explorer.DataFrame.slice(df, -2..-1)
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  a integer [2, 3]
-  b string ["b", "c"]
->

+
iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> Explorer.DataFrame.slice(df, [0, 2])
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a integer [1, 3]
+  b string ["a", "c"]
+>

With a series

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> Explorer.DataFrame.slice(df, Explorer.Series.from_list([0, 2]))
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a integer [1, 3]
+  b string ["a", "c"]
+>

With a range:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> Explorer.DataFrame.slice(df, 1..2)
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a integer [2, 3]
+  b string ["b", "c"]
+>

With a range with negative first and last:

iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])
+iex> Explorer.DataFrame.slice(df, -2..-1)
+#Explorer.DataFrame<
+  Polars[2 x 2]
+  a integer [2, 3]
+  b string ["b", "c"]
+>

Grouped examples @@ -4603,30 +4603,30 @@

slice(df, row_indices)

We are going to once again use the Iris dataset. In this example we want to take elements at indexes -0 and 2:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.slice(grouped, [0, 2])
-#Explorer.DataFrame<
-  Polars[6 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.7, 7.0, 6.9, 6.3, ...]
-  sepal_width float [3.5, 3.2, 3.2, 3.1, 3.3, ...]
-  petal_length float [1.4, 1.3, 4.7, 4.9, 6.0, ...]
-  petal_width float [0.2, 0.2, 1.4, 1.5, 2.5, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
->

Now we want to take the first 3 rows of each group. -This is going to work with the range 0..2:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.slice(grouped, 0..2)
-#Explorer.DataFrame<
-  Polars[9 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.9, 4.7, 7.0, 6.4, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.2, ...]
-  petal_length float [1.4, 1.4, 1.3, 4.7, 4.5, ...]
-  petal_width float [0.2, 0.2, 0.2, 1.4, 1.5, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
->
+0 and 2:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.slice(grouped, [0, 2])
+#Explorer.DataFrame<
+  Polars[6 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.7, 7.0, 6.9, 6.3, ...]
+  sepal_width float [3.5, 3.2, 3.2, 3.1, 3.3, ...]
+  petal_length float [1.4, 1.3, 4.7, 4.9, 6.0, ...]
+  petal_width float [0.2, 0.2, 1.4, 1.5, 2.5, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
+>

Now we want to take the first 3 rows of each group. +This is going to work with the range 0..2:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.slice(grouped, 0..2)
+#Explorer.DataFrame<
+  Polars[9 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.9, 4.7, 7.0, 6.4, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.2, ...]
+  petal_length float [1.4, 1.4, 1.3, 4.7, 4.5, ...]
+  petal_width float [0.2, 0.2, 0.2, 1.4, 1.5, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
+>
@@ -4654,77 +4654,77 @@

slice(df, offset, length)

Examples
-
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.slice(df, 1, 2)
-#Explorer.DataFrame<
-  Polars[2 x 10]
-  year integer [2010, 2010]
-  country string ["ALBANIA", "ALGERIA"]
-  total integer [1254, 32500]
-  solid_fuel integer [117, 332]
-  liquid_fuel integer [953, 12381]
-  gas_fuel integer [7, 14565]
-  cement integer [177, 2598]
-  gas_flaring integer [0, 2623]
-  per_capita float [0.43, 0.9]
-  bunker_fuels integer [7, 663]
->

Negative offsets count from the end of the series:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.slice(df, -10, 2)
-#Explorer.DataFrame<
-  Polars[2 x 10]
-  year integer [2014, 2014]
-  country string ["UNITED STATES OF AMERICA", "URUGUAY"]
-  total integer [1432855, 1840]
-  solid_fuel integer [450047, 2]
-  liquid_fuel integer [576531, 1700]
-  gas_fuel integer [390719, 25]
-  cement integer [11314, 112]
-  gas_flaring integer [4244, 0]
-  per_capita float [4.43, 0.54]
-  bunker_fuels integer [30722, 251]
->

If the length would run past the end of the dataframe, the result may be shorter than the length:

iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.slice(df, -10, 20)
-#Explorer.DataFrame<
-  Polars[10 x 10]
-  year integer [2014, 2014, 2014, 2014, 2014, ...]
-  country string ["UNITED STATES OF AMERICA", "URUGUAY", "UZBEKISTAN", "VANUATU", "VENEZUELA", ...]
-  total integer [1432855, 1840, 28692, 42, 50510, ...]
-  solid_fuel integer [450047, 2, 1677, 0, 204, ...]
-  liquid_fuel integer [576531, 1700, 2086, 42, 28445, ...]
-  gas_fuel integer [390719, 25, 23929, 0, 12731, ...]
-  cement integer [11314, 112, 1000, 0, 1088, ...]
-  gas_flaring integer [4244, 0, 0, 0, 8042, ...]
-  per_capita float [4.43, 0.54, 0.97, 0.16, 1.65, ...]
-  bunker_fuels integer [30722, 251, 0, 10, 1256, ...]
->

+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.slice(df, 1, 2)
+#Explorer.DataFrame<
+  Polars[2 x 10]
+  year integer [2010, 2010]
+  country string ["ALBANIA", "ALGERIA"]
+  total integer [1254, 32500]
+  solid_fuel integer [117, 332]
+  liquid_fuel integer [953, 12381]
+  gas_fuel integer [7, 14565]
+  cement integer [177, 2598]
+  gas_flaring integer [0, 2623]
+  per_capita float [0.43, 0.9]
+  bunker_fuels integer [7, 663]
+>

Negative offsets count from the end of the series:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.slice(df, -10, 2)
+#Explorer.DataFrame<
+  Polars[2 x 10]
+  year integer [2014, 2014]
+  country string ["UNITED STATES OF AMERICA", "URUGUAY"]
+  total integer [1432855, 1840]
+  solid_fuel integer [450047, 2]
+  liquid_fuel integer [576531, 1700]
+  gas_fuel integer [390719, 25]
+  cement integer [11314, 112]
+  gas_flaring integer [4244, 0]
+  per_capita float [4.43, 0.54]
+  bunker_fuels integer [30722, 251]
+>

If the length would run past the end of the dataframe, the result may be shorter than the length:

iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.slice(df, -10, 20)
+#Explorer.DataFrame<
+  Polars[10 x 10]
+  year integer [2014, 2014, 2014, 2014, 2014, ...]
+  country string ["UNITED STATES OF AMERICA", "URUGUAY", "UZBEKISTAN", "VANUATU", "VENEZUELA", ...]
+  total integer [1432855, 1840, 28692, 42, 50510, ...]
+  solid_fuel integer [450047, 2, 1677, 0, 204, ...]
+  liquid_fuel integer [576531, 1700, 2086, 42, 28445, ...]
+  gas_fuel integer [390719, 25, 23929, 0, 12731, ...]
+  cement integer [11314, 112, 1000, 0, 1088, ...]
+  gas_flaring integer [4244, 0, 0, 0, 8042, ...]
+  per_capita float [4.43, 0.54, 0.97, 0.16, 1.65, ...]
+  bunker_fuels integer [30722, 251, 0, 10, 1256, ...]
+>

Grouped examples

-

We want to take the first 3 rows of each group. We need the offset 0 and the length 3:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.slice(grouped, 0, 3)
-#Explorer.DataFrame<
-  Polars[9 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.9, 4.7, 7.0, 6.4, ...]
-  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.2, ...]
-  petal_length float [1.4, 1.4, 1.3, 4.7, 4.5, ...]
-  petal_width float [0.2, 0.2, 0.2, 1.4, 1.5, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
->

We can also pass a negative offset:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.slice(grouped, -6, 3)
-#Explorer.DataFrame<
-  Polars[9 x 5]
-  Groups: ["species"]
-  sepal_length float [5.1, 4.8, 5.1, 5.6, 5.7, ...]
-  sepal_width float [3.8, 3.0, 3.8, 2.7, 3.0, ...]
-  petal_length float [1.9, 1.4, 1.6, 4.2, 4.2, ...]
-  petal_width float [0.4, 0.3, 0.2, 1.3, 1.2, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
->
+

We want to take the first 3 rows of each group. We need the offset 0 and the length 3:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.slice(grouped, 0, 3)
+#Explorer.DataFrame<
+  Polars[9 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.9, 4.7, 7.0, 6.4, ...]
+  sepal_width float [3.5, 3.0, 3.2, 3.2, 3.2, ...]
+  petal_length float [1.4, 1.4, 1.3, 4.7, 4.5, ...]
+  petal_width float [0.2, 0.2, 0.2, 1.4, 1.5, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
+>

We can also pass a negative offset:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.slice(grouped, -6, 3)
+#Explorer.DataFrame<
+  Polars[9 x 5]
+  Groups: ["species"]
+  sepal_length float [5.1, 4.8, 5.1, 5.6, 5.7, ...]
+  sepal_width float [3.8, 3.0, 3.8, 2.7, 3.0, ...]
+  petal_length float [1.9, 1.4, 1.6, 4.2, 4.2, ...]
+  petal_width float [0.4, 0.3, 0.2, 1.3, 1.2, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", ...]
+>
@@ -4761,55 +4761,55 @@

tail(df, nrows \\ 5)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.tail(df)
-#Explorer.DataFrame<
-  Polars[5 x 10]
-  year integer [2014, 2014, 2014, 2014, 2014]
-  country string ["VIET NAM", "WALLIS AND FUTUNA ISLANDS", "YEMEN", "ZAMBIA", "ZIMBABWE"]
-  total integer [45517, 6, 6190, 1228, 3278]
-  solid_fuel integer [19246, 0, 137, 132, 2097]
-  liquid_fuel integer [12694, 6, 5090, 797, 1005]
-  gas_fuel integer [5349, 0, 581, 0, 0]
-  cement integer [8229, 0, 381, 299, 177]
-  gas_flaring integer [0, 0, 0, 0, 0]
-  per_capita float [0.49, 0.44, 0.24, 0.08, 0.22]
-  bunker_fuels integer [761, 1, 153, 33, 9]
->
-
-iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.tail(df, 2)
-#Explorer.DataFrame<
-  Polars[2 x 10]
-  year integer [2014, 2014]
-  country string ["ZAMBIA", "ZIMBABWE"]
-  total integer [1228, 3278]
-  solid_fuel integer [132, 2097]
-  liquid_fuel integer [797, 1005]
-  gas_fuel integer [0, 0]
-  cement integer [299, 177]
-  gas_flaring integer [0, 0]
-  per_capita float [0.08, 0.22]
-  bunker_fuels integer [33, 9]
->

+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.tail(df)
+#Explorer.DataFrame<
+  Polars[5 x 10]
+  year integer [2014, 2014, 2014, 2014, 2014]
+  country string ["VIET NAM", "WALLIS AND FUTUNA ISLANDS", "YEMEN", "ZAMBIA", "ZIMBABWE"]
+  total integer [45517, 6, 6190, 1228, 3278]
+  solid_fuel integer [19246, 0, 137, 132, 2097]
+  liquid_fuel integer [12694, 6, 5090, 797, 1005]
+  gas_fuel integer [5349, 0, 581, 0, 0]
+  cement integer [8229, 0, 381, 299, 177]
+  gas_flaring integer [0, 0, 0, 0, 0]
+  per_capita float [0.49, 0.44, 0.24, 0.08, 0.22]
+  bunker_fuels integer [761, 1, 153, 33, 9]
+>
+
+iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.tail(df, 2)
+#Explorer.DataFrame<
+  Polars[2 x 10]
+  year integer [2014, 2014]
+  country string ["ZAMBIA", "ZIMBABWE"]
+  total integer [1228, 3278]
+  solid_fuel integer [132, 2097]
+  liquid_fuel integer [797, 1005]
+  gas_fuel integer [0, 0]
+  cement integer [299, 177]
+  gas_flaring integer [0, 0]
+  per_capita float [0.08, 0.22]
+  bunker_fuels integer [33, 9]
+>

Grouped examples

Using grouped dataframes makes tail/2 return n rows from each group. -Here is an example using the Iris dataset, and returning two rows from each group:

iex> df = Explorer.Datasets.iris()
-iex> grouped = Explorer.DataFrame.group_by(df, "species")
-iex> Explorer.DataFrame.tail(grouped, 2)
-#Explorer.DataFrame<
-  Polars[6 x 5]
-  Groups: ["species"]
-  sepal_length float [5.3, 5.0, 5.1, 5.7, 6.2, ...]
-  sepal_width float [3.7, 3.3, 2.5, 2.8, 3.4, ...]
-  petal_length float [1.5, 1.4, 3.0, 4.1, 5.4, ...]
-  petal_width float [0.2, 0.2, 1.1, 1.3, 2.3, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
->
+Here is an example using the Iris dataset, and returning two rows from each group:

iex> df = Explorer.Datasets.iris()
+iex> grouped = Explorer.DataFrame.group_by(df, "species")
+iex> Explorer.DataFrame.tail(grouped, 2)
+#Explorer.DataFrame<
+  Polars[6 x 5]
+  Groups: ["species"]
+  sepal_length float [5.3, 5.0, 5.1, 5.7, 6.2, ...]
+  sepal_width float [3.7, 3.3, 2.5, 2.8, 3.4, ...]
+  petal_length float [1.5, 1.4, 3.0, 4.1, 5.4, ...]
+  petal_width float [0.2, 0.2, 1.1, 1.3, 2.3, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-versicolor", "Iris-versicolor", "Iris-virginica", ...]
+>
@@ -4855,9 +4855,9 @@

dtypes(df)

Examples -
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])
-iex> Explorer.DataFrame.dtypes(df)
-%{"floats" => :float, "ints" => :integer}
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])
+iex> Explorer.DataFrame.dtypes(df)
+%{"floats" => :float, "ints" => :integer}
@@ -4891,14 +4891,14 @@

groups(data_frame)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> df = Explorer.DataFrame.group_by(df, "country")
-iex> Explorer.DataFrame.groups(df)
-["country"]
-
-iex> df = Explorer.Datasets.iris()
-iex> Explorer.DataFrame.groups(df)
-[]
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> df = Explorer.DataFrame.group_by(df, "country")
+iex> Explorer.DataFrame.groups(df)
+["country"]
+
+iex> df = Explorer.Datasets.iris()
+iex> Explorer.DataFrame.groups(df)
+[]
@@ -4932,8 +4932,8 @@

n_columns(df)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.n_columns(df)
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.n_columns(df)
 10
@@ -4969,8 +4969,8 @@

n_rows(df)

Examples -
iex> df = Explorer.Datasets.fossil_fuels()
-iex> Explorer.DataFrame.n_rows(df)
+
iex> df = Explorer.Datasets.fossil_fuels()
+iex> Explorer.DataFrame.n_rows(df)
 1094
@@ -5005,9 +5005,9 @@

names(df)

Examples -
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])
-iex> Explorer.DataFrame.names(df)
-["floats", "ints"]
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])
+iex> Explorer.DataFrame.names(df)
+["floats", "ints"]
@@ -5042,9 +5042,9 @@

shape(df)

Examples -
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0, 3.0], ints: [1, 2, 3])
-iex> Explorer.DataFrame.shape(df)
-{3, 2}
+
iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0, 3.0], ints: [1, 2, 3])
+iex> Explorer.DataFrame.shape(df)
+{3, 2}
@@ -5098,9 +5098,9 @@

dump_csv(df, opts \\ [])

Examples -
iex> df = Explorer.Datasets.fossil_fuels() |> Explorer.DataFrame.head(2)
-iex> Explorer.DataFrame.dump_csv(df)
-{:ok, "year,country,total,solid_fuel,liquid_fuel,gas_fuel,cement,gas_flaring,per_capita,bunker_fuels\n2010,AFGHANISTAN,2308,627,1601,74,5,0,0.08,9\n2010,ALBANIA,1254,117,953,7,177,0,0.43,7\n"}
+
iex> df = Explorer.Datasets.fossil_fuels() |> Explorer.DataFrame.head(2)
+iex> Explorer.DataFrame.dump_csv(df)
+{:ok, "year,country,total,solid_fuel,liquid_fuel,gas_fuel,cement,gas_flaring,per_capita,bunker_fuels\n2010,AFGHANISTAN,2308,627,1601,74,5,0,0.08,9\n2010,ALBANIA,1254,117,953,7,177,0,0.43,7\n"}
@@ -5299,9 +5299,9 @@

dump_ndjson(df)

Examples -
iex> df = Explorer.DataFrame.new(col_a: [1, 2], col_b: [5.1, 5.2])
-iex> Explorer.DataFrame.dump_ndjson(df)
-{:ok, ~s({"col_a":1,"col_b":5.1}\n{"col_a":2,"col_b":5.2}\n)}
+
iex> df = Explorer.DataFrame.new(col_a: [1, 2], col_b: [5.1, 5.2])
+iex> Explorer.DataFrame.dump_ndjson(df)
+{:ok, ~s({"col_a":1,"col_b":5.1}\n{"col_a":2,"col_b":5.2}\n)}
@@ -5430,7 +5430,7 @@

from_csv(filename, opts \\ [])

Reads a delimited file into a dataframe.

It accepts a filename that can be a local file, a "s3://" schema, or -a FSS entry like FSS.S3.Entry.

If the CSV is compressed, it is automatically decompressed.

+a FSS entry like FSS.S3.Entry.

If the CSV is compressed, it is automatically decompressed.

Options @@ -5503,7 +5503,7 @@

from_ipc(filename, opts \\ [])

Reads an IPC file into a dataframe.

It accepts a filename that can be a local file, a "s3://" schema, or -a FSS entry like FSS.S3.Entry.

+a FSS entry like FSS.S3.Entry.

Options @@ -5709,7 +5709,7 @@

from_parquet(filename, opts \\ [])

Reads a parquet file into a dataframe.

It accepts a filename that can be a local file, a "s3://" schema, or -a FSS entry like FSS.S3.Entry.

+a FSS entry like FSS.S3.Entry.

Options @@ -5792,24 +5792,24 @@

from_query(conn, query, params, opts \\ [])

In order to read data from a database, you must list :adbc as a dependency, download the relevant driver, and start both database and connection processes -in your supervision tree.

First, add :adbc as a dependency in your mix.exs:

{:adbc, "~> 0.1"}

Now, in your config/config.exs, configure the drivers you are going to use -(see Adbc module docs for more information on supported drivers):

config :adbc, :drivers, [:sqlite]

If you are using a notebook or scripting, you can also use Adbc.download_driver!/1 +in your supervision tree.

First, add :adbc as a dependency in your mix.exs:

{:adbc, "~> 0.1"}

Now, in your config/config.exs, configure the drivers you are going to use +(see Adbc module docs for more information on supported drivers):

config :adbc, :drivers, [:sqlite]

If you are using a notebook or scripting, you can also use Adbc.download_driver!/1 to dynamically download one.

Then start the database and the relevant connection processes in your -supervision tree:

children = [
-  {Adbc.Database,
+supervision tree:

children = [
+  {Adbc.Database,
    driver: :sqlite,
-   process_options: [name: MyApp.DB]},
-  {Adbc.Connection,
+   process_options: [name: MyApp.DB]},
+  {Adbc.Connection,
    database: MyApp.DB,
-   process_options: [name: MyApp.Conn]}
-]
+   process_options: [name: MyApp.Conn]}
+]
 
-Supervisor.start_link(children, strategy: :one_for_one)

In a notebook, the above would look like this:

db = Kino.start_child!({Adbc.Database, driver: :sqlite})
-conn = Kino.start_child!({Adbc.Connection, database: db})

And now you can make queries with:

# For named connections
-{:ok, _} = Explorer.DataFrame.from_query(MyApp.Conn, "SELECT 123")
+Supervisor.start_link(children, strategy: :one_for_one)

In a notebook, the above would look like this:

db = Kino.start_child!({Adbc.Database, driver: :sqlite})
+conn = Kino.start_child!({Adbc.Connection, database: db})

And now you can make queries with:

# For named connections
+{:ok, _} = Explorer.DataFrame.from_query(MyApp.Conn, "SELECT 123")
 
 # When using the conn PID directly
-{:ok, _} = Explorer.DataFrame.from_query(conn, "SELECT 123")

+{:ok, _} = Explorer.DataFrame.from_query(conn, "SELECT 123")

Options @@ -6129,12 +6129,12 @@

load_ndjson!(contents, opts \\ [])

iex> contents = ~s({"col_a":1,"col_b":5.1}\n{"col_a":2,"col_b":5.2}\n)
-iex> Explorer.DataFrame.load_ndjson!(contents)
-#Explorer.DataFrame<
-  Polars[2 x 2]
-  col_a integer [1, 2]
-  col_b float [5.1, 5.2]
->
+iex> Explorer.DataFrame.load_ndjson!(contents) +#Explorer.DataFrame< + Polars[2 x 2] + col_a integer [1, 2] + col_b float [5.1, 5.2] +>
diff --git a/Explorer.Datasets.html b/Explorer.Datasets.html index f3e57f453..cc3bf20b9 100644 --- a/Explorer.Datasets.html +++ b/Explorer.Datasets.html @@ -13,7 +13,7 @@ - + @@ -117,7 +117,7 @@

in production. Therefore, if you need one of those datasets in production, you must download the source files to your own application priv directory and load them yourself. -For example:

Explorer.DataFrame.from_csv!(Application.app_dir(:my_app, "priv/iris.csv"))
+For example:

Explorer.DataFrame.from_csv!(Application.app_dir(:my_app, "priv/iris.csv"))

@@ -234,7 +234,7 @@

iris()

Citation -
Fisher,R. A.. (1988). Iris. UCI Machine Learning Repository. https://doi.org/10.24432/C56C76.
+
Fisher,R. A.. (1988). Iris. UCI Machine Learning Repository. https://doi.org/10.24432/C56C76.
@@ -265,7 +265,7 @@

wine()

Citation -
Aeberhard,Stefan and Forina,M.. (1991). Wine. UCI Machine Learning Repository. https://doi.org/10.24432/C5PC7J.
+
Aeberhard,Stefan and Forina,M.. (1991). Wine. UCI Machine Learning Repository. https://doi.org/10.24432/C5PC7J.
diff --git a/Explorer.PolarsBackend.html b/Explorer.PolarsBackend.html index 14753a50d..cae77d276 100644 --- a/Explorer.PolarsBackend.html +++ b/Explorer.PolarsBackend.html @@ -13,7 +13,7 @@ - + diff --git a/Explorer.Query.html b/Explorer.Query.html index 97878a7e9..3cd3339e1 100644 --- a/Explorer.Query.html +++ b/Explorer.Query.html @@ -13,7 +13,7 @@ - + @@ -116,19 +116,19 @@

Explorer.DataFrame to DF as shown below:

alias Explorer.DataFrame, as: DF

Queries convert regular Elixir code which compile to efficient dataframes operations. Inside a query, only the limited set of Series operations are available and identifiers, such as strs -and nums, represent dataframe column names:

iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
-iex> DF.filter(df, nums > 2)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  strs string ["c"]
-  nums integer [3]
->

If a column has unusual format, you can either rename it before-hand, -or use col/1 inside queries:

iex> df = DF.new("unusual nums": [1, 2, 3])
-iex> DF.filter(df, col("unusual nums") > 2)
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  unusual nums integer [3]
->

All operations from Explorer.Series are imported inside queries. +and nums, represent dataframe column names:

iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
+iex> DF.filter(df, nums > 2)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  strs string ["c"]
+  nums integer [3]
+>

If a column has unusual format, you can either rename it before-hand, +or use col/1 inside queries:

iex> df = DF.new("unusual nums": [1, 2, 3])
+iex> DF.filter(df, col("unusual nums") > 2)
+#Explorer.DataFrame<
+  Polars[1 x 1]
+  unusual nums integer [3]
+>

All operations from Explorer.Series are imported inside queries. This module also provides operators to use in queries, which are also imported into queries.

@@ -144,28 +144,28 @@

If you want to access variables defined outside of the query or get access to all Elixir constructs, you must use ^:

iex> min = 2
-iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
-iex> DF.filter(df, nums > ^min)
-#Explorer.DataFrame<
-  Polars[1 x 2]
-  strs string ["c"]
-  nums integer [3]
->
+iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
+iex> DF.filter(df, nums > ^min)
+#Explorer.DataFrame<
+  Polars[1 x 2]
+  strs string ["c"]
+  nums integer [3]
+>
 
 iex> min = 2
-iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
-iex> DF.filter(df, nums < ^if(min > 0, do: 10, else: -10))
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  strs string ["a", "b", "c"]
-  nums integer [1, 2, 3]
->

^ can be used with col to access columns dynamically:

iex> df = DF.new("unusual nums": [1, 2, 3])
+iex> df = DF.new(strs: ["a", "b", "c"], nums: [1, 2, 3])
+iex> DF.filter(df, nums < ^if(min > 0, do: 10, else: -10))
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  strs string ["a", "b", "c"]
+  nums integer [1, 2, 3]
+>

^ can be used with col to access columns dynamically:

iex> df = DF.new("unusual nums": [1, 2, 3])
 iex> name = "unusual nums"
-iex> DF.filter(df, col(^name) > 2)
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  unusual nums integer [3]
->

+iex> DF.filter(df, col(^name) > 2) +#Explorer.DataFrame< + Polars[1 x 1] + unusual nums integer [3] +>

Across and comprehensions @@ -174,105 +174,105 @@

Explorer.Query leverages the power behind Elixir for-comprehensions to provide a powerful syntax for traversing several columns in a dataframe at once. For example, imagine you want to standardization the data on the -iris dataset, you could write this:

iex> iris = Explorer.Datasets.iris()
-iex> DF.mutate(iris,
-...>   sepal_width: (sepal_width - mean(sepal_width)) / variance(sepal_width),
-...>   sepal_length: (sepal_length - mean(sepal_length)) / variance(sepal_length),
-...>   petal_length: (petal_length - mean(petal_length)) / variance(petal_length),
-...>   petal_width: (petal_width - mean(petal_width)) / variance(petal_width)
-...> )
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
-  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
-  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
-  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->

While the code above does its job, it is quite repetitive. With across and for-comprehensions, -we could instead write:

iex> iris = Explorer.Datasets.iris()
-iex> DF.mutate(iris,
-...>   for col <- across(["sepal_width", "sepal_length", "petal_length", "petal_width"]) do
-...>     {col.name, (col - mean(col)) / variance(col)}
-...>   end
-...> )
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
-  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
-  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
-  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->

Which achieves the same result in a more concise and maintainable way. +iris dataset, you could write this:

iex> iris = Explorer.Datasets.iris()
+iex> DF.mutate(iris,
+...>   sepal_width: (sepal_width - mean(sepal_width)) / variance(sepal_width),
+...>   sepal_length: (sepal_length - mean(sepal_length)) / variance(sepal_length),
+...>   petal_length: (petal_length - mean(petal_length)) / variance(petal_length),
+...>   petal_width: (petal_width - mean(petal_width)) / variance(petal_width)
+...> )
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
+  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
+  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
+  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>

While the code above does its job, it is quite repetitive. With across and for-comprehensions, +we could instead write:

iex> iris = Explorer.Datasets.iris()
+iex> DF.mutate(iris,
+...>   for col <- across(["sepal_width", "sepal_length", "petal_length", "petal_width"]) do
+...>     {col.name, (col - mean(col)) / variance(col)}
+...>   end
+...> )
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
+  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
+  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
+  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>

Which achieves the same result in a more concise and maintainable way. across/1 may receive any of the following input as arguments:

  • a list of columns indexes or names as atoms and strings

  • a range

  • a regex that keeps only the names matching the regex

For example, since we know the width and length columns are the first four, -we could also have written (remember ranges in Elixir are inclusive):

DF.mutate(iris,
-  for col <- across(0..3) do
-    {col.name, (col - mean(col)) / variance(col)}
-  end
-)

Or using a regex:

DF.mutate(iris,
-  for col <- across(~r/(sepal|petal)_(length|width)/) do
-    {col.name, (col - mean(col)) / variance(col)}
-  end
-)

For those new to Elixir, for-comprehensions have the following format:

for PATTERN <- GENERATOR, FILTER do
+we could also have written (remember ranges in Elixir are inclusive):

DF.mutate(iris,
+  for col <- across(0..3) do
+    {col.name, (col - mean(col)) / variance(col)}
+  end
+)

Or using a regex:

DF.mutate(iris,
+  for col <- across(~r/(sepal|petal)_(length|width)/) do
+    {col.name, (col - mean(col)) / variance(col)}
+  end
+)

For those new to Elixir, for-comprehensions have the following format:

for PATTERN <- GENERATOR, FILTER do
   EXPR
-end

A comprehension filter is a mechanism that allows us to keep only columns +end

A comprehension filter is a mechanism that allows us to keep only columns based on additional properties, such as its dtype. A for-comprehension can have multiple generators and filters. For instance, if you want to apply standardization to all float columns, we can use across/0 to access all -columns and then use a filter to keep only the float ones:

iex> iris = Explorer.Datasets.iris()
-iex> DF.mutate(iris,
-...>   for col <- across(), col.dtype == :float do
-...>     {col.name, (col - mean(col)) / variance(col)}
-...>   end
-...> )
-#Explorer.DataFrame<
-  Polars[150 x 5]
-  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
-  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
-  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
-  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
-  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
->

For-comprehensions works with all dataframe verbs. As we have seen +columns and then use a filter to keep only the float ones:

iex> iris = Explorer.Datasets.iris()
+iex> DF.mutate(iris,
+...>   for col <- across(), col.dtype == :float do
+...>     {col.name, (col - mean(col)) / variance(col)}
+...>   end
+...> )
+#Explorer.DataFrame<
+  Polars[150 x 5]
+  sepal_length float [-1.0840606189132314, -1.3757361217598396, -1.6674116246064494, -1.8132493760297548, -1.2298983703365356, ...]
+  sepal_width float [2.372289612531505, -0.28722789030650403, 0.7765791108287006, 0.24467561026109824, 2.904193113099107, ...]
+  petal_length float [-0.7576391687443842, -0.7576391687443842, -0.7897606710936372, -0.725517666395131, -0.7576391687443842, ...]
+  petal_width float [-1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, -1.7147014356654704, ...]
+  species string ["Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", "Iris-setosa", ...]
+>

For-comprehensions works with all dataframe verbs. As we have seen above, for mutations we must return tuples as pair with the mutation name and its value. summarise works similarly. Note in both cases the name could also be generated dynamically. For example, to compute -the mean per species, you could write:

iex> Explorer.Datasets.iris()
-...> |> DF.group_by("species")
-...> |> DF.summarise(
-...>   for col <- across(), col.dtype == :float do
-...>     {"#{col.name}_mean", mean(col)}
-...>   end
-...> )
-#Explorer.DataFrame<
-  Polars[3 x 5]
-  species string ["Iris-setosa", "Iris-versicolor", "Iris-virginica"]
-  sepal_length_mean float [5.005999999999999, 5.936, 6.587999999999998]
-  sepal_width_mean float [3.4180000000000006, 2.7700000000000005, 2.9739999999999998]
-  petal_length_mean float [1.464, 4.26, 5.552]
-  petal_width_mean float [0.2439999999999999, 1.3259999999999998, 2.026]
->

arrange expects a list of columns to sort by, while for-comprehensions +the mean per species, you could write:

iex> Explorer.Datasets.iris()
+...> |> DF.group_by("species")
+...> |> DF.summarise(
+...>   for col <- across(), col.dtype == :float do
+...>     {"#{col.name}_mean", mean(col)}
+...>   end
+...> )
+#Explorer.DataFrame<
+  Polars[3 x 5]
+  species string ["Iris-setosa", "Iris-versicolor", "Iris-virginica"]
+  sepal_length_mean float [5.005999999999999, 5.936, 6.587999999999998]
+  sepal_width_mean float [3.4180000000000006, 2.7700000000000005, 2.9739999999999998]
+  petal_length_mean float [1.464, 4.26, 5.552]
+  petal_width_mean float [0.2439999999999999, 1.3259999999999998, 2.026]
+>

arrange expects a list of columns to sort by, while for-comprehensions in filter generate a list of conditions, which are joined using and. For example, to filter all entries have both sepal and petal length above -average, using a filter on the column name, one could write:

iex> iris = Explorer.Datasets.iris()
-iex> DF.filter(iris,
-...>   for col <- across(), String.ends_with?(col.name, "_length") do
-...>     col > mean(col)
-...>   end
-...> )
-#Explorer.DataFrame<
-  Polars[70 x 5]
-  sepal_length float [7.0, 6.4, 6.9, 6.5, 6.3, ...]
-  sepal_width float [3.2, 3.2, 3.1, 2.8, 3.3, ...]
-  petal_length float [4.7, 4.5, 4.9, 4.6, 4.7, ...]
-  petal_width float [1.4, 1.5, 1.5, 1.5, 1.6, ...]
-  species string ["Iris-versicolor", "Iris-versicolor", "Iris-versicolor", "Iris-versicolor", "Iris-versicolor", ...]
->

Do not mix comprehension and queries

The filter inside a for-comprehension works at the meta level: +average, using a filter on the column name, one could write:

iex> iris = Explorer.Datasets.iris()
+iex> DF.filter(iris,
+...>   for col <- across(), String.ends_with?(col.name, "_length") do
+...>     col > mean(col)
+...>   end
+...> )
+#Explorer.DataFrame<
+  Polars[70 x 5]
+  sepal_length float [7.0, 6.4, 6.9, 6.5, 6.3, ...]
+  sepal_width float [3.2, 3.2, 3.1, 2.8, 3.3, ...]
+  petal_length float [4.7, 4.5, 4.9, 4.6, 4.7, ...]
+  petal_width float [1.4, 1.5, 1.5, 1.5, 1.6, ...]
+  species string ["Iris-versicolor", "Iris-versicolor", "Iris-versicolor", "Iris-versicolor", "Iris-versicolor", ...]
+>

Do not mix comprehension and queries

The filter inside a for-comprehension works at the meta level: it can only filter columns based on their names and dtypes, but not on their values. For example, this code does not make any -sense and it will fail to compile:

|> DF.filter(
-  for col <- across(), col > mean(col) do
+sense and it will fail to compile:

|> DF.filter(
+  for col <- across(), col > mean(col) do
     col
-  end
-end)

Another way to think about it, the comprehensions traverse on the + end +end)

Another way to think about it, the comprehensions traverse on the columns themselves, the contents inside the comprehension do-block traverse on the values inside the columns.

@@ -281,7 +281,7 @@

Queries simply become lazy dataframe operations at runtime. -For example, the following query

Explorer.DataFrame.filter(df, nums > 2)

is equivalent to

Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df["nums"], 2) end)

This means that, whenever you want to generate queries programatically, +For example, the following query

Explorer.DataFrame.filter(df, nums > 2)

is equivalent to

Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df["nums"], 2) end)

This means that, whenever you want to generate queries programatically, you can fallback to the regular _with APIs.

@@ -738,9 +738,9 @@

left <> right

Examples

-
DF.mutate(df, name: first_name <> " " <> last_name)

If you want to convert concatenate non-string +

DF.mutate(df, name: first_name <> " " <> last_name)

If you want to convert concatenate non-string series, you can explicitly cast them to string -before:

DF.mutate(df, name: cast(year, :string) <> "-" <> cast(month, :string))

Or use format:

DF.mutate(df, name: format([year, "-", month]))
+before:

DF.mutate(df, name: cast(year, :string) <> "-" <> cast(month, :string))

Or use format:

DF.mutate(df, name: format([year, "-", month]))
@@ -880,20 +880,20 @@

col(name)

Accesses a column by name.

If your column name contains whitespace or start with uppercase letters, you can still access its name by -using this macro:

iex> df = Explorer.DataFrame.new("unusual nums": [1, 2, 3])
-iex> Explorer.DataFrame.filter(df, col("unusual nums") > 2)
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  unusual nums integer [3]
->

name must be an atom, a string, or an integer. +using this macro:

iex> df = Explorer.DataFrame.new("unusual nums": [1, 2, 3])
+iex> Explorer.DataFrame.filter(df, col("unusual nums") > 2)
+#Explorer.DataFrame<
+  Polars[1 x 1]
+  unusual nums integer [3]
+>

name must be an atom, a string, or an integer. It is equivalent to df[name] but inside a query.

This can also be used if you want to access a column -programatically, for example:

iex> df = Explorer.DataFrame.new(nums: [1, 2, 3])
+programatically, for example:

iex> df = Explorer.DataFrame.new(nums: [1, 2, 3])
 iex> name = :nums
-iex> Explorer.DataFrame.filter(df, col(^name) > 2)
-#Explorer.DataFrame<
-  Polars[1 x 1]
-  nums integer [3]
->

For traversing multiple columns programatically, +iex> Explorer.DataFrame.filter(df, col(^name) > 2) +#Explorer.DataFrame< + Polars[1 x 1] + nums integer [3] +>

For traversing multiple columns programatically, see across/0 and across/1.

diff --git a/Explorer.Series.html b/Explorer.Series.html index 5fa38d583..e2f8e6084 100644 --- a/Explorer.Series.html +++ b/Explorer.Series.html @@ -13,7 +13,7 @@ - + @@ -124,19 +124,19 @@

Creating series

-

Series can be created using from_list/2, from_binary/3, and friends:

Series can be made of numbers:

iex> Explorer.Series.from_list([1, 2, 3])
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->

Series are nullable, so you may also include nils:

iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])
-#Explorer.Series<
-  Polars[4]
-  float [1.0, nil, 2.5, 3.1]
->

Any of the dtypes above are supported, such as strings:

iex> Explorer.Series.from_list(["foo", "bar", "baz"])
-#Explorer.Series<
-  Polars[3]
-  string ["foo", "bar", "baz"]
->
+

Series can be created using from_list/2, from_binary/3, and friends:

Series can be made of numbers:

iex> Explorer.Series.from_list([1, 2, 3])
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>

Series are nullable, so you may also include nils:

iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])
+#Explorer.Series<
+  Polars[4]
+  float [1.0, nil, 2.5, 3.1]
+>

Any of the dtypes above are supported, such as strings:

iex> Explorer.Series.from_list(["foo", "bar", "baz"])
+#Explorer.Series<
+  Polars[3]
+  string ["foo", "bar", "baz"]
+>
@@ -1848,36 +1848,36 @@

from_binary(binary, dtype, opts \\ [])

Examples -

Integers and floats follow their native encoding:

iex> Explorer.Series.from_binary(<<1.0::float-64-native, 2.0::float-64-native>>, :float)
-#Explorer.Series<
-  Polars[2]
-  float [1.0, 2.0]
->
-
-iex> Explorer.Series.from_binary(<<-1::signed-64-native, 1::signed-64-native>>, :integer)
-#Explorer.Series<
-  Polars[2]
-  integer [-1, 1]
->

Booleans are unsigned integers:

iex> Explorer.Series.from_binary(<<1, 0, 1>>, :boolean)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, true]
->

Dates are encoded as i32 representing days from the Unix epoch (1970-01-01):

iex> binary = <<-719162::signed-32-native, 0::signed-32-native, 6129::signed-32-native>>
-iex> Explorer.Series.from_binary(binary, :date)
-#Explorer.Series<
-  Polars[3]
-  date [0001-01-01, 1970-01-01, 1986-10-13]
->

Times are encoded as i64 representing nanoseconds from midnight:

iex> binary = <<0::signed-64-native, 86399999999000::signed-64-native>>
-iex> Explorer.Series.from_binary(binary, :time)
-#Explorer.Series<
-  Polars[2]
-  time [00:00:00.000000, 23:59:59.999999]
->

Datetimes are encoded as i64 representing microseconds from the Unix epoch (1970-01-01):

iex> binary = <<0::signed-64-native, 529550625987654::signed-64-native>>
-iex> Explorer.Series.from_binary(binary, {:datetime, :microsecond})
-#Explorer.Series<
-  Polars[2]
-  datetime[Ī¼s] [1970-01-01 00:00:00.000000, 1986-10-13 01:23:45.987654]
->
+

Integers and floats follow their native encoding:

iex> Explorer.Series.from_binary(<<1.0::float-64-native, 2.0::float-64-native>>, :float)
+#Explorer.Series<
+  Polars[2]
+  float [1.0, 2.0]
+>
+
+iex> Explorer.Series.from_binary(<<-1::signed-64-native, 1::signed-64-native>>, :integer)
+#Explorer.Series<
+  Polars[2]
+  integer [-1, 1]
+>

Booleans are unsigned integers:

iex> Explorer.Series.from_binary(<<1, 0, 1>>, :boolean)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, true]
+>

Dates are encoded as i32 representing days from the Unix epoch (1970-01-01):

iex> binary = <<-719162::signed-32-native, 0::signed-32-native, 6129::signed-32-native>>
+iex> Explorer.Series.from_binary(binary, :date)
+#Explorer.Series<
+  Polars[3]
+  date [0001-01-01, 1970-01-01, 1986-10-13]
+>

Times are encoded as i64 representing nanoseconds from midnight:

iex> binary = <<0::signed-64-native, 86399999999000::signed-64-native>>
+iex> Explorer.Series.from_binary(binary, :time)
+#Explorer.Series<
+  Polars[2]
+  time [00:00:00.000000, 23:59:59.999999]
+>

Datetimes are encoded as i64 representing microseconds from the Unix epoch (1970-01-01):

iex> binary = <<0::signed-64-native, 529550625987654::signed-64-native>>
+iex> Explorer.Series.from_binary(binary, {:datetime, :microsecond})
+#Explorer.Series<
+  Polars[2]
+  datetime[Ī¼s] [1970-01-01 00:00:00.000000, 1986-10-13 01:23:45.987654]
+>
@@ -1921,70 +1921,70 @@

from_list(list, opts \\ [])

Examples -

Explorer will infer the type from the values in the list:

iex> Explorer.Series.from_list([1, 2, 3])
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->

Series are nullable, so you may also include nils:

iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])
-#Explorer.Series<
-  Polars[4]
-  float [1.0, nil, 2.5, 3.1]
->

A mix of integers and floats will be cast to a float:

iex> Explorer.Series.from_list([1, 2.0])
-#Explorer.Series<
-  Polars[2]
-  float [1.0, 2.0]
->

Floats series can accept NaN, Inf, and -Inf values:

iex> Explorer.Series.from_list([1.0, 2.0, :nan, 4.0])
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, NaN, 4.0]
->
-
-iex> Explorer.Series.from_list([1.0, 2.0, :infinity, 4.0])
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, Inf, 4.0]
->
-
-iex> Explorer.Series.from_list([1.0, 2.0, :neg_infinity, 4.0])
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, -Inf, 4.0]
->

Trying to create a "nil" series will, by default, result in a series of floats:

iex> Explorer.Series.from_list([nil, nil])
-#Explorer.Series<
-  Polars[2]
-  float [nil, nil]
->

You can specify the desired dtype for a series with the :dtype option.

iex> Explorer.Series.from_list([nil, nil], dtype: :integer)
-#Explorer.Series<
-  Polars[2]
-  integer [nil, nil]
->
-
-iex> Explorer.Series.from_list([1, nil], dtype: :string)
-#Explorer.Series<
-  Polars[2]
-  string ["1", nil]
->

The dtype option is particulary important if a :binary series is desired, because -by default binary series will have the dtype of :string:

iex> Explorer.Series.from_list([<<228, 146, 51>>, <<42, 209, 236>>], dtype: :binary)
-#Explorer.Series<
-  Polars[2]
-  binary [<<228, 146, 51>>, <<42, 209, 236>>]
->

A series mixing UTF8 strings and binaries is possible:

iex> Explorer.Series.from_list([<<228, 146, 51>>, "Elixir"], dtype: :binary)
-#Explorer.Series<
-  Polars[2]
-  binary [<<228, 146, 51>>, "Elixir"]
->

Another option is to create a categorical series from a list of strings:

iex> Explorer.Series.from_list(["EUA", "Brazil", "Poland"], dtype: :category)
-#Explorer.Series<
-  Polars[3]
-  category ["EUA", "Brazil", "Poland"]
->

It is possible to create a series of :datetime from a list of microseconds since Unix Epoch.

iex> Explorer.Series.from_list([1649883642 * 1_000 * 1_000], dtype: {:datetime, :microsecond})
-#Explorer.Series<
-  Polars[1]
-  datetime[Ī¼s] [2022-04-13 21:00:42.000000]
->

It is possible to create a series of :time from a list of nanoseconds since midnight.

iex> Explorer.Series.from_list([123 * 1_000 * 1_000 * 1_000], dtype: :time)
-#Explorer.Series<
-  Polars[1]
-  time [00:02:03.000000]
->

Mixing non-numeric data types will raise an ArgumentError:

iex> Explorer.Series.from_list([1, "a"])
+

Explorer will infer the type from the values in the list:

iex> Explorer.Series.from_list([1, 2, 3])
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>

Series are nullable, so you may also include nils:

iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])
+#Explorer.Series<
+  Polars[4]
+  float [1.0, nil, 2.5, 3.1]
+>

A mix of integers and floats will be cast to a float:

iex> Explorer.Series.from_list([1, 2.0])
+#Explorer.Series<
+  Polars[2]
+  float [1.0, 2.0]
+>

Floats series can accept NaN, Inf, and -Inf values:

iex> Explorer.Series.from_list([1.0, 2.0, :nan, 4.0])
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, NaN, 4.0]
+>
+
+iex> Explorer.Series.from_list([1.0, 2.0, :infinity, 4.0])
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, Inf, 4.0]
+>
+
+iex> Explorer.Series.from_list([1.0, 2.0, :neg_infinity, 4.0])
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, -Inf, 4.0]
+>

Trying to create a "nil" series will, by default, result in a series of floats:

iex> Explorer.Series.from_list([nil, nil])
+#Explorer.Series<
+  Polars[2]
+  float [nil, nil]
+>

You can specify the desired dtype for a series with the :dtype option.

iex> Explorer.Series.from_list([nil, nil], dtype: :integer)
+#Explorer.Series<
+  Polars[2]
+  integer [nil, nil]
+>
+
+iex> Explorer.Series.from_list([1, nil], dtype: :string)
+#Explorer.Series<
+  Polars[2]
+  string ["1", nil]
+>

The dtype option is particulary important if a :binary series is desired, because +by default binary series will have the dtype of :string:

iex> Explorer.Series.from_list([<<228, 146, 51>>, <<42, 209, 236>>], dtype: :binary)
+#Explorer.Series<
+  Polars[2]
+  binary [<<228, 146, 51>>, <<42, 209, 236>>]
+>

A series mixing UTF8 strings and binaries is possible:

iex> Explorer.Series.from_list([<<228, 146, 51>>, "Elixir"], dtype: :binary)
+#Explorer.Series<
+  Polars[2]
+  binary [<<228, 146, 51>>, "Elixir"]
+>

Another option is to create a categorical series from a list of strings:

iex> Explorer.Series.from_list(["EUA", "Brazil", "Poland"], dtype: :category)
+#Explorer.Series<
+  Polars[3]
+  category ["EUA", "Brazil", "Poland"]
+>

It is possible to create a series of :datetime from a list of microseconds since Unix Epoch.

iex> Explorer.Series.from_list([1649883642 * 1_000 * 1_000], dtype: {:datetime, :microsecond})
+#Explorer.Series<
+  Polars[1]
+  datetime[Ī¼s] [2022-04-13 21:00:42.000000]
+>

It is possible to create a series of :time from a list of nanoseconds since midnight.

iex> Explorer.Series.from_list([123 * 1_000 * 1_000 * 1_000], dtype: :time)
+#Explorer.Series<
+  Polars[1]
+  time [00:02:03.000000]
+>

Mixing non-numeric data types will raise an ArgumentError:

iex> Explorer.Series.from_list([1, "a"])
 ** (ArgumentError) the value "a" does not match the inferred series dtype :integer
@@ -2027,40 +2027,40 @@

from_tensor(tensor, opts \\ [])

Examples -

Integers and floats:

iex> tensor = Nx.tensor([1, 2, 3])
-iex> Explorer.Series.from_tensor(tensor)
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->
-
-iex> tensor = Nx.tensor([1.0, 2.0, 3.0], type: :f64)
-iex> Explorer.Series.from_tensor(tensor)
-#Explorer.Series<
-  Polars[3]
-  float [1.0, 2.0, 3.0]
->

Unsigned 8-bit tensors are assumed to be booleans:

iex> tensor = Nx.tensor([1, 0, 1], type: :u8)
-iex> Explorer.Series.from_tensor(tensor)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, true]
->

Signed 32-bit tensors are assumed to be dates:

iex> tensor = Nx.tensor([-719162, 0, 6129], type: :s32)
-iex> Explorer.Series.from_tensor(tensor)
-#Explorer.Series<
-  Polars[3]
-  date [0001-01-01, 1970-01-01, 1986-10-13]
->

Times are signed 64-bit representing nanoseconds from midnight and -therefore must have their dtype explicitly given:

iex> tensor = Nx.tensor([0, 86399999999000])
-iex> Explorer.Series.from_tensor(tensor, dtype: :time)
-#Explorer.Series<
-  Polars[2]
-  time [00:00:00.000000, 23:59:59.999999]
->

Datetimes are signed 64-bit and therefore must have their dtype explicitly given:

iex> tensor = Nx.tensor([0, 529550625987654])
-iex> Explorer.Series.from_tensor(tensor, dtype: {:datetime, :microsecond})
-#Explorer.Series<
-  Polars[2]
-  datetime[Ī¼s] [1970-01-01 00:00:00.000000, 1986-10-13 01:23:45.987654]
->
+

Integers and floats:

iex> tensor = Nx.tensor([1, 2, 3])
+iex> Explorer.Series.from_tensor(tensor)
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>
+
+iex> tensor = Nx.tensor([1.0, 2.0, 3.0], type: :f64)
+iex> Explorer.Series.from_tensor(tensor)
+#Explorer.Series<
+  Polars[3]
+  float [1.0, 2.0, 3.0]
+>

Unsigned 8-bit tensors are assumed to be booleans:

iex> tensor = Nx.tensor([1, 0, 1], type: :u8)
+iex> Explorer.Series.from_tensor(tensor)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, true]
+>

Signed 32-bit tensors are assumed to be dates:

iex> tensor = Nx.tensor([-719162, 0, 6129], type: :s32)
+iex> Explorer.Series.from_tensor(tensor)
+#Explorer.Series<
+  Polars[3]
+  date [0001-01-01, 1970-01-01, 1986-10-13]
+>

Times are signed 64-bit representing nanoseconds from midnight and +therefore must have their dtype explicitly given:

iex> tensor = Nx.tensor([0, 86399999999000])
+iex> Explorer.Series.from_tensor(tensor, dtype: :time)
+#Explorer.Series<
+  Polars[2]
+  time [00:00:00.000000, 23:59:59.999999]
+>

Datetimes are signed 64-bit and therefore must have their dtype explicitly given:

iex> tensor = Nx.tensor([0, 529550625987654])
+iex> Explorer.Series.from_tensor(tensor, dtype: {:datetime, :microsecond})
+#Explorer.Series<
+  Polars[2]
+  datetime[Ī¼s] [1970-01-01 00:00:00.000000, 1986-10-13 01:23:45.987654]
+>
@@ -2096,28 +2096,28 @@

replace(series, tensor_or_list)

Tensor examples -
iex> s = Explorer.Series.from_list([0, 1, 2])
-iex> Explorer.Series.replace(s, Nx.tensor([1, 2, 3]))
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->

This is particularly useful for categorical columns:

iex> s = Explorer.Series.from_list(["foo", "bar", "baz"], dtype: :category)
-iex> Explorer.Series.replace(s, Nx.tensor([2, 1, 0]))
-#Explorer.Series<
-  Polars[3]
-  category ["baz", "bar", "foo"]
->

+
iex> s = Explorer.Series.from_list([0, 1, 2])
+iex> Explorer.Series.replace(s, Nx.tensor([1, 2, 3]))
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>

This is particularly useful for categorical columns:

iex> s = Explorer.Series.from_list(["foo", "bar", "baz"], dtype: :category)
+iex> Explorer.Series.replace(s, Nx.tensor([2, 1, 0]))
+#Explorer.Series<
+  Polars[3]
+  category ["baz", "bar", "foo"]
+>

List examples

-

Similar to tensors, we can also replace by lists:

iex> s = Explorer.Series.from_list([0, 1, 2])
-iex> Explorer.Series.replace(s, [1, 2, 3, 4, 5])
-#Explorer.Series<
-  Polars[5]
-  integer [1, 2, 3, 4, 5]
->

The same considerations as above apply.

+

Similar to tensors, we can also replace by lists:

iex> s = Explorer.Series.from_list([0, 1, 2])
+iex> Explorer.Series.replace(s, [1, 2, 3, 4, 5])
+#Explorer.Series<
+  Polars[5]
+  integer [1, 2, 3, 4, 5]
+>

The same considerations as above apply.

@@ -2152,13 +2152,13 @@

to_binary(series)

Examples -
iex> series = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.to_binary(series)
-<<1::signed-64-native, 2::signed-64-native, 3::signed-64-native>>
+
iex> series = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.to_binary(series)
+<<1::signed-64-native, 2::signed-64-native, 3::signed-64-native>>
 
-iex> series = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.to_binary(series)
-<<1, 0, 1>>
+
iex> series = Explorer.Series.from_list([true, false, true]) +iex> Explorer.Series.to_binary(series) +<<1, 0, 1>>
@@ -2195,9 +2195,9 @@

to_enum(series)

Examples -
iex> series = Explorer.Series.from_list([1, 2, 3])
-iex> series |> Explorer.Series.to_enum() |> Enum.to_list()
-[1, 2, 3]
+
iex> series = Explorer.Series.from_list([1, 2, 3])
+iex> series |> Explorer.Series.to_enum() |> Enum.to_list()
+[1, 2, 3]
@@ -2236,27 +2236,27 @@

to_iovec(series)

Examples -

Integers and floats follow their native encoding:

iex> series = Explorer.Series.from_list([-1, 0, 1])
-iex> Explorer.Series.to_iovec(series)
-[<<-1::signed-64-native, 0::signed-64-native, 1::signed-64-native>>]
-
-iex> series = Explorer.Series.from_list([1.0, 2.0, 3.0])
-iex> Explorer.Series.to_iovec(series)
-[<<1.0::float-64-native, 2.0::float-64-native, 3.0::float-64-native>>]

Booleans are encoded as 0 and 1:

iex> series = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.to_iovec(series)
-[<<1, 0, 1>>]

Dates are encoded as i32 representing days from the Unix epoch (1970-01-01):

iex> series = Explorer.Series.from_list([~D[0001-01-01], ~D[1970-01-01], ~D[1986-10-13]])
-iex> Explorer.Series.to_iovec(series)
-[<<-719162::signed-32-native, 0::signed-32-native, 6129::signed-32-native>>]

Times are encoded as i64 representing nanoseconds from midnight:

iex> series = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])
-iex> Explorer.Series.to_iovec(series)
-[<<0::signed-64-native, 86399999999000::signed-64-native>>]

Datetimes are encoded as i64 representing their precision from the Unix epoch (1970-01-01):

iex> series = Explorer.Series.from_list([~N[0001-01-01 00:00:00], ~N[1970-01-01 00:00:00], ~N[1986-10-13 01:23:45.987654]])
-iex> Explorer.Series.to_iovec(series)
-[<<-62135596800000000::signed-64-native, 0::signed-64-native, 529550625987654::signed-64-native>>]

The operation raises for binaries and strings, as they do not provide a fixed-width -binary representation:

iex> s = Explorer.Series.from_list(["a", "b", "c", "b"])
-iex> Explorer.Series.to_iovec(s)
+

Integers and floats follow their native encoding:

iex> series = Explorer.Series.from_list([-1, 0, 1])
+iex> Explorer.Series.to_iovec(series)
+[<<-1::signed-64-native, 0::signed-64-native, 1::signed-64-native>>]
+
+iex> series = Explorer.Series.from_list([1.0, 2.0, 3.0])
+iex> Explorer.Series.to_iovec(series)
+[<<1.0::float-64-native, 2.0::float-64-native, 3.0::float-64-native>>]

Booleans are encoded as 0 and 1:

iex> series = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.to_iovec(series)
+[<<1, 0, 1>>]

Dates are encoded as i32 representing days from the Unix epoch (1970-01-01):

iex> series = Explorer.Series.from_list([~D[0001-01-01], ~D[1970-01-01], ~D[1986-10-13]])
+iex> Explorer.Series.to_iovec(series)
+[<<-719162::signed-32-native, 0::signed-32-native, 6129::signed-32-native>>]

Times are encoded as i64 representing nanoseconds from midnight:

iex> series = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])
+iex> Explorer.Series.to_iovec(series)
+[<<0::signed-64-native, 86399999999000::signed-64-native>>]

Datetimes are encoded as i64 representing their precision from the Unix epoch (1970-01-01):

iex> series = Explorer.Series.from_list([~N[0001-01-01 00:00:00], ~N[1970-01-01 00:00:00], ~N[1986-10-13 01:23:45.987654]])
+iex> Explorer.Series.to_iovec(series)
+[<<-62135596800000000::signed-64-native, 0::signed-64-native, 529550625987654::signed-64-native>>]

The operation raises for binaries and strings, as they do not provide a fixed-width +binary representation:

iex> s = Explorer.Series.from_list(["a", "b", "c", "b"])
+iex> Explorer.Series.to_iovec(s)
 ** (ArgumentError) cannot convert series of dtype :string into iovec

However, if appropriate, you can convert them to categorical types, -which will then return the index of each category:

iex> series = Explorer.Series.from_list(["a", "b", "c", "b"], dtype: :category)
-iex> Explorer.Series.to_iovec(series)
-[<<0::unsigned-32-native, 1::unsigned-32-native, 2::unsigned-32-native, 1::unsigned-32-native>>]
+which will then return the index of each category:

iex> series = Explorer.Series.from_list(["a", "b", "c", "b"], dtype: :category)
+iex> Explorer.Series.to_iovec(series)
+[<<0::unsigned-32-native, 1::unsigned-32-native, 2::unsigned-32-native, 1::unsigned-32-native>>]
@@ -2293,9 +2293,9 @@

to_list(series)

Examples -
iex> series = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.to_list(series)
-[1, 2, 3]
+
iex> series = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.to_list(series)
+[1, 2, 3]
@@ -2339,19 +2339,19 @@

to_tensor(series, tensor_opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.to_tensor(s)
-#Nx.Tensor<
-  s64[3]
-  [1, 2, 3]
->
+
iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.to_tensor(s)
+#Nx.Tensor<
+  s64[3]
+  [1, 2, 3]
+>
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.to_tensor(s)
-#Nx.Tensor<
-  u8[3]
-  [1, 0, 1]
->
+
iex> s = Explorer.Series.from_list([true, false, true]) +iex> Explorer.Series.to_tensor(s) +#Nx.Tensor< + u8[3] + [1, 0, 1] +>
@@ -2403,28 +2403,28 @@

argmax(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.argmax(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.argmax(s)
 3
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.argmax(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.argmax(s)
 3
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.argmax(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.argmax(s)
 0
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.argmax(s)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.argmax(s)
 0
 
-iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
-iex> Explorer.Series.argmax(s)
+iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
+iex> Explorer.Series.argmax(s)
 1
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.argmax(s)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.argmax(s)
 ** (ArgumentError) Explorer.Series.argmax/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]
@@ -2465,28 +2465,28 @@

argmin(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.argmin(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.argmin(s)
 2
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.argmin(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.argmin(s)
 2
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.argmin(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.argmin(s)
 1
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.argmin(s)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.argmin(s)
 1
 
-iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
-iex> Explorer.Series.argmin(s)
+iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
+iex> Explorer.Series.argmin(s)
 0
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.argmin(s)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.argmin(s)
 ** (ArgumentError) Explorer.Series.argmin/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]
@@ -2531,9 +2531,9 @@

correlation(left, right, ddof \\ 1)

Examples -
iex> s1 = Series.from_list([1, 8, 3])
-iex> s2 = Series.from_list([4, 5, 2])
-iex> Series.correlation(s1, s2)
+
iex> s1 = Series.from_list([1, 8, 3])
+iex> s2 = Series.from_list([4, 5, 2])
+iex> Series.correlation(s1, s2)
 0.5447047794019223
@@ -2565,8 +2565,8 @@

count(series)

Examples -
iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.count(s)
+
iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.count(s)
 3
@@ -2607,9 +2607,9 @@

covariance(left, right)

Examples -
iex> s1 = Series.from_list([1, 8, 3])
-iex> s2 = Series.from_list([4, 5, 2])
-iex> Series.covariance(s1, s2)
+
iex> s1 = Series.from_list([1, 8, 3])
+iex> s2 = Series.from_list([4, 5, 2])
+iex> Series.covariance(s1, s2)
 3.0
@@ -2650,14 +2650,14 @@

cut(series, bins, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0])
-iex> Explorer.Series.cut(s, [1.5, 2.5])
-#Explorer.DataFrame<
-  Polars[3 x 3]
-  values float [1.0, 2.0, 3.0]
-  break_point float [1.5, 2.5, Inf]
-  category category ["(-inf, 1.5]", "(1.5, 2.5]", "(2.5, inf]"]
->
+
iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0])
+iex> Explorer.Series.cut(s, [1.5, 2.5])
+#Explorer.DataFrame<
+  Polars[3 x 3]
+  values float [1.0, 2.0, 3.0]
+  break_point float [1.5, 2.5, Inf]
+  category category ["(-inf, 1.5]", "(1.5, 2.5]", "(2.5, inf]"]
+>
@@ -2685,13 +2685,13 @@

frequencies(series)

Examples -
iex> s = Explorer.Series.from_list(["a", "a", "b", "c", "c", "c"])
-iex> Explorer.Series.frequencies(s)
-#Explorer.DataFrame<
-  Polars[3 x 2]
-  values string ["c", "a", "b"]
-  counts integer [3, 2, 1]
->
+
iex> s = Explorer.Series.from_list(["a", "a", "b", "c", "c", "c"])
+iex> Explorer.Series.frequencies(s)
+#Explorer.DataFrame<
+  Polars[3 x 2]
+  values string ["c", "a", "b"]
+  counts integer [3, 2, 1]
+>
@@ -2732,28 +2732,28 @@

max(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.max(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.max(s)
 3
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.max(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.max(s)
 3.0
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.max(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.max(s)
 ~D[2021-01-01]
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.max(s)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.max(s)
 ~N[2021-01-01 00:00:00.000000]
 
-iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
-iex> Explorer.Series.max(s)
+iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])
+iex> Explorer.Series.max(s)
 ~T[00:05:04.000456]
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.max(s)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.max(s)
 ** (ArgumentError) Explorer.Series.max/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]
@@ -2794,16 +2794,16 @@

mean(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.mean(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.mean(s)
 2.0
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.mean(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.mean(s)
 2.0
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.mean(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.mean(s)
 ** (ArgumentError) Explorer.Series.mean/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]
@@ -2844,16 +2844,16 @@

median(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.median(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.median(s)
 2.0
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.median(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.median(s)
 2.0
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.median(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.median(s)
 ** (ArgumentError) Explorer.Series.median/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]
@@ -2895,28 +2895,28 @@

min(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.min(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.min(s)
 1
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.min(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.min(s)
 1.0
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.min(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.min(s)
 ~D[1999-12-31]
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.min(s)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.min(s)
 ~N[1999-12-31 00:00:00.000000]
 
-iex> s = Explorer.Series.from_list([~T[00:02:03.000451], ~T[00:05:04.000134]])
-iex> Explorer.Series.min(s)
+iex> s = Explorer.Series.from_list([~T[00:02:03.000451], ~T[00:05:04.000134]])
+iex> Explorer.Series.min(s)
 ~T[00:02:03.000451]
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.min(s)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.min(s)
 ** (ArgumentError) Explorer.Series.min/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]
@@ -2945,8 +2945,8 @@

n_distinct(series)

Examples -
iex> s = Explorer.Series.from_list(["a", "b", "a", "b"])
-iex> Explorer.Series.n_distinct(s)
+
iex> s = Explorer.Series.from_list(["a", "b", "a", "b"])
+iex> Explorer.Series.n_distinct(s)
 2
@@ -2975,8 +2975,8 @@

nil_count(series)

Examples -
iex> s = Explorer.Series.from_list(["a", nil, "c", nil, nil])
-iex> Explorer.Series.nil_count(s)
+
iex> s = Explorer.Series.from_list(["a", nil, "c", nil, nil])
+iex> Explorer.Series.nil_count(s)
 3
@@ -3017,12 +3017,12 @@

product(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.product(s)
+
iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.product(s)
 6
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.product(s)
+iex> s = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.product(s)
 ** (ArgumentError) Explorer.Series.product/1 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]
@@ -3064,14 +3064,14 @@

qcut(series, quantiles, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0, 4.0, 5.0])
-iex> Explorer.Series.qcut(s, [0.25, 0.75])
-#Explorer.DataFrame<
-  Polars[5 x 3]
-  values float [1.0, 2.0, 3.0, 4.0, 5.0]
-  break_point float [2.0, 2.0, 4.0, 4.0, Inf]
-  category category ["(-inf, 2]", "(-inf, 2]", "(2, 4]", "(2, 4]", "(4, inf]"]
->
+
iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0, 4.0, 5.0])
+iex> Explorer.Series.qcut(s, [0.25, 0.75])
+#Explorer.DataFrame<
+  Polars[5 x 3]
+  values float [1.0, 2.0, 3.0, 4.0, 5.0]
+  break_point float [2.0, 2.0, 4.0, 4.0, Inf]
+  category category ["(-inf, 2]", "(-inf, 2]", "(2, 4]", "(2, 4]", "(4, inf]"]
+>
@@ -3111,28 +3111,28 @@

quantile(series, quantile)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.quantile(s, 0.2)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.quantile(s, 0.2)
 1
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.quantile(s, 0.5)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.quantile(s, 0.5)
 2.0
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.quantile(s, 0.5)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.quantile(s, 0.5)
 ~D[2021-01-01]
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.quantile(s, 0.5)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.quantile(s, 0.5)
 ~N[2021-01-01 00:00:00.000000]
 
-iex> s = Explorer.Series.from_list([~T[01:55:00], ~T[15:35:00], ~T[23:00:00]])
-iex> Explorer.Series.quantile(s, 0.5)
+iex> s = Explorer.Series.from_list([~T[01:55:00], ~T[15:35:00], ~T[23:00:00]])
+iex> Explorer.Series.quantile(s, 0.5)
 ~T[15:35:00]
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.quantile(s, 0.5)
+iex> s = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.quantile(s, 0.5)
 ** (ArgumentError) Explorer.Series.quantile/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]
@@ -3177,24 +3177,24 @@

skew(series, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])
-iex> Explorer.Series.skew(s)
+
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])
+iex> Explorer.Series.skew(s)
 1.6727687946848508
 
-iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])
-iex> Explorer.Series.skew(s, bias: false)
+iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])
+iex> Explorer.Series.skew(s, bias: false)
 2.2905330058490514
 
-iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])
-iex> Explorer.Series.skew(s, bias: false)
+iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])
+iex> Explorer.Series.skew(s, bias: false)
 0.8545630383279712
 
-iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])
-iex> Explorer.Series.skew(s)
+iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])
+iex> Explorer.Series.skew(s)
 0.49338220021815865
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.skew(s, false)
+iex> s = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.skew(s, false)
 ** (ArgumentError) Explorer.Series.skew/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]
@@ -3235,16 +3235,16 @@

standard_deviation(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.standard_deviation(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.standard_deviation(s)
 1.0
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.standard_deviation(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.standard_deviation(s)
 1.0
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.standard_deviation(s)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.standard_deviation(s)
 ** (ArgumentError) Explorer.Series.standard_deviation/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]
@@ -3285,20 +3285,20 @@

sum(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.sum(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.sum(s)
 6
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.sum(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.sum(s)
 6.0
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.sum(s)
+iex> s = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.sum(s)
 2
 
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.sum(s)
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.sum(s)
 ** (ArgumentError) Explorer.Series.sum/1 not implemented for dtype :date. Valid dtypes are [:integer, :float, :boolean]
@@ -3339,16 +3339,16 @@

variance(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
-iex> Explorer.Series.variance(s)
+
iex> s = Explorer.Series.from_list([1, 2, nil, 3])
+iex> Explorer.Series.variance(s)
 1.0
 
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
-iex> Explorer.Series.variance(s)
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])
+iex> Explorer.Series.variance(s)
 1.0
 
-iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
-iex> Explorer.Series.variance(s)
+iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])
+iex> Explorer.Series.variance(s)
 ** (ArgumentError) Explorer.Series.variance/1 not implemented for dtype {:datetime, :microsecond}. Valid dtypes are [:integer, :float]
@@ -3402,29 +3402,29 @@

abs(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, -1, -3])
-iex> Explorer.Series.abs(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 1, 3]
->
-
-iex> s = Explorer.Series.from_list([1.0, 2.0, -1.0, -3.0])
-iex> Explorer.Series.abs(s)
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, 1.0, 3.0]
->
-
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, -3.0])
-iex> Explorer.Series.abs(s)
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, nil, 3.0]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.abs(s)
+
iex> s = Explorer.Series.from_list([1, 2, -1, -3])
+iex> Explorer.Series.abs(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 1, 3]
+>
+
+iex> s = Explorer.Series.from_list([1.0, 2.0, -1.0, -3.0])
+iex> Explorer.Series.abs(s)
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, 1.0, 3.0]
+>
+
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, -3.0])
+iex> Explorer.Series.abs(s)
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, nil, 3.0]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.abs(s)
 ** (ArgumentError) Explorer.Series.abs/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]
@@ -3467,25 +3467,25 @@

add(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([4, 5, 6])
-iex> Explorer.Series.add(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [5, 7, 9]
->

You can also use scalar values on both sides:

iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.add(s1, 2)
-#Explorer.Series<
-  Polars[3]
-  integer [3, 4, 5]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([4, 5, 6])
+iex> Explorer.Series.add(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [5, 7, 9]
+>

You can also use scalar values on both sides:

iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.add(s1, 2)
+#Explorer.Series<
+  Polars[3]
+  integer [3, 4, 5]
+>
 
-iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.add(2, s1)
-#Explorer.Series<
-  Polars[3]
-  integer [3, 4, 5]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3]) +iex> Explorer.Series.add(2, s1) +#Explorer.Series< + Polars[3] + integer [3, 4, 5] +>
@@ -3513,19 +3513,19 @@

all_equal(left, right)

Examples -
iex> s1 = Explorer.Series.from_list(["a", "b"])
-iex> s2 = Explorer.Series.from_list(["a", "b"])
-iex> Explorer.Series.all_equal(s1, s2)
+
iex> s1 = Explorer.Series.from_list(["a", "b"])
+iex> s2 = Explorer.Series.from_list(["a", "b"])
+iex> Explorer.Series.all_equal(s1, s2)
 true
 
-iex> s1 = Explorer.Series.from_list(["a", "b"])
-iex> s2 = Explorer.Series.from_list(["a", "c"])
-iex> Explorer.Series.all_equal(s1, s2)
+iex> s1 = Explorer.Series.from_list(["a", "b"])
+iex> s2 = Explorer.Series.from_list(["a", "c"])
+iex> Explorer.Series.all_equal(s1, s2)
 false
 
-iex> s1 = Explorer.Series.from_list(["a", "b"])
-iex> s2 = Explorer.Series.from_list([1, 2])
-iex> Explorer.Series.all_equal(s1, s2)
+iex> s1 = Explorer.Series.from_list(["a", "b"])
+iex> s2 = Explorer.Series.from_list([1, 2])
+iex> Explorer.Series.all_equal(s1, s2)
 false
@@ -3555,14 +3555,14 @@

left and right

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> mask1 = Explorer.Series.greater(s1, 1)
-iex> mask2 = Explorer.Series.less(s1, 3)
-iex> Explorer.Series.and(mask1, mask2)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, true, false]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> mask1 = Explorer.Series.greater(s1, 1)
+iex> mask2 = Explorer.Series.less(s1, 3)
+iex> Explorer.Series.and(mask1, mask2)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, true, false]
+>
@@ -3596,62 +3596,62 @@

cast(series, dtype)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.cast(s, :string)
-#Explorer.Series<
-  Polars[3]
-  string ["1", "2", "3"]
->
-
-iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.cast(s, :float)
-#Explorer.Series<
-  Polars[3]
-  float [1.0, 2.0, 3.0]
->
-
-iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.cast(s, :date)
-#Explorer.Series<
-  Polars[3]
-  date [1970-01-02, 1970-01-03, 1970-01-04]
->

Note that time is represented as an integer of nanoseconds since midnight. +

iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.cast(s, :string)
+#Explorer.Series<
+  Polars[3]
+  string ["1", "2", "3"]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.cast(s, :float)
+#Explorer.Series<
+  Polars[3]
+  float [1.0, 2.0, 3.0]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.cast(s, :date)
+#Explorer.Series<
+  Polars[3]
+  date [1970-01-02, 1970-01-03, 1970-01-04]
+>

Note that time is represented as an integer of nanoseconds since midnight. In Elixir we can't represent nanoseconds, only microseconds. So be aware that -information can be lost if a conversion is needed (e.g. calling to_list/1).

iex> s = Explorer.Series.from_list([1_000, 2_000, 3_000])
-iex> Explorer.Series.cast(s, :time)
-#Explorer.Series<
-  Polars[3]
-  time [00:00:00.000001, 00:00:00.000002, 00:00:00.000003]
->
-
-iex> s = Explorer.Series.from_list([86399 * 1_000 * 1_000 * 1_000])
-iex> Explorer.Series.cast(s, :time)
-#Explorer.Series<
-  Polars[1]
-  time [23:59:59.000000]
->

Note that datetime is represented as an integer of microseconds since Unix Epoch (1970-01-01 00:00:00).

iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.cast(s, {:datetime, :microsecond})
-#Explorer.Series<
-  Polars[3]
-  datetime[Ī¼s] [1970-01-01 00:00:00.000001, 1970-01-01 00:00:00.000002, 1970-01-01 00:00:00.000003]
->
-
-iex> s = Explorer.Series.from_list([1649883642 * 1_000 * 1_000])
-iex> Explorer.Series.cast(s, {:datetime, :microsecond})
-#Explorer.Series<
-  Polars[1]
-  datetime[Ī¼s] [2022-04-13 21:00:42.000000]
->

You can also use cast/2 to categorise a string:

iex> s = Explorer.Series.from_list(["apple", "banana",  "apple", "lemon"])
-iex> Explorer.Series.cast(s, :category)
-#Explorer.Series<
-  Polars[4]
-  category ["apple", "banana", "apple", "lemon"]
->

cast/2 will return the series as a no-op if you try to cast to the same dtype.

iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.cast(s, :integer)
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->
+information can be lost if a conversion is needed (e.g. calling to_list/1).

iex> s = Explorer.Series.from_list([1_000, 2_000, 3_000])
+iex> Explorer.Series.cast(s, :time)
+#Explorer.Series<
+  Polars[3]
+  time [00:00:00.000001, 00:00:00.000002, 00:00:00.000003]
+>
+
+iex> s = Explorer.Series.from_list([86399 * 1_000 * 1_000 * 1_000])
+iex> Explorer.Series.cast(s, :time)
+#Explorer.Series<
+  Polars[1]
+  time [23:59:59.000000]
+>

Note that datetime is represented as an integer of microseconds since Unix Epoch (1970-01-01 00:00:00).

iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.cast(s, {:datetime, :microsecond})
+#Explorer.Series<
+  Polars[3]
+  datetime[Ī¼s] [1970-01-01 00:00:00.000001, 1970-01-01 00:00:00.000002, 1970-01-01 00:00:00.000003]
+>
+
+iex> s = Explorer.Series.from_list([1649883642 * 1_000 * 1_000])
+iex> Explorer.Series.cast(s, {:datetime, :microsecond})
+#Explorer.Series<
+  Polars[1]
+  datetime[Ī¼s] [2022-04-13 21:00:42.000000]
+>

You can also use cast/2 to categorise a string:

iex> s = Explorer.Series.from_list(["apple", "banana",  "apple", "lemon"])
+iex> Explorer.Series.cast(s, :category)
+#Explorer.Series<
+  Polars[4]
+  category ["apple", "banana", "apple", "lemon"]
+>

cast/2 will return the series as a no-op if you try to cast to the same dtype.

iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.cast(s, :integer)
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>
@@ -3685,32 +3685,32 @@

categorise(series, categories)

If a categorical series is given as second argument, we will extract its -categories and map the integers into it:

iex> categories = Explorer.Series.from_list(["a", "b", "c", nil, "a"], dtype: :category)
-iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
-iex> Explorer.Series.categorise(indexes, categories)
-#Explorer.Series<
-  Polars[5]
-  category ["a", "c", "b", "a", "c"]
->

Otherwise, if a list of strings or a series of strings is given, they are -considered to be the categories series itself:

iex> categories = Explorer.Series.from_list(["a", "b", "c"])
-iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
-iex> Explorer.Series.categorise(indexes, categories)
-#Explorer.Series<
-  Polars[5]
-  category ["a", "c", "b", "a", "c"]
->
-
-iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
-iex> Explorer.Series.categorise(indexes, ["a", "b", "c"])
-#Explorer.Series<
-  Polars[5]
-  category ["a", "c", "b", "a", "c"]
->

Elements that are not mapped to a category will become nil:

iex> indexes = Explorer.Series.from_list([0, 2, nil, 0, 2, 7])
-iex> Explorer.Series.categorise(indexes, ["a", "b", "c"])
-#Explorer.Series<
-  Polars[6]
-  category ["a", "c", nil, "a", "c", nil]
->
+categories and map the integers into it:

iex> categories = Explorer.Series.from_list(["a", "b", "c", nil, "a"], dtype: :category)
+iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
+iex> Explorer.Series.categorise(indexes, categories)
+#Explorer.Series<
+  Polars[5]
+  category ["a", "c", "b", "a", "c"]
+>

Otherwise, if a list of strings or a series of strings is given, they are +considered to be the categories series itself:

iex> categories = Explorer.Series.from_list(["a", "b", "c"])
+iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
+iex> Explorer.Series.categorise(indexes, categories)
+#Explorer.Series<
+  Polars[5]
+  category ["a", "c", "b", "a", "c"]
+>
+
+iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])
+iex> Explorer.Series.categorise(indexes, ["a", "b", "c"])
+#Explorer.Series<
+  Polars[5]
+  category ["a", "c", "b", "a", "c"]
+>

Elements that are not mapped to a category will become nil:

iex> indexes = Explorer.Series.from_list([0, 2, nil, 0, 2, 7])
+iex> Explorer.Series.categorise(indexes, ["a", "b", "c"])
+#Explorer.Series<
+  Polars[6]
+  category ["a", "c", nil, "a", "c", nil]
+>
@@ -3751,19 +3751,19 @@

clip(series, min, max)

Examples -
iex> s = Explorer.Series.from_list([-50, 5, nil, 50])
-iex> Explorer.Series.clip(s, 1, 10)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 5, nil, 10]
->
+
iex> s = Explorer.Series.from_list([-50, 5, nil, 50])
+iex> Explorer.Series.clip(s, 1, 10)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 5, nil, 10]
+>
 
-iex> s = Explorer.Series.from_list([-50, 5, nil, 50])
-iex> Explorer.Series.clip(s, 1.5, 10.5)
-#Explorer.Series<
-  Polars[4]
-  float [1.5, 5.0, nil, 10.5]
->
+
iex> s = Explorer.Series.from_list([-50, 5, nil, 50]) +iex> Explorer.Series.clip(s, 1.5, 10.5) +#Explorer.Series< + Polars[4] + float [1.5, 5.0, nil, 10.5] +>
@@ -3797,14 +3797,14 @@

coalesce(list)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, nil, nil])
-iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
-iex> s3 = Explorer.Series.from_list([nil, nil, 3, 4])
-iex> Explorer.Series.coalesce([s1, s2, s3])
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, 4]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, nil, nil])
+iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
+iex> s3 = Explorer.Series.from_list([nil, nil, 3, 4])
+iex> Explorer.Series.coalesce([s1, s2, s3])
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, 4]
+>
@@ -3838,17 +3838,17 @@

coalesce(s1, s2)

Examples -
iex> s1 = Explorer.Series.from_list([1, nil, 3, nil])
-iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.coalesce(s1, s2)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, 4]
->
+
iex> s1 = Explorer.Series.from_list([1, nil, 3, nil])
+iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.coalesce(s1, s2)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, 4]
+>
 
-iex> s1 = Explorer.Series.from_list(["foo", nil, "bar", nil])
-iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.coalesce(s1, s2)
+iex> s1 = Explorer.Series.from_list(["foo", nil, "bar", nil])
+iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.coalesce(s1, s2)
 ** (ArgumentError) cannot invoke Explorer.Series.coalesce/2 with mismatched dtypes: :string and :integer
@@ -3891,35 +3891,35 @@

divide(left, right)

Examples -
iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
-iex> Explorer.Series.divide(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  float [5.0, 5.0, 5.0]
->
-
-iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
-iex> Explorer.Series.divide(s1, 2)
-#Explorer.Series<
-  Polars[3]
-  float [5.0, 5.0, 5.0]
->
-
-iex> s1 = [10, 52 ,10] |> Explorer.Series.from_list()
-iex> Explorer.Series.divide(s1, 2.5)
-#Explorer.Series<
-  Polars[3]
-  float [4.0, 20.8, 4.0]
->
-
-iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 0, 2] |> Explorer.Series.from_list()
-iex> Explorer.Series.divide(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  float [5.0, Inf, 5.0]
->
+
iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
+iex> Explorer.Series.divide(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  float [5.0, 5.0, 5.0]
+>
+
+iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
+iex> Explorer.Series.divide(s1, 2)
+#Explorer.Series<
+  Polars[3]
+  float [5.0, 5.0, 5.0]
+>
+
+iex> s1 = [10, 52 ,10] |> Explorer.Series.from_list()
+iex> Explorer.Series.divide(s1, 2.5)
+#Explorer.Series<
+  Polars[3]
+  float [4.0, 20.8, 4.0]
+>
+
+iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 0, 2] |> Explorer.Series.from_list()
+iex> Explorer.Series.divide(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  float [5.0, Inf, 5.0]
+>
@@ -3960,51 +3960,51 @@

equal(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.equal(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, true, false]
->
-
-iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.equal(s, 1)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, false]
->
-
-iex> s = Explorer.Series.from_list([true, true, false])
-iex> Explorer.Series.equal(s, true)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, true, false]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.equal(s, "a")
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, false]
->
-
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.equal(s, ~D[1999-12-31])
-#Explorer.Series<
-  Polars[2]
-  boolean [false, true]
->
-
-iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])
-iex> Explorer.Series.equal(s, ~N[2022-01-01 00:00:00])
-#Explorer.Series<
-  Polars[2]
-  boolean [true, false]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.equal(s, false)
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.equal(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, true, false]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.equal(s, 1)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, false]
+>
+
+iex> s = Explorer.Series.from_list([true, true, false])
+iex> Explorer.Series.equal(s, true)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, true, false]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.equal(s, "a")
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, false]
+>
+
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.equal(s, ~D[1999-12-31])
+#Explorer.Series<
+  Polars[2]
+  boolean [false, true]
+>
+
+iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])
+iex> Explorer.Series.equal(s, ~N[2022-01-01 00:00:00])
+#Explorer.Series<
+  Polars[2]
+  boolean [true, false]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.equal(s, false)
 ** (ArgumentError) cannot invoke Explorer.Series.equal/2 with mismatched dtypes: :string and false
@@ -4078,13 +4078,13 @@

greater(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.greater(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, false, false]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.greater(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, false, false]
+>
@@ -4129,13 +4129,13 @@

greater_equal(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.greater_equal(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, true, false]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.greater_equal(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, true, false]
+>
@@ -4163,21 +4163,21 @@

left in right

Examples -
iex> left = Explorer.Series.from_list([1, 2, 3])
-iex> right = Explorer.Series.from_list([1, 2])
-iex> Series.in(left, right)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, true, false]
->
+
iex> left = Explorer.Series.from_list([1, 2, 3])
+iex> right = Explorer.Series.from_list([1, 2])
+iex> Series.in(left, right)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, true, false]
+>
 
-iex> left = Explorer.Series.from_list([~D[1970-01-01], ~D[2000-01-01], ~D[2010-04-17]])
-iex> right = Explorer.Series.from_list([~D[1970-01-01], ~D[2010-04-17]])
-iex> Series.in(left, right)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, true]
->
+
iex> left = Explorer.Series.from_list([~D[1970-01-01], ~D[2000-01-01], ~D[2010-04-17]]) +iex> right = Explorer.Series.from_list([~D[1970-01-01], ~D[2010-04-17]]) +iex> Series.in(left, right) +#Explorer.Series< + Polars[3] + boolean [true, false, true] +>
@@ -4211,12 +4211,12 @@

is_nil(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.is_nil(s)
-#Explorer.Series<
-  Polars[4]
-  boolean [false, false, true, false]
->
+
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.is_nil(s)
+#Explorer.Series<
+  Polars[4]
+  boolean [false, false, true, false]
+>
@@ -4250,12 +4250,12 @@

is_not_nil(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.is_not_nil(s)
-#Explorer.Series<
-  Polars[4]
-  boolean [true, true, false, true]
->
+
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.is_not_nil(s)
+#Explorer.Series<
+  Polars[4]
+  boolean [true, true, false, true]
+>
@@ -4300,13 +4300,13 @@

less(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.less(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, false, true]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.less(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, false, true]
+>
@@ -4351,13 +4351,13 @@

less_equal(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.less_equal(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, true, true]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.less_equal(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, true, true]
+>
@@ -4398,12 +4398,12 @@

log(s)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3, nil, 4])
-iex> Explorer.Series.log(s)
-#Explorer.Series<
-  Polars[5]
-  float [0.0, 0.6931471805599453, 1.0986122886681098, nil, 1.3862943611198906]
->
+
iex> s = Explorer.Series.from_list([1, 2, 3, nil, 4])
+iex> Explorer.Series.log(s)
+#Explorer.Series<
+  Polars[5]
+  float [0.0, 0.6931471805599453, 1.0986122886681098, nil, 1.3862943611198906]
+>
@@ -4443,12 +4443,12 @@

log(argument, base)

Examples -
iex> s = Explorer.Series.from_list([8, 16, 32])
-iex> Explorer.Series.log(s, 2)
-#Explorer.Series<
-  Polars[3]
-  float [3.0, 4.0, 5.0]
->
+
iex> s = Explorer.Series.from_list([8, 16, 32])
+iex> Explorer.Series.log(s, 2)
+#Explorer.Series<
+  Polars[3]
+  float [3.0, 4.0, 5.0]
+>
@@ -4482,13 +4482,13 @@

mask(series, mask)

Examples -
iex> s1 = Explorer.Series.from_list([1,2,3])
-iex> s2 = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.mask(s1, s2)
-#Explorer.Series<
-  Polars[2]
-  integer [1, 3]
->
+
iex> s1 = Explorer.Series.from_list([1,2,3])
+iex> s2 = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.mask(s1, s2)
+#Explorer.Series<
+  Polars[2]
+  integer [1, 3]
+>
@@ -4530,20 +4530,20 @@

multiply(left, right)

Examples -
iex> s1 = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> s2 = 11..20 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.multiply(s1, s2)
-#Explorer.Series<
-  Polars[10]
-  integer [11, 24, 39, 56, 75, 96, 119, 144, 171, 200]
->
+
iex> s1 = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> s2 = 11..20 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.multiply(s1, s2)
+#Explorer.Series<
+  Polars[10]
+  integer [11, 24, 39, 56, 75, 96, 119, 144, 171, 200]
+>
 
-iex> s1 = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.multiply(s1, 2)
-#Explorer.Series<
-  Polars[5]
-  integer [2, 4, 6, 8, 10]
->
+
iex> s1 = 1..5 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.multiply(s1, 2) +#Explorer.Series< + Polars[5] + integer [2, 4, 6, 8, 10] +>
@@ -4571,12 +4571,12 @@

not series

Examples -
iex> s1 = Explorer.Series.from_list([true, false, false])
-iex> Explorer.Series.not(s1)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, true, true]
->
+
iex> s1 = Explorer.Series.from_list([true, false, false])
+iex> Explorer.Series.not(s1)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, true, true]
+>
@@ -4617,51 +4617,51 @@

not_equal(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([1, 2, 4])
-iex> Explorer.Series.not_equal(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, false, true]
->
-
-iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.not_equal(s, 1)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, true, true]
->
-
-iex> s = Explorer.Series.from_list([true, true, false])
-iex> Explorer.Series.not_equal(s, true)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, false, true]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.not_equal(s, "a")
-#Explorer.Series<
-  Polars[3]
-  boolean [false, true, true]
->
-
-iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
-iex> Explorer.Series.not_equal(s, ~D[1999-12-31])
-#Explorer.Series<
-  Polars[2]
-  boolean [true, false]
->
-
-iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])
-iex> Explorer.Series.not_equal(s, ~N[2022-01-01 00:00:00])
-#Explorer.Series<
-  Polars[2]
-  boolean [false, true]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.not_equal(s, false)
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([1, 2, 4])
+iex> Explorer.Series.not_equal(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, false, true]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.not_equal(s, 1)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, true, true]
+>
+
+iex> s = Explorer.Series.from_list([true, true, false])
+iex> Explorer.Series.not_equal(s, true)
+#Explorer.Series<
+  Polars[3]
+  boolean [false, false, true]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.not_equal(s, "a")
+#Explorer.Series<
+  Polars[3]
+  boolean [false, true, true]
+>
+
+iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])
+iex> Explorer.Series.not_equal(s, ~D[1999-12-31])
+#Explorer.Series<
+  Polars[2]
+  boolean [true, false]
+>
+
+iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])
+iex> Explorer.Series.not_equal(s, ~N[2022-01-01 00:00:00])
+#Explorer.Series<
+  Polars[2]
+  boolean [false, true]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.not_equal(s, false)
 ** (ArgumentError) cannot invoke Explorer.Series.not_equal/2 with mismatched dtypes: :string and false
@@ -4691,14 +4691,14 @@

left or right

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> mask1 = Explorer.Series.less(s1, 2)
-iex> mask2 = Explorer.Series.greater(s1, 2)
-iex> Explorer.Series.or(mask1, mask2)
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, true]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> mask1 = Explorer.Series.less(s1, 2)
+iex> mask2 = Explorer.Series.greater(s1, 2)
+iex> Explorer.Series.or(mask1, mask2)
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, true]
+>
@@ -4740,19 +4740,19 @@

peaks(series, max_or_min \\ :max)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 4, 1, 4])
-iex> Explorer.Series.peaks(s)
-#Explorer.Series<
-  Polars[5]
-  boolean [false, false, true, false, true]
->
+
iex> s = Explorer.Series.from_list([1, 2, 4, 1, 4])
+iex> Explorer.Series.peaks(s)
+#Explorer.Series<
+  Polars[5]
+  boolean [false, false, true, false, true]
+>
 
-iex> s = [~T[03:00:02.000000], ~T[13:24:56.000000], ~T[02:04:19.000000]] |> Explorer.Series.from_list()
-iex> Explorer.Series.peaks(s)
-#Explorer.Series<
-  Polars[3]
-  boolean [false, true, false]
->
+
iex> s = [~T[03:00:02.000000], ~T[13:24:56.000000], ~T[02:04:19.000000]] |> Explorer.Series.from_list() +iex> Explorer.Series.peaks(s) +#Explorer.Series< + Polars[3] + boolean [false, true, false] +>
@@ -4794,40 +4794,40 @@

pow(left, right)

Examples -
iex> s = [8, 16, 32] |> Explorer.Series.from_list()
-iex> Explorer.Series.pow(s, 2.0)
-#Explorer.Series<
-  Polars[3]
-  float [64.0, 256.0, 1024.0]
->
-
-iex> s = [2, 4, 6] |> Explorer.Series.from_list()
-iex> Explorer.Series.pow(s, 3)
-#Explorer.Series<
-  Polars[3]
-  integer [8, 64, 216]
->
-
-iex> s = [2, 4, 6] |> Explorer.Series.from_list()
-iex> Explorer.Series.pow(s, -3.0)
-#Explorer.Series<
-  Polars[3]
-  float [0.125, 0.015625, 0.004629629629629629]
->
-
-iex> s = [1.0, 2.0, 3.0] |> Explorer.Series.from_list()
-iex> Explorer.Series.pow(s, 3.0)
-#Explorer.Series<
-  Polars[3]
-  float [1.0, 8.0, 27.0]
->
-
-iex> s = [2.0, 4.0, 6.0] |> Explorer.Series.from_list()
-iex> Explorer.Series.pow(s, 2)
-#Explorer.Series<
-  Polars[3]
-  float [4.0, 16.0, 36.0]
->
+
iex> s = [8, 16, 32] |> Explorer.Series.from_list()
+iex> Explorer.Series.pow(s, 2.0)
+#Explorer.Series<
+  Polars[3]
+  float [64.0, 256.0, 1024.0]
+>
+
+iex> s = [2, 4, 6] |> Explorer.Series.from_list()
+iex> Explorer.Series.pow(s, 3)
+#Explorer.Series<
+  Polars[3]
+  integer [8, 64, 216]
+>
+
+iex> s = [2, 4, 6] |> Explorer.Series.from_list()
+iex> Explorer.Series.pow(s, -3.0)
+#Explorer.Series<
+  Polars[3]
+  float [0.125, 0.015625, 0.004629629629629629]
+>
+
+iex> s = [1.0, 2.0, 3.0] |> Explorer.Series.from_list()
+iex> Explorer.Series.pow(s, 3.0)
+#Explorer.Series<
+  Polars[3]
+  float [1.0, 8.0, 27.0]
+>
+
+iex> s = [2.0, 4.0, 6.0] |> Explorer.Series.from_list()
+iex> Explorer.Series.pow(s, 2)
+#Explorer.Series<
+  Polars[3]
+  float [4.0, 16.0, 36.0]
+>
@@ -4869,28 +4869,28 @@

quotient(left, right)

Examples -
iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
-iex> Explorer.Series.quotient(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [5, 5, 5]
->
+
iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
+iex> Explorer.Series.quotient(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [5, 5, 5]
+>
 
-iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()
-iex> Explorer.Series.quotient(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [5, 5, nil]
->
+iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()
+iex> Explorer.Series.quotient(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [5, 5, nil]
+>
 
-iex> s1 = [10, 12, 15] |> Explorer.Series.from_list()
-iex> Explorer.Series.quotient(s1, 3)
-#Explorer.Series<
-  Polars[3]
-  integer [3, 4, 5]
->
+
iex> s1 = [10, 12, 15] |> Explorer.Series.from_list() +iex> Explorer.Series.quotient(s1, 3) +#Explorer.Series< + Polars[3] + integer [3, 4, 5] +>
@@ -4932,48 +4932,48 @@

rank(series, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
-iex> Explorer.Series.rank(s)
-#Explorer.Series<
-  Polars[5]
-  float [3.0, 4.5, 1.5, 1.5, 4.5]
->
-
-iex> s = Explorer.Series.from_list([1.1, 2.4, 3.2])
-iex> Explorer.Series.rank(s, method: "ordinal")
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->
-
-iex> s = Explorer.Series.from_list([ ~N[2022-07-07 17:44:13.020548], ~N[2022-07-07 17:43:08.473561], ~N[2022-07-07 17:45:00.116337] ])
-iex> Explorer.Series.rank(s, method: "average")
-#Explorer.Series<
-  Polars[3]
-  float [2.0, 1.0, 3.0]
->
-
-iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
-iex> Explorer.Series.rank(s, method: "min")
-#Explorer.Series<
-  Polars[5]
-  integer [3, 4, 1, 1, 4]
->
-
-iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
-iex> Explorer.Series.rank(s, method: "dense")
-#Explorer.Series<
-  Polars[5]
-  integer [2, 3, 1, 1, 3]
->
-
-
-iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
-iex> Explorer.Series.rank(s, method: "random", seed: 42)
-#Explorer.Series<
-  Polars[5]
-  integer [3, 4, 2, 1, 5]
->
+
iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
+iex> Explorer.Series.rank(s)
+#Explorer.Series<
+  Polars[5]
+  float [3.0, 4.5, 1.5, 1.5, 4.5]
+>
+
+iex> s = Explorer.Series.from_list([1.1, 2.4, 3.2])
+iex> Explorer.Series.rank(s, method: "ordinal")
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>
+
+iex> s = Explorer.Series.from_list([ ~N[2022-07-07 17:44:13.020548], ~N[2022-07-07 17:43:08.473561], ~N[2022-07-07 17:45:00.116337] ])
+iex> Explorer.Series.rank(s, method: "average")
+#Explorer.Series<
+  Polars[3]
+  float [2.0, 1.0, 3.0]
+>
+
+iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
+iex> Explorer.Series.rank(s, method: "min")
+#Explorer.Series<
+  Polars[5]
+  integer [3, 4, 1, 1, 4]
+>
+
+iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
+iex> Explorer.Series.rank(s, method: "dense")
+#Explorer.Series<
+  Polars[5]
+  integer [2, 3, 1, 1, 3]
+>
+
+
+iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])
+iex> Explorer.Series.rank(s, method: "random", seed: 42)
+#Explorer.Series<
+  Polars[5]
+  integer [3, 4, 2, 1, 5]
+>
@@ -5015,28 +5015,28 @@

remainder(left, right)

Examples -
iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
-iex> Explorer.Series.remainder(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [0, 1, 0]
->
+
iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()
+iex> Explorer.Series.remainder(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [0, 1, 0]
+>
 
-iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
-iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()
-iex> Explorer.Series.remainder(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [0, 1, nil]
->
+iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()
+iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()
+iex> Explorer.Series.remainder(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [0, 1, nil]
+>
 
-iex> s1 = [10, 11, 9] |> Explorer.Series.from_list()
-iex> Explorer.Series.remainder(s1, 3)
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 0]
->
+
iex> s1 = [10, 11, 9] |> Explorer.Series.from_list() +iex> Explorer.Series.remainder(s1, 3) +#Explorer.Series< + Polars[3] + integer [1, 2, 0] +>
@@ -5106,12 +5106,12 @@

strftime(series, format_string)

Examples -
iex> s = Explorer.Series.from_list([~N[2023-01-05 12:34:56], nil])
-iex> Explorer.Series.strftime(s, "%Y/%m/%d %H:%M:%S")
-#Explorer.Series<
-  Polars[2]
-  string ["2023/01/05 12:34:56", nil]
->
+
iex> s = Explorer.Series.from_list([~N[2023-01-05 12:34:56], nil])
+iex> Explorer.Series.strftime(s, "%Y/%m/%d %H:%M:%S")
+#Explorer.Series<
+  Polars[2]
+  string ["2023/01/05 12:34:56", nil]
+>
@@ -5146,12 +5146,12 @@

strptime(series, format_string)

Examples -
iex> s = Explorer.Series.from_list(["2023-01-05 12:34:56", "XYZ", nil])
-iex> Explorer.Series.strptime(s, "%Y-%m-%d %H:%M:%S")
-#Explorer.Series<
-  Polars[3]
-  datetime[Ī¼s] [2023-01-05 12:34:56.000000, nil, nil]
->
+
iex> s = Explorer.Series.from_list(["2023-01-05 12:34:56", "XYZ", nil])
+iex> Explorer.Series.strptime(s, "%Y-%m-%d %H:%M:%S")
+#Explorer.Series<
+  Polars[3]
+  datetime[Ī¼s] [2023-01-05 12:34:56.000000, nil, nil]
+>
@@ -5193,25 +5193,25 @@

subtract(left, right)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([4, 5, 6])
-iex> Explorer.Series.subtract(s1, s2)
-#Explorer.Series<
-  Polars[3]
-  integer [-3, -3, -3]
->

You can also use scalar values on both sides:

iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.subtract(s1, 2)
-#Explorer.Series<
-  Polars[3]
-  integer [-1, 0, 1]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([4, 5, 6])
+iex> Explorer.Series.subtract(s1, s2)
+#Explorer.Series<
+  Polars[3]
+  integer [-3, -3, -3]
+>

You can also use scalar values on both sides:

iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.subtract(s1, 2)
+#Explorer.Series<
+  Polars[3]
+  integer [-1, 0, 1]
+>
 
-iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.subtract(2, s1)
-#Explorer.Series<
-  Polars[3]
-  integer [1, 0, -1]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3]) +iex> Explorer.Series.subtract(2, s1) +#Explorer.Series< + Polars[3] + integer [1, 0, -1] +>
@@ -5243,19 +5243,19 @@

transform(series, fun)

Examples -
iex> s = Explorer.Series.from_list(["this ", " is", "great   "])
-iex> Explorer.Series.transform(s, &String.trim/1)
-#Explorer.Series<
-  Polars[3]
-  string ["this", "is", "great"]
->
+
iex> s = Explorer.Series.from_list(["this ", " is", "great   "])
+iex> Explorer.Series.transform(s, &String.trim/1)
+#Explorer.Series<
+  Polars[3]
+  string ["this", "is", "great"]
+>
 
-iex> s = Explorer.Series.from_list(["this", "is", "great"])
-iex> Explorer.Series.transform(s, &String.length/1)
-#Explorer.Series<
-  Polars[3]
-  integer [4, 2, 5]
->
+
iex> s = Explorer.Series.from_list(["this", "is", "great"]) +iex> Explorer.Series.transform(s, &String.length/1) +#Explorer.Series< + Polars[3] + integer [4, 2, 5] +>
@@ -5301,17 +5301,17 @@

day_of_week(series)

Examples -
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-01-16], ~D[2023-01-20], nil])
-iex> Explorer.Series.day_of_week(s)
-#Explorer.Series<
-  Polars[4]
-  integer [7, 1, 5, nil]
->

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-01-16 23:59:59.999999], ~N[2023-01-20 12:00:00], nil])
-iex> Explorer.Series.day_of_week(s)
-#Explorer.Series<
-  Polars[4]
-  integer [7, 1, 5, nil]
->
+
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-01-16], ~D[2023-01-20], nil])
+iex> Explorer.Series.day_of_week(s)
+#Explorer.Series<
+  Polars[4]
+  integer [7, 1, 5, nil]
+>

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-01-16 23:59:59.999999], ~N[2023-01-20 12:00:00], nil])
+iex> Explorer.Series.day_of_week(s)
+#Explorer.Series<
+  Polars[4]
+  integer [7, 1, 5, nil]
+>
@@ -5345,12 +5345,12 @@

hour(series)

Examples -
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
-iex> Explorer.Series.hour(s)
-#Explorer.Series<
-  Polars[4]
-  integer [0, 23, 12, nil]
->
+
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
+iex> Explorer.Series.hour(s)
+#Explorer.Series<
+  Polars[4]
+  integer [0, 23, 12, nil]
+>
@@ -5384,12 +5384,12 @@

minute(series)

Examples -
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
-iex> Explorer.Series.minute(s)
-#Explorer.Series<
-  Polars[4]
-  integer [0, 59, 0, nil]
->
+
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
+iex> Explorer.Series.minute(s)
+#Explorer.Series<
+  Polars[4]
+  integer [0, 59, 0, nil]
+>
@@ -5423,17 +5423,17 @@

month(series)

Examples -
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-02-16], ~D[2023-03-20], nil])
-iex> Explorer.Series.month(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, nil]
->

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-02-16 23:59:59.999999], ~N[2023-03-20 12:00:00], nil])
-iex> Explorer.Series.month(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, nil]
->
+
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-02-16], ~D[2023-03-20], nil])
+iex> Explorer.Series.month(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, nil]
+>

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-02-16 23:59:59.999999], ~N[2023-03-20 12:00:00], nil])
+iex> Explorer.Series.month(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, nil]
+>
@@ -5467,12 +5467,12 @@

second(series)

Examples -
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
-iex> Explorer.Series.second(s)
-#Explorer.Series<
-  Polars[4]
-  integer [0, 59, 0, nil]
->
+
iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
+iex> Explorer.Series.second(s)
+#Explorer.Series<
+  Polars[4]
+  integer [0, 59, 0, nil]
+>
@@ -5506,17 +5506,17 @@

year(series)

Examples -
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2022-02-16], ~D[2021-03-20], nil])
-iex> Explorer.Series.year(s)
-#Explorer.Series<
-  Polars[4]
-  integer [2023, 2022, 2021, nil]
->

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
-iex> Explorer.Series.year(s)
-#Explorer.Series<
-  Polars[4]
-  integer [2023, 2022, 2021, nil]
->
+
iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2022-02-16], ~D[2021-03-20], nil])
+iex> Explorer.Series.year(s)
+#Explorer.Series<
+  Polars[4]
+  integer [2023, 2022, 2021, nil]
+>

It can also be called on a datetime series.

iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])
+iex> Explorer.Series.year(s)
+#Explorer.Series<
+  Polars[4]
+  integer [2023, 2022, 2021, nil]
+>
@@ -5569,12 +5569,12 @@

acos(series)

Examples -
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
-iex> Explorer.Series.acos(s)
-#Explorer.Series<
-  Polars[5]
-  float [0.0, 1.5707963267948966, 3.141592653589793, 2.356194490192345, 0.7853981633974484]
->
+
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
+iex> Explorer.Series.acos(s)
+#Explorer.Series<
+  Polars[5]
+  float [0.0, 1.5707963267948966, 3.141592653589793, 2.356194490192345, 0.7853981633974484]
+>
@@ -5615,12 +5615,12 @@

asin(series)

Examples -
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
-iex> Explorer.Series.asin(s)
-#Explorer.Series<
-  Polars[5]
-  float [1.5707963267948966, 0.0, -1.5707963267948966, -0.7853981633974482, 0.7853981633974482]
->
+
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
+iex> Explorer.Series.asin(s)
+#Explorer.Series<
+  Polars[5]
+  float [1.5707963267948966, 0.0, -1.5707963267948966, -0.7853981633974482, 0.7853981633974482]
+>
@@ -5661,12 +5661,12 @@

atan(series)

Examples -
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
-iex> Explorer.Series.atan(s)
-#Explorer.Series<
-  Polars[5]
-  float [0.7853981633974483, 0.0, -0.7853981633974483, -0.6154797086703873, 0.6154797086703873]
->
+
iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()
+iex> Explorer.Series.atan(s)
+#Explorer.Series<
+  Polars[5]
+  float [0.7853981633974483, 0.0, -0.7853981633974483, -0.6154797086703873, 0.6154797086703873]
+>
@@ -5700,12 +5700,12 @@

ceil(series)

Examples -
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
-iex> Explorer.Series.ceil(s)
-#Explorer.Series<
-  Polars[3]
-  float [2.0, 3.0, 4.0]
->
+
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
+iex> Explorer.Series.ceil(s)
+#Explorer.Series<
+  Polars[3]
+  float [2.0, 3.0, 4.0]
+>
@@ -5746,13 +5746,13 @@

cos(series)

Examples -
iex> pi = :math.pi()
-iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
-iex> Explorer.Series.cos(s)
-#Explorer.Series<
-  Polars[9]
-  float [-1.8369701987210297e-16, -1.0, 6.123233995736766e-17, 0.7071067811865476, 1.0, 0.7071067811865476, 6.123233995736766e-17, -1.0, -1.8369701987210297e-16]
->
+
iex> pi = :math.pi()
+iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
+iex> Explorer.Series.cos(s)
+#Explorer.Series<
+  Polars[9]
+  float [-1.8369701987210297e-16, -1.0, 6.123233995736766e-17, 0.7071067811865476, 1.0, 0.7071067811865476, 6.123233995736766e-17, -1.0, -1.8369701987210297e-16]
+>
@@ -5786,12 +5786,12 @@

floor(series)

Examples -
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
-iex> Explorer.Series.floor(s)
-#Explorer.Series<
-  Polars[3]
-  float [1.0, 2.0, 3.0]
->
+
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
+iex> Explorer.Series.floor(s)
+#Explorer.Series<
+  Polars[3]
+  float [1.0, 2.0, 3.0]
+>
@@ -5825,14 +5825,14 @@

is_finite(series)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])
-iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])
-iex> s3 = Explorer.Series.divide(s1, s2)
-iex> Explorer.Series.is_finite(s3)
-#Explorer.Series<
-  Polars[4]
-  boolean [false, true, false, nil]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])
+iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])
+iex> s3 = Explorer.Series.divide(s1, s2)
+iex> Explorer.Series.is_finite(s3)
+#Explorer.Series<
+  Polars[4]
+  boolean [false, true, false, nil]
+>
@@ -5866,14 +5866,14 @@

is_infinite(series)

Examples -
iex> s1 = Explorer.Series.from_list([1, -1, 2, 0, nil])
-iex> s2 = Explorer.Series.from_list([0, 0, 2, 0, nil])
-iex> s3 = Explorer.Series.divide(s1, s2)
-iex> Explorer.Series.is_infinite(s3)
-#Explorer.Series<
-  Polars[5]
-  boolean [true, true, false, false, nil]
->
+
iex> s1 = Explorer.Series.from_list([1, -1, 2, 0, nil])
+iex> s2 = Explorer.Series.from_list([0, 0, 2, 0, nil])
+iex> s3 = Explorer.Series.divide(s1, s2)
+iex> Explorer.Series.is_infinite(s3)
+#Explorer.Series<
+  Polars[5]
+  boolean [true, true, false, false, nil]
+>
@@ -5907,14 +5907,14 @@

is_nan(series)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])
-iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])
-iex> s3 = Explorer.Series.divide(s1, s2)
-iex> Explorer.Series.is_nan(s3)
-#Explorer.Series<
-  Polars[4]
-  boolean [false, false, true, nil]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])
+iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])
+iex> s3 = Explorer.Series.divide(s1, s2)
+iex> Explorer.Series.is_nan(s3)
+#Explorer.Series<
+  Polars[4]
+  boolean [false, false, true, nil]
+>
@@ -5948,12 +5948,12 @@

round(series, decimals)

Examples -
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
-iex> Explorer.Series.round(s, 2)
-#Explorer.Series<
-  Polars[3]
-  float [1.12, 2.56, 4.0]
->
+
iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])
+iex> Explorer.Series.round(s, 2)
+#Explorer.Series<
+  Polars[3]
+  float [1.12, 2.56, 4.0]
+>
@@ -5994,13 +5994,13 @@

sin(series)

Examples -
iex> pi = :math.pi()
-iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
-iex> Explorer.Series.sin(s)
-#Explorer.Series<
-  Polars[9]
-  float [1.0, -1.2246467991473532e-16, -1.0, -0.7071067811865475, 0.0, 0.7071067811865475, 1.0, 1.2246467991473532e-16, -1.0]
->
+
iex> pi = :math.pi()
+iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
+iex> Explorer.Series.sin(s)
+#Explorer.Series<
+  Polars[9]
+  float [1.0, -1.2246467991473532e-16, -1.0, -0.7071067811865475, 0.0, 0.7071067811865475, 1.0, 1.2246467991473532e-16, -1.0]
+>
@@ -6041,13 +6041,13 @@

tan(series)

Examples -
iex> pi = :math.pi()
-iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
-iex> Explorer.Series.tan(s)
-#Explorer.Series<
-  Polars[9]
-  float [-5443746451065123.0, 1.2246467991473532e-16, -1.633123935319537e16, -0.9999999999999999, 0.0, 0.9999999999999999, 1.633123935319537e16, -1.2246467991473532e-16, 5443746451065123.0]
->
+
iex> pi = :math.pi()
+iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()
+iex> Explorer.Series.tan(s)
+#Explorer.Series<
+  Polars[9]
+  float [-5443746451065123.0, 1.2246467991473532e-16, -1.633123935319537e16, -0.9999999999999999, 0.0, 0.9999999999999999, 1.633123935319537e16, -1.2246467991473532e-16, 5443746451065123.0]
+>
@@ -6093,12 +6093,12 @@

contains(series, pattern)

Examples -
iex> s = Explorer.Series.from_list(["abc", "def", "bcd"])
-iex> Explorer.Series.contains(s, "bc")
-#Explorer.Series<
-  Polars[3]
-  boolean [true, false, true]
->
+
iex> s = Explorer.Series.from_list(["abc", "def", "bcd"])
+iex> Explorer.Series.contains(s, "bc")
+#Explorer.Series<
+  Polars[3]
+  boolean [true, false, true]
+>
@@ -6132,12 +6132,12 @@

downcase(series)

Examples -
iex> s = Explorer.Series.from_list(["ABC", "DEF", "BCD"])
-iex> Explorer.Series.downcase(s)
-#Explorer.Series<
-  Polars[3]
-  string ["abc", "def", "bcd"]
->
+
iex> s = Explorer.Series.from_list(["ABC", "DEF", "BCD"])
+iex> Explorer.Series.downcase(s)
+#Explorer.Series<
+  Polars[3]
+  string ["abc", "def", "bcd"]
+>
@@ -6171,12 +6171,12 @@

lstrip(series)

Examples -
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd"])
-iex> Explorer.Series.lstrip(s)
-#Explorer.Series<
-  Polars[3]
-  string ["abc", "def  ", "bcd"]
->
+
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd"])
+iex> Explorer.Series.lstrip(s)
+#Explorer.Series<
+  Polars[3]
+  string ["abc", "def  ", "bcd"]
+>
@@ -6211,19 +6211,19 @@

lstrip(series, string)

Examples -
iex> s = Explorer.Series.from_list(["$1", "$$200$$", "$$$3000$"])
-iex> Explorer.Series.lstrip(s, "$")
-#Explorer.Series<
-  Polars[3]
-  string ["1", "200$$", "3000$"]
->
+
iex> s = Explorer.Series.from_list(["$1", "$$200$$", "$$$3000$"])
+iex> Explorer.Series.lstrip(s, "$")
+#Explorer.Series<
+  Polars[3]
+  string ["1", "200$$", "3000$"]
+>
 
-iex> s = Explorer.Series.from_list(["abc", "adefa", "bcda"])
-iex> Explorer.Series.lstrip(s, "ab")
-#Explorer.Series<
-  Polars[3]
-  string ["c", "defa", "cda"]
->
+
iex> s = Explorer.Series.from_list(["abc", "adefa", "bcda"]) +iex> Explorer.Series.lstrip(s, "ab") +#Explorer.Series< + Polars[3] + string ["c", "defa", "cda"] +>
@@ -6257,12 +6257,12 @@

rstrip(series)

Examples -
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd"])
-iex> Explorer.Series.rstrip(s)
-#Explorer.Series<
-  Polars[3]
-  string ["  abc", "def", "  bcd"]
->
+
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd"])
+iex> Explorer.Series.rstrip(s)
+#Explorer.Series<
+  Polars[3]
+  string ["  abc", "def", "  bcd"]
+>
@@ -6297,19 +6297,19 @@

rstrip(series, string)

Examples -
iex> s = Explorer.Series.from_list(["__abc__", "def_", "__bcd_"])
-iex> Explorer.Series.rstrip(s, "_")
-#Explorer.Series<
-  Polars[3]
-  string ["__abc", "def", "__bcd"]
->
+
iex> s = Explorer.Series.from_list(["__abc__", "def_", "__bcd_"])
+iex> Explorer.Series.rstrip(s, "_")
+#Explorer.Series<
+  Polars[3]
+  string ["__abc", "def", "__bcd"]
+>
 
-iex> s = Explorer.Series.from_list(["abc", "adefa", "bcdabaaa"])
-iex> Explorer.Series.rstrip(s, "ab")
-#Explorer.Series<
-  Polars[3]
-  string ["abc", "adef", "bcd"]
->
+
iex> s = Explorer.Series.from_list(["abc", "adefa", "bcdabaaa"]) +iex> Explorer.Series.rstrip(s, "ab") +#Explorer.Series< + Polars[3] + string ["abc", "adef", "bcd"] +>
@@ -6344,12 +6344,12 @@

strip(series)

Examples -
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd   "])
-iex> Explorer.Series.strip(s)
-#Explorer.Series<
-  Polars[3]
-  string ["abc", "def", "bcd"]
->
+
iex> s = Explorer.Series.from_list(["  abc", "def  ", "  bcd   "])
+iex> Explorer.Series.strip(s)
+#Explorer.Series<
+  Polars[3]
+  string ["abc", "def", "bcd"]
+>
@@ -6384,19 +6384,19 @@

strip(series, string)

Examples -
iex> s = Explorer.Series.from_list(["Ā£123", "1.00Ā£", "Ā£1.00Ā£"])
-iex> Explorer.Series.strip(s, "Ā£")
-#Explorer.Series<
-  Polars[3]
-  string ["123", "1.00", "1.00"]
->
+
iex> s = Explorer.Series.from_list(["Ā£123", "1.00Ā£", "Ā£1.00Ā£"])
+iex> Explorer.Series.strip(s, "Ā£")
+#Explorer.Series<
+  Polars[3]
+  string ["123", "1.00", "1.00"]
+>
 
-iex> s = Explorer.Series.from_list(["abc", "adefa", "bcda"])
-iex> Explorer.Series.strip(s, "ab")
-#Explorer.Series<
-  Polars[3]
-  string ["c", "def", "cd"]
->
+
iex> s = Explorer.Series.from_list(["abc", "adefa", "bcda"]) +iex> Explorer.Series.strip(s, "ab") +#Explorer.Series< + Polars[3] + string ["c", "def", "cd"] +>
@@ -6431,19 +6431,19 @@

substring(series, offset)

Examples -
iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
-iex> Explorer.Series.substring(s, -3)
-#Explorer.Series<
-  Polars[3]
-  string ["rth", "ars", "une"]
->
+
iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
+iex> Explorer.Series.substring(s, -3)
+#Explorer.Series<
+  Polars[3]
+  string ["rth", "ars", "une"]
+>
 
-iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
-iex> Explorer.Series.substring(s, 1)
-#Explorer.Series<
-  Polars[3]
-  string ["arth", "ars", "eptune"]
->
+
iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"]) +iex> Explorer.Series.substring(s, 1) +#Explorer.Series< + Polars[3] + string ["arth", "ars", "eptune"] +>
@@ -6478,26 +6478,26 @@

substring(series, offset, length)

Examples -
iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
-iex> Explorer.Series.substring(s, -3, 2)
-#Explorer.Series<
-  Polars[3]
-  string ["rt", "ar", "un"]
->
+
iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
+iex> Explorer.Series.substring(s, -3, 2)
+#Explorer.Series<
+  Polars[3]
+  string ["rt", "ar", "un"]
+>
 
-iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
-iex> Explorer.Series.substring(s, 1, 5)
-#Explorer.Series<
-  Polars[3]
-  string ["arth", "ars", "eptun"]
->
+iex> s = Explorer.Series.from_list(["earth", "mars", "neptune"])
+iex> Explorer.Series.substring(s, 1, 5)
+#Explorer.Series<
+  Polars[3]
+  string ["arth", "ars", "eptun"]
+>
 
-iex> d = Explorer.Series.from_list(["恓悓恫恔ćÆäø–ē•Œ", "Ł…Ų±Ų­ŲØŁ‹Ų§", "ģ•ˆė…•ķ•˜ģ„øģš”"])
-iex> Explorer.Series.substring(d, 1, 3)
-#Explorer.Series<
-  Polars[3]
-  string ["悓恫恔", "Ų±Ų­ŲØ", "ė…•ķ•˜ģ„ø"]
->
+
iex> d = Explorer.Series.from_list(["恓悓恫恔ćÆäø–ē•Œ", "Ł…Ų±Ų­ŲØŁ‹Ų§", "ģ•ˆė…•ķ•˜ģ„øģš”"]) +iex> Explorer.Series.substring(d, 1, 3) +#Explorer.Series< + Polars[3] + string ["悓恫恔", "Ų±Ų­ŲØ", "ė…•ķ•˜ģ„ø"] +>
@@ -6531,12 +6531,12 @@

upcase(series)

Examples -
iex> s = Explorer.Series.from_list(["abc", "def", "bcd"])
-iex> Explorer.Series.upcase(s)
-#Explorer.Series<
-  Polars[3]
-  string ["ABC", "DEF", "BCD"]
->
+
iex> s = Explorer.Series.from_list(["abc", "def", "bcd"])
+iex> Explorer.Series.upcase(s)
+#Explorer.Series<
+  Polars[3]
+  string ["ABC", "DEF", "BCD"]
+>
@@ -6583,19 +6583,19 @@

categories(series)

Examples -
iex> s = Explorer.Series.from_list(["a", "b", "c", nil, "a", "c"], dtype: :category)
-iex> Explorer.Series.categories(s)
-#Explorer.Series<
-  Polars[3]
-  string ["a", "b", "c"]
->
+
iex> s = Explorer.Series.from_list(["a", "b", "c", nil, "a", "c"], dtype: :category)
+iex> Explorer.Series.categories(s)
+#Explorer.Series<
+  Polars[3]
+  string ["a", "b", "c"]
+>
 
-iex> s = Explorer.Series.from_list(["c", "a", "b"], dtype: :category)
-iex> Explorer.Series.categories(s)
-#Explorer.Series<
-  Polars[3]
-  string ["c", "a", "b"]
->
+
iex> s = Explorer.Series.from_list(["c", "a", "b"], dtype: :category) +iex> Explorer.Series.categories(s) +#Explorer.Series< + Polars[3] + string ["c", "a", "b"] +>
@@ -6629,12 +6629,12 @@

dtype(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3])
-iex> Explorer.Series.dtype(s)
+
iex> s = Explorer.Series.from_list([1, 2, 3])
+iex> Explorer.Series.dtype(s)
 :integer
 
-iex> s = Explorer.Series.from_list(["a", nil, "b", "c"])
-iex> Explorer.Series.dtype(s)
+iex> s = Explorer.Series.from_list(["a", nil, "b", "c"])
+iex> Explorer.Series.dtype(s)
 :string
@@ -6670,31 +6670,31 @@

iotype(series)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3, 4])
-iex> Explorer.Series.iotype(s)
-{:s, 64}
+
iex> s = Explorer.Series.from_list([1, 2, 3, 4])
+iex> Explorer.Series.iotype(s)
+{:s, 64}
 
-iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])
-iex> Explorer.Series.iotype(s)
-{:s, 32}
+iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])
+iex> Explorer.Series.iotype(s)
+{:s, 32}
 
-iex> s = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])
-iex> Explorer.Series.iotype(s)
-{:s, 64}
+iex> s = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])
+iex> Explorer.Series.iotype(s)
+{:s, 64}
 
-iex> s = Explorer.Series.from_list([1.2, 2.3, 3.5, 4.5])
-iex> Explorer.Series.iotype(s)
-{:f, 64}
+iex> s = Explorer.Series.from_list([1.2, 2.3, 3.5, 4.5])
+iex> Explorer.Series.iotype(s)
+{:f, 64}
 
-iex> s = Explorer.Series.from_list([true, false, true])
-iex> Explorer.Series.iotype(s)
-{:u, 8}

The operation returns :none for strings and binaries, as they do not -provide a fixed-width binary representation:

iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.iotype(s)
+iex> s = Explorer.Series.from_list([true, false, true])
+iex> Explorer.Series.iotype(s)
+{:u, 8}

The operation returns :none for strings and binaries, as they do not +provide a fixed-width binary representation:

iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.iotype(s)
 :none

However, if appropriate, you can convert them to categorical types, -which will then return the index of each category:

iex> s = Explorer.Series.from_list(["a", "b", "c"], dtype: :category)
-iex> Explorer.Series.iotype(s)
-{:u, 32}
+which will then return the index of each category:

iex> s = Explorer.Series.from_list(["a", "b", "c"], dtype: :category)
+iex> Explorer.Series.iotype(s)
+{:u, 32}
@@ -6728,8 +6728,8 @@

size(series)

Examples -
iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])
-iex> Explorer.Series.size(s)
+
iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])
+iex> Explorer.Series.size(s)
 2
@@ -6780,19 +6780,19 @@

argsort(series, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([9, 3, 7, 1])
-iex> Explorer.Series.argsort(s)
-#Explorer.Series<
-  Polars[4]
-  integer [3, 1, 2, 0]
->
+
iex> s = Explorer.Series.from_list([9, 3, 7, 1])
+iex> Explorer.Series.argsort(s)
+#Explorer.Series<
+  Polars[4]
+  integer [3, 1, 2, 0]
+>
 
-iex> s = Explorer.Series.from_list([9, 3, 7, 1])
-iex> Explorer.Series.argsort(s, direction: :desc)
-#Explorer.Series<
-  Polars[4]
-  integer [0, 2, 1, 3]
->
+
iex> s = Explorer.Series.from_list([9, 3, 7, 1]) +iex> Explorer.Series.argsort(s, direction: :desc) +#Explorer.Series< + Polars[4] + integer [0, 2, 1, 3] +>
@@ -6827,12 +6827,12 @@

at(series, idx)

Examples -
iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.at(s, 2)
+
iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.at(s, 2)
 "c"
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.at(s, 4)
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.at(s, 4)
 ** (ArgumentError) index 4 out of bounds for series of size 3
@@ -6867,17 +6867,17 @@

at_every(series, every_n)

Examples -
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.at_every(s, 2)
-#Explorer.Series<
-  Polars[5]
-  integer [1, 3, 5, 7, 9]
->

If n is bigger than the size of the series, the result is a new series with only the first value of the supplied series.

iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.at_every(s, 20)
-#Explorer.Series<
-  Polars[1]
-  integer [1]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.at_every(s, 2)
+#Explorer.Series<
+  Polars[5]
+  integer [1, 3, 5, 7, 9]
+>

If n is bigger than the size of the series, the result is a new series with only the first value of the supplied series.

iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.at_every(s, 20)
+#Explorer.Series<
+  Polars[1]
+  integer [1]
+>
@@ -6911,21 +6911,21 @@

concat(series)

Examples -
iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([4, 5, 6])
-iex> Explorer.Series.concat([s1, s2])
-#Explorer.Series<
-  Polars[6]
-  integer [1, 2, 3, 4, 5, 6]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3])
+iex> s2 = Explorer.Series.from_list([4, 5, 6])
+iex> Explorer.Series.concat([s1, s2])
+#Explorer.Series<
+  Polars[6]
+  integer [1, 2, 3, 4, 5, 6]
+>
 
-iex> s1 = Explorer.Series.from_list([1, 2, 3])
-iex> s2 = Explorer.Series.from_list([4.0, 5.0, 6.4])
-iex> Explorer.Series.concat([s1, s2])
-#Explorer.Series<
-  Polars[6]
-  float [1.0, 2.0, 3.0, 4.0, 5.0, 6.4]
->
+
iex> s1 = Explorer.Series.from_list([1, 2, 3]) +iex> s2 = Explorer.Series.from_list([4.0, 5.0, 6.4]) +iex> Explorer.Series.concat([s1, s2]) +#Explorer.Series< + Polars[6] + float [1.0, 2.0, 3.0, 4.0, 5.0, 6.4] +>
@@ -6981,12 +6981,12 @@

distinct(series)

Examples -
iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()
-iex> Explorer.Series.distinct(s)
-#Explorer.Series<
-  Polars[3]
-  integer [1, 2, 3]
->
+
iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()
+iex> Explorer.Series.distinct(s)
+#Explorer.Series<
+  Polars[3]
+  integer [1, 2, 3]
+>
@@ -7020,8 +7020,8 @@

first(series)

Examples -
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.first(s)
+
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.first(s)
 1
@@ -7056,27 +7056,27 @@

format(list)

Examples -
iex> s1 = Explorer.Series.from_list(["a", "b", "c"])
-iex> s2 = Explorer.Series.from_list(["d", "e", "f"])
-iex> s3 = Explorer.Series.from_list(["g", "h", "i"])
-iex> Explorer.Series.format([s1, s2, s3])
-#Explorer.Series<
-  Polars[3]
-  string ["adg", "beh", "cfi"]
->
-
-iex> s1 = Explorer.Series.from_list(["a", "b", "c", "d"])
-iex> s2 = Explorer.Series.from_list([1, 2, 3, 4])
-iex> s3 = Explorer.Series.from_list([1.5, :nan, :infinity, :neg_infinity])
-iex> Explorer.Series.format([s1, "/", s2, "/", s3])
-#Explorer.Series<
-  Polars[4]
-  string ["a/1/1.5", "b/2/NaN", "c/3/inf", "d/4/-inf"]
->
-
-iex> s1 = Explorer.Series.from_list([<<1>>, <<239, 191, 19>>], dtype: :binary)
-iex> s2 = Explorer.Series.from_list([<<3>>, <<4>>], dtype: :binary)
-iex> Explorer.Series.format([s1, s2])
+
iex> s1 = Explorer.Series.from_list(["a", "b", "c"])
+iex> s2 = Explorer.Series.from_list(["d", "e", "f"])
+iex> s3 = Explorer.Series.from_list(["g", "h", "i"])
+iex> Explorer.Series.format([s1, s2, s3])
+#Explorer.Series<
+  Polars[3]
+  string ["adg", "beh", "cfi"]
+>
+
+iex> s1 = Explorer.Series.from_list(["a", "b", "c", "d"])
+iex> s2 = Explorer.Series.from_list([1, 2, 3, 4])
+iex> s3 = Explorer.Series.from_list([1.5, :nan, :infinity, :neg_infinity])
+iex> Explorer.Series.format([s1, "/", s2, "/", s3])
+#Explorer.Series<
+  Polars[4]
+  string ["a/1/1.5", "b/2/NaN", "c/3/inf", "d/4/-inf"]
+>
+
+iex> s1 = Explorer.Series.from_list([<<1>>, <<239, 191, 19>>], dtype: :binary)
+iex> s2 = Explorer.Series.from_list([<<3>>, <<4>>], dtype: :binary)
+iex> Explorer.Series.format([s1, s2])
 ** (RuntimeError) Polars Error: External error: invalid utf-8 sequence
@@ -7113,12 +7113,12 @@

head(series, n_elements \\ 10)

Examples -
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.head(s)
-#Explorer.Series<
-  Polars[10]
-  integer [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
->
+
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.head(s)
+#Explorer.Series<
+  Polars[10]
+  integer [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+>
@@ -7152,8 +7152,8 @@

last(series)

Examples -
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.last(s)
+
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.last(s)
 100
@@ -7182,12 +7182,12 @@

reverse(series)

Example -
iex> s = [1, 2, 3] |> Explorer.Series.from_list()
-iex> Explorer.Series.reverse(s)
-#Explorer.Series<
-  Polars[3]
-  integer [3, 2, 1]
->
+
iex> s = [1, 2, 3] |> Explorer.Series.from_list()
+iex> Explorer.Series.reverse(s)
+#Explorer.Series<
+  Polars[3]
+  integer [3, 2, 1]
+>
@@ -7232,47 +7232,47 @@

sample(series, n_or_frac, opts \\ [])

Examples -
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 10, seed: 100)
-#Explorer.Series<
-  Polars[10]
-  integer [55, 51, 33, 26, 5, 32, 62, 31, 9, 25]
->
-
-iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 0.05, seed: 100)
-#Explorer.Series<
-  Polars[5]
-  integer [49, 77, 96, 19, 18]
->
-
-iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 7, seed: 100, replace: true)
-#Explorer.Series<
-  Polars[7]
-  integer [4, 1, 3, 4, 3, 4, 2]
->
-
-iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 1.2, seed: 100, replace: true)
-#Explorer.Series<
-  Polars[6]
-  integer [4, 1, 3, 4, 3, 4]
->
-
-iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: false)
-#Explorer.Series<
-  Polars[10]
-  integer [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
->
-
-iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: true)
-#Explorer.Series<
-  Polars[10]
-  integer [7, 9, 2, 0, 4, 1, 3, 8, 5, 6]
->
+
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 10, seed: 100)
+#Explorer.Series<
+  Polars[10]
+  integer [55, 51, 33, 26, 5, 32, 62, 31, 9, 25]
+>
+
+iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 0.05, seed: 100)
+#Explorer.Series<
+  Polars[5]
+  integer [49, 77, 96, 19, 18]
+>
+
+iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 7, seed: 100, replace: true)
+#Explorer.Series<
+  Polars[7]
+  integer [4, 1, 3, 4, 3, 4, 2]
+>
+
+iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 1.2, seed: 100, replace: true)
+#Explorer.Series<
+  Polars[6]
+  integer [4, 1, 3, 4, 3, 4]
+>
+
+iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: false)
+#Explorer.Series<
+  Polars[10]
+  integer [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>
+
+iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: true)
+#Explorer.Series<
+  Polars[10]
+  integer [7, 9, 2, 0, 4, 1, 3, 8, 5, 6]
+>
@@ -7306,19 +7306,19 @@

shift(series, offset)

Examples -
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.shift(s, 2)
-#Explorer.Series<
-  Polars[5]
-  integer [nil, nil, 1, 2, 3]
->
+
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.shift(s, 2)
+#Explorer.Series<
+  Polars[5]
+  integer [nil, nil, 1, 2, 3]
+>
 
-iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.shift(s, -2)
-#Explorer.Series<
-  Polars[5]
-  integer [3, 4, 5, nil, nil]
->
+
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.shift(s, -2) +#Explorer.Series< + Polars[5] + integer [3, 4, 5, nil, nil] +>
@@ -7361,12 +7361,12 @@

shuffle(series, opts \\ [])

Examples -
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.shuffle(s, seed: 100)
-#Explorer.Series<
-  Polars[10]
-  integer [8, 10, 3, 1, 5, 2, 4, 9, 6, 7]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.shuffle(s, seed: 100)
+#Explorer.Series<
+  Polars[10]
+  integer [8, 10, 3, 1, 5, 2, 4, 9, 6, 7]
+>
@@ -7403,33 +7403,33 @@

slice(series, indices)

Examples -
iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.slice(s, [0, 2])
-#Explorer.Series<
-  Polars[2]
-  string ["a", "c"]
->
+
iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.slice(s, [0, 2])
+#Explorer.Series<
+  Polars[2]
+  string ["a", "c"]
+>
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.slice(s, 1..2)
-#Explorer.Series<
-  Polars[2]
-  string ["b", "c"]
->
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.slice(s, 1..2)
+#Explorer.Series<
+  Polars[2]
+  string ["b", "c"]
+>
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.slice(s, -2..-1)
-#Explorer.Series<
-  Polars[2]
-  string ["b", "c"]
->
+iex> s = Explorer.Series.from_list(["a", "b", "c"])
+iex> Explorer.Series.slice(s, -2..-1)
+#Explorer.Series<
+  Polars[2]
+  string ["b", "c"]
+>
 
-iex> s = Explorer.Series.from_list(["a", "b", "c"])
-iex> Explorer.Series.slice(s, 3..2//1)
-#Explorer.Series<
-  Polars[0]
-  string []
->
+
iex> s = Explorer.Series.from_list(["a", "b", "c"]) +iex> Explorer.Series.slice(s, 3..2//1) +#Explorer.Series< + Polars[0] + string [] +>
@@ -7463,29 +7463,29 @@

slice(series, offset, size)

Examples -
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
-iex> Explorer.Series.slice(s, 1, 2)
-#Explorer.Series<
-  Polars[2]
-  integer [2, 3]
->

Negative offsets count from the end of the series:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
-iex> Explorer.Series.slice(s, -3, 2)
-#Explorer.Series<
-  Polars[2]
-  integer [3, 4]
->

If the offset runs past the end of the series, -the series is empty:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
-iex> Explorer.Series.slice(s, 10, 3)
-#Explorer.Series<
-  Polars[0]
-  integer []
->

If the size runs past the end of the series, -the result may be shorter than the size:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
-iex> Explorer.Series.slice(s, -3, 4)
-#Explorer.Series<
-  Polars[3]
-  integer [3, 4, 5]
->
+
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
+iex> Explorer.Series.slice(s, 1, 2)
+#Explorer.Series<
+  Polars[2]
+  integer [2, 3]
+>

Negative offsets count from the end of the series:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
+iex> Explorer.Series.slice(s, -3, 2)
+#Explorer.Series<
+  Polars[2]
+  integer [3, 4]
+>

If the offset runs past the end of the series, +the series is empty:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
+iex> Explorer.Series.slice(s, 10, 3)
+#Explorer.Series<
+  Polars[0]
+  integer []
+>

If the size runs past the end of the series, +the result may be shorter than the size:

iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])
+iex> Explorer.Series.slice(s, -3, 4)
+#Explorer.Series<
+  Polars[3]
+  integer [3, 4, 5]
+>
@@ -7523,19 +7523,19 @@

sort(series, opts \\ [])

Examples -
iex> s = Explorer.Series.from_list([9, 3, 7, 1])
-iex> Explorer.Series.sort(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 3, 7, 9]
->
+
iex> s = Explorer.Series.from_list([9, 3, 7, 1])
+iex> Explorer.Series.sort(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 3, 7, 9]
+>
 
-iex> s = Explorer.Series.from_list([9, 3, 7, 1])
-iex> Explorer.Series.sort(s, direction: :desc)
-#Explorer.Series<
-  Polars[4]
-  integer [9, 7, 3, 1]
->
+
iex> s = Explorer.Series.from_list([9, 3, 7, 1]) +iex> Explorer.Series.sort(s, direction: :desc) +#Explorer.Series< + Polars[4] + integer [9, 7, 3, 1] +>
@@ -7571,12 +7571,12 @@

tail(series, n_elements \\ 10)

Examples -
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.tail(s)
-#Explorer.Series<
-  Polars[10]
-  integer [91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
->
+
iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.tail(s)
+#Explorer.Series<
+  Polars[10]
+  integer [91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
+>
@@ -7604,8 +7604,8 @@

unordered_distinct(series)

Examples -
iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()
-iex> Explorer.Series.unordered_distinct(s)
+
iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()
+iex> Explorer.Series.unordered_distinct(s)
@@ -7659,26 +7659,26 @@

cumulative_max(series, opts \\ [])

Examples -
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_max(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, 4]
->
+
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_max(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, 4]
+>
 
-iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_max(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, nil, 4]
->
+iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_max(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, nil, 4]
+>
 
-iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_max(s)
-#Explorer.Series<
-  Polars[4]
-  time [03:00:02.000000, 03:00:02.000000, nil, 13:24:56.000000]
->
+
iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list() +iex> Explorer.Series.cumulative_max(s) +#Explorer.Series< + Polars[4] + time [03:00:02.000000, 03:00:02.000000, nil, 13:24:56.000000] +>
@@ -7720,26 +7720,26 @@

cumulative_min(series, opts \\ [])

Examples -
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_min(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 1, 1, 1]
->
+
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_min(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 1, 1, 1]
+>
 
-iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_min(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 1, nil, 1]
->
+iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_min(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 1, nil, 1]
+>
 
-iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_min(s)
-#Explorer.Series<
-  Polars[4]
-  time [03:00:02.000000, 02:04:19.000000, nil, 02:04:19.000000]
->
+
iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list() +iex> Explorer.Series.cumulative_min(s) +#Explorer.Series< + Polars[4] + time [03:00:02.000000, 02:04:19.000000, nil, 02:04:19.000000] +>
@@ -7781,19 +7781,19 @@

cumulative_product(series, opts \\ [])

Examples -
iex> s = [1, 2, 3, 2] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_product(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 6, 12]
->
+
iex> s = [1, 2, 3, 2] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_product(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 6, 12]
+>
 
-iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_product(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, nil, 8]
->
+
iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list() +iex> Explorer.Series.cumulative_product(s) +#Explorer.Series< + Polars[4] + integer [1, 2, nil, 8] +>
@@ -7835,19 +7835,19 @@

cumulative_sum(series, opts \\ [])

Examples -
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_sum(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 3, 6, 10]
->
+
iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()
+iex> Explorer.Series.cumulative_sum(s)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 3, 6, 10]
+>
 
-iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()
-iex> Explorer.Series.cumulative_sum(s)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 3, nil, 7]
->
+
iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list() +iex> Explorer.Series.cumulative_sum(s) +#Explorer.Series< + Polars[4] + integer [1, 3, nil, 7] +>
@@ -7886,19 +7886,19 @@

ewm_mean(series, opts \\ [])

Examples -
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.ewm_mean(s)
-#Explorer.Series<
-  Polars[5]
-  float [1.0, 1.6666666666666667, 2.4285714285714284, 3.2666666666666666, 4.161290322580645]
->
+
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.ewm_mean(s)
+#Explorer.Series<
+  Polars[5]
+  float [1.0, 1.6666666666666667, 2.4285714285714284, 3.2666666666666666, 4.161290322580645]
+>
 
-iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.ewm_mean(s, alpha: 0.1)
-#Explorer.Series<
-  Polars[5]
-  float [1.0, 1.5263157894736843, 2.070110701107011, 2.6312881651642916, 3.2097140484969833]
->
+
iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.ewm_mean(s, alpha: 0.1) +#Explorer.Series< + Polars[5] + float [1.0, 1.5263157894736843, 2.070110701107011, 2.6312881651642916, 3.2097140484969833] +>
@@ -7950,73 +7950,73 @@

fill_missing(series, value)

Examples -
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, :forward)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 2, 4]
->
-
-iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, :backward)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 4, 4]
->
-
-iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, :max)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 4, 4]
->
-
-iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, :min)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 1, 4]
->
-
-iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, :mean)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 2, 4]
->

Values that belong to the series itself can also be added as missing:

iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, 3)
-#Explorer.Series<
-  Polars[4]
-  integer [1, 2, 3, 4]
->
-
-iex> s = Explorer.Series.from_list(["a", "b", nil, "d"])
-iex> Explorer.Series.fill_missing(s, "c")
-#Explorer.Series<
-  Polars[4]
-  string ["a", "b", "c", "d"]
->

Mismatched types will raise:

iex> s = Explorer.Series.from_list([1, 2, nil, 4])
-iex> Explorer.Series.fill_missing(s, "foo")
-** (ArgumentError) cannot invoke Explorer.Series.fill_missing/2 with mismatched dtypes: :integer and "foo"

Floats in particular accept missing values to be set to NaN, Inf, and -Inf:

iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
-iex> Explorer.Series.fill_missing(s, :nan)
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, NaN, 4.0]
->
-
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
-iex> Explorer.Series.fill_missing(s, :infinity)
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, Inf, 4.0]
->
-
-iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
-iex> Explorer.Series.fill_missing(s, :neg_infinity)
-#Explorer.Series<
-  Polars[4]
-  float [1.0, 2.0, -Inf, 4.0]
->
+
iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, :forward)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 2, 4]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, :backward)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 4, 4]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, :max)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 4, 4]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, :min)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 1, 4]
+>
+
+iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, :mean)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 2, 4]
+>

Values that belong to the series itself can also be added as missing:

iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, 3)
+#Explorer.Series<
+  Polars[4]
+  integer [1, 2, 3, 4]
+>
+
+iex> s = Explorer.Series.from_list(["a", "b", nil, "d"])
+iex> Explorer.Series.fill_missing(s, "c")
+#Explorer.Series<
+  Polars[4]
+  string ["a", "b", "c", "d"]
+>

Mismatched types will raise:

iex> s = Explorer.Series.from_list([1, 2, nil, 4])
+iex> Explorer.Series.fill_missing(s, "foo")
+** (ArgumentError) cannot invoke Explorer.Series.fill_missing/2 with mismatched dtypes: :integer and "foo"

Floats in particular accept missing values to be set to NaN, Inf, and -Inf:

iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
+iex> Explorer.Series.fill_missing(s, :nan)
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, NaN, 4.0]
+>
+
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
+iex> Explorer.Series.fill_missing(s, :infinity)
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, Inf, 4.0]
+>
+
+iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])
+iex> Explorer.Series.fill_missing(s, :neg_infinity)
+#Explorer.Series<
+  Polars[4]
+  float [1.0, 2.0, -Inf, 4.0]
+>
@@ -8054,19 +8054,19 @@

window_max(series, window_size, opts \\ []) Examples

-
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_max(s, 4)
-#Explorer.Series<
-  Polars[10]
-  integer [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_max(s, 4)
+#Explorer.Series<
+  Polars[10]
+  integer [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_max(s, 2, weights: [1.0, 2.0])
-#Explorer.Series<
-  Polars[10]
-  float [1.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.window_max(s, 2, weights: [1.0, 2.0]) +#Explorer.Series< + Polars[10] + float [1.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0] +>
@@ -8104,26 +8104,26 @@

window_mean(series, window_size, opts \\ [] Examples

-
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_mean(s, 4)
-#Explorer.Series<
-  Polars[10]
-  float [1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_mean(s, 4)
+#Explorer.Series<
+  Polars[10]
+  float [1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75])
-#Explorer.Series<
-  Polars[10]
-  float [0.25, 1.75, 2.75, 3.75, 4.75, 5.75, 6.75, 7.75, 8.75, 9.75]
->
+iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75])
+#Explorer.Series<
+  Polars[10]
+  float [0.25, 1.75, 2.75, 3.75, 4.75, 5.75, 6.75, 7.75, 8.75, 9.75]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75], min_periods: nil)
-#Explorer.Series<
-  Polars[10]
-  float [nil, 1.75, 2.75, 3.75, 4.75, 5.75, 6.75, 7.75, 8.75, 9.75]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75], min_periods: nil) +#Explorer.Series< + Polars[10] + float [nil, 1.75, 2.75, 3.75, 4.75, 5.75, 6.75, 7.75, 8.75, 9.75] +>
@@ -8161,26 +8161,26 @@

window_median(series, window_size, opts \\ Examples

-
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_median(s, 4)
-#Explorer.Series<
-  Polars[10]
-  float [1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_median(s, 4)
+#Explorer.Series<
+  Polars[10]
+  float [1.0, 1.5, 2.0, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75])
-#Explorer.Series<
-  Polars[10]
-  float [2.0, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]
->
+iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75])
+#Explorer.Series<
+  Polars[10]
+  float [2.0, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75], min_periods: nil)
-#Explorer.Series<
-  Polars[10]
-  float [nil, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75], min_periods: nil) +#Explorer.Series< + Polars[10] + float [nil, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5] +>
@@ -8218,19 +8218,19 @@

window_min(series, window_size, opts \\ []) Examples

-
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_min(s, 4)
-#Explorer.Series<
-  Polars[10]
-  integer [1, 1, 1, 1, 2, 3, 4, 5, 6, 7]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_min(s, 4)
+#Explorer.Series<
+  Polars[10]
+  integer [1, 1, 1, 1, 2, 3, 4, 5, 6, 7]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_min(s, 2, weights: [1.0, 2.0])
-#Explorer.Series<
-  Polars[10]
-  float [1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.window_min(s, 2, weights: [1.0, 2.0]) +#Explorer.Series< + Polars[10] + float [1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] +>
@@ -8268,19 +8268,19 @@

window_standard_deviation(series, window_si Examples

-
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 1])
-iex> Explorer.Series.window_standard_deviation(s, 2)
-#Explorer.Series<
-  Polars[5]
-  float [0.0, 0.7071067811865476, 0.7071067811865476, 0.7071067811865476, 2.1213203435596424]
->
+
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 1])
+iex> Explorer.Series.window_standard_deviation(s, 2)
+#Explorer.Series<
+  Polars[5]
+  float [0.0, 0.7071067811865476, 0.7071067811865476, 0.7071067811865476, 2.1213203435596424]
+>
 
-iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 6])
-iex> Explorer.Series.window_standard_deviation(s, 2, weights: [0.25, 0.75])
-#Explorer.Series<
-  Polars[6]
-  float [0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193]
->
+
iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 6]) +iex> Explorer.Series.window_standard_deviation(s, 2, weights: [0.25, 0.75]) +#Explorer.Series< + Polars[6] + float [0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193, 0.4330127018922193] +>
@@ -8318,19 +8318,19 @@

window_sum(series, window_size, opts \\ []) Examples

-
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_sum(s, 4)
-#Explorer.Series<
-  Polars[10]
-  integer [1, 3, 6, 10, 14, 18, 22, 26, 30, 34]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
+iex> Explorer.Series.window_sum(s, 4)
+#Explorer.Series<
+  Polars[10]
+  integer [1, 3, 6, 10, 14, 18, 22, 26, 30, 34]
+>
 
-iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()
-iex> Explorer.Series.window_sum(s, 2, weights: [1.0, 2.0])
-#Explorer.Series<
-  Polars[10]
-  float [1.0, 5.0, 8.0, 11.0, 14.0, 17.0, 20.0, 23.0, 26.0, 29.0]
->
+
iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list() +iex> Explorer.Series.window_sum(s, 2, weights: [1.0, 2.0]) +#Explorer.Series< + Polars[10] + float [1.0, 5.0, 8.0, 11.0, 14.0, 17.0, 20.0, 23.0, 26.0, 29.0] +>
diff --git a/Explorer.TensorFrame.html b/Explorer.TensorFrame.html index 11e747d08..4f85a8744 100644 --- a/Explorer.TensorFrame.html +++ b/Explorer.TensorFrame.html @@ -13,7 +13,7 @@ - + @@ -113,13 +113,13 @@

TensorFrame is a representation of Explorer.DataFrame -that is designed to work inside Nx's defn expressions.

For example, imagine the following defn:

defn add_columns(tf) do
-  tf[:a] + tf[:b]
-end

We can now pass a DataFrame as argument:

iex> add_columns(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
-#Nx.Tensor<
-  s64[2]
-  [32, 34]
->

Passing an Explorer.DataFrame to a defn will automatically +that is designed to work inside Nx's defn expressions.

For example, imagine the following defn:

defn add_columns(tf) do
+  tf[:a] + tf[:b]
+end

We can now pass a DataFrame as argument:

iex> add_columns(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
+#Nx.Tensor<
+  s64[2]
+  [32, 34]
+>

Passing an Explorer.DataFrame to a defn will automatically convert it to a TensorFrame. The TensorFrame will lazily build tensors out of the used dataframe fields.

@@ -130,29 +130,29 @@

Due to the integration with Nx, you can also pass dataframes into Nx.stack/2 and Nx.concatenate and they will be automatically converted to tensors. This makes it easy to pass dataframes into -neural networks and other computationally intensive algorithms:

iex> Nx.concatenate(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
-#Nx.Tensor<
-  s64[4]
-  [11, 12, 21, 22]
->
-
-iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
-#Nx.Tensor<
-  s64[2][2]
-  [
-    [11, 12],
-    [21, 22]
-  ]
->
-
-iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]), axis: -1)
-#Nx.Tensor<
-  s64[2][2]
-  [
-    [11, 21],
-    [12, 22]
-  ]
->

+neural networks and other computationally intensive algorithms:

iex> Nx.concatenate(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
+#Nx.Tensor<
+  s64[4]
+  [11, 12, 21, 22]
+>
+
+iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))
+#Nx.Tensor<
+  s64[2][2]
+  [
+    [11, 12],
+    [21, 22]
+  ]
+>
+
+iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]), axis: -1)
+#Nx.Tensor<
+  s64[2][2]
+  [
+    [11, 21],
+    [12, 22]
+  ]
+>

Warning: returning TensorFrames @@ -165,14 +165,14 @@

above we used Nx to add two columns, if you want to put the result of the computation back into a DataFrame, you can use Explorer.DataFrame.put/4, which also accepts -tensors:

iex> df = Explorer.DataFrame.new(a: [11, 12], b: [21, 22])
-iex> Explorer.DataFrame.put(df, "result", add_columns(df))
-#Explorer.DataFrame<
-  Polars[2 x 3]
-  a integer [11, 12]
-  b integer [21, 22]
-  result integer [32, 34]
->

One benefit of using Explorer.DataFrame.put/4 is that it will +tensors:

iex> df = Explorer.DataFrame.new(a: [11, 12], b: [21, 22])
+iex> Explorer.DataFrame.put(df, "result", add_columns(df))
+#Explorer.DataFrame<
+  Polars[2 x 3]
+  a integer [11, 12]
+  b integer [21, 22]
+  result integer [32, 34]
+>

One benefit of using Explorer.DataFrame.put/4 is that it will preserve the type of the column if one already exists. Alternatively, use Explorer.Series.from_tensor/1 to explicitly convert a tensor back to a series.

@@ -311,7 +311,7 @@

pull(tf, name)

Examples

-
Explorer.TensorFrame.pull(tf, "some_column")
+
Explorer.TensorFrame.pull(tf, "some_column")

@@ -339,7 +339,7 @@

put(tf, name, tensor)

Examples

-
Explorer.TensorFrame.put(tf, "result", some_tensor)
+
Explorer.TensorFrame.put(tf, "result", some_tensor)
diff --git a/Explorer.epub b/Explorer.epub index 51f754eb8..9b5062b4f 100644 Binary files a/Explorer.epub and b/Explorer.epub differ diff --git a/Explorer.html b/Explorer.html index 718cee71a..a6788d43e 100644 --- a/Explorer.html +++ b/Explorer.html @@ -13,7 +13,7 @@ - + @@ -119,13 +119,13 @@

Getting started

-

Inside an Elixir script or Livebook:

Mix.install([
-  {:explorer, "~> 0.6.0"}
-])

Or in the mix.exs file of your application:

def deps do
-  [
-    {:explorer, "~> 0.6.0"}
-  ]
-end

+

Inside an Elixir script or Livebook:

Mix.install([
+  {:explorer, "~> 0.6.0"}
+])

Or in the mix.exs file of your application:

def deps do
+  [
+    {:explorer, "~> 0.6.0"}
+  ]
+end

A glimpse of the API @@ -135,13 +135,13 @@

of one data type only - or one dtype for short. Notice that nil values are permitted in series of any dtype.

  • using a dataframe, that is just a way to represent one or more series together, and work with them as a whole. The only restriction is that all the series shares -the same size.

  • A series can be created from a list:

    fruits = Explorer.Series.from_list(["apple", "mango", "banana", "orange"])

    Your newly created series is going to look like:

    #Explorer.Series<
    -  Polars[4]
    -  string ["apple", "mango", "banana", "orange"]
    ->

    And you can, for example, sort that series:

    Explorer.Series.sort(fruits)

    Resulting in the following:

    #Explorer.Series<
    -  Polars[4]
    -  string ["apple", "banana", "mango", "orange"]
    ->

    +the same size.

    A series can be created from a list:

    fruits = Explorer.Series.from_list(["apple", "mango", "banana", "orange"])

    Your newly created series is going to look like:

    #Explorer.Series<
    +  Polars[4]
    +  string ["apple", "mango", "banana", "orange"]
    +>

    And you can, for example, sort that series:

    Explorer.Series.sort(fruits)

    Resulting in the following:

    #Explorer.Series<
    +  Polars[4]
    +  string ["apple", "banana", "mango", "orange"]
    +>

    Dataframes @@ -151,13 +151,13 @@

    IO functions. This is by far the most common way to load dataframes in Explorer. We accept Parquet, IPC, CSV, and NDJSON files.

  • by using the Explorer.DataFrame.new/2 function, that is neat for small experiments. -We are going to use this function here.

  • You can pass either series or lists to it:

    mountains = Explorer.DataFrame.new(name: ["Everest", "K2", "Aconcagua"], elevation: [8848, 8611, 6962])

    Your dataframe is going to look like this:

    #Explorer.DataFrame<
    -  Polars[3 x 2]
    -  name string ["Everest", "K2", "Aconcagua"]
    -  elevation integer [8848, 8611, 6962]
    ->

    It's also possible to see a dataframe like a table, using the Explorer.DataFrame.table/2 -function:

    Explorer.DataFrame.table(mountains)

    Prints:

    +-------------------------------------------+
    -| Explorer DataFrame: [rows: 3, columns: 2] |
    +We are going to use this function here.

    You can pass either series or lists to it:

    mountains = Explorer.DataFrame.new(name: ["Everest", "K2", "Aconcagua"], elevation: [8848, 8611, 6962])

    Your dataframe is going to look like this:

    #Explorer.DataFrame<
    +  Polars[3 x 2]
    +  name string ["Everest", "K2", "Aconcagua"]
    +  elevation integer [8848, 8611, 6962]
    +>

    It's also possible to see a dataframe like a table, using the Explorer.DataFrame.table/2 +function:

    Explorer.DataFrame.table(mountains)

    Prints:

    +-------------------------------------------+
    +| Explorer DataFrame: [rows: 3, columns: 2] |
     +---------------------+---------------------+
     |        name         |      elevation      |
     |      <string>       |      <integer>      |
    @@ -170,13 +170,13 @@ 

    +---------------------+---------------------+

    And now I want to show you how to filter our dataframe. But first, let's require the Explorer.DataFrame module and give a short name to it:

    require Explorer.DataFrame, as: DF

    The "require" is needed to load the macro features of that module. We give it a shorter name to simplify our examples.

    Now let's go to the filter. I want to filter the mountains that are above -the mean elevation in our dataframe:

    DF.filter(mountains, elevation > mean(elevation))

    You can see that we can refer to the columns using their names, and use functions +the mean elevation in our dataframe:

    DF.filter(mountains, elevation > mean(elevation))

    You can see that we can refer to the columns using their names, and use functions without define them. This is possible due the powerful Explorer.Query features, -and it's the main reason we need to "require" the Explorer.DataFrame module.

    The result is going to look like this:

    #Explorer.DataFrame<
    -  Polars[2 x 2]
    -  name string ["Everest", "K2"]
    -  elevation integer [8848, 8611]
    ->

    There is an extensive guide that you can play with Livebook: +and it's the main reason we need to "require" the Explorer.DataFrame module.

    The result is going to look like this:

    #Explorer.DataFrame<
    +  Polars[2 x 2]
    +  name string ["Everest", "K2"]
    +  elevation integer [8848, 8611]
    +>

    There is an extensive guide that you can play with Livebook: Ten Minutes to Explorer

    You can also check the Explorer.DataFrame and Explorer.Series docs for further details.

    diff --git a/FSS.HTTP.Config.html b/FSS.HTTP.Config.html deleted file mode 100644 index 5f3fe69e6..000000000 --- a/FSS.HTTP.Config.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - FSS.HTTP.Config ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.HTTP.Config - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Types -

    - -
    -
    - t() - -
    - -
    - -
    - -
    - - -
    -

    - - -Types - -

    -
    -
    - - - -
    - -
    - -
    @type t() :: %FSS.HTTP.Config{headers: [{String.t(), String.t()}]}
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.HTTP.Entry.html b/FSS.HTTP.Entry.html deleted file mode 100644 index 59f70da6d..000000000 --- a/FSS.HTTP.Entry.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - FSS.HTTP.Entry ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.HTTP.Entry - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Types -

    - -
    -
    - t() - -
    - -
    - -
    - -
    - - -
    -

    - - -Types - -

    -
    -
    - - - -
    - -
    - -
    @type t() :: %FSS.HTTP.Entry{config: FSS.HTTP.Config.t(), url: String.t()}
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.HTTP.html b/FSS.HTTP.html deleted file mode 100644 index f3f355c96..000000000 --- a/FSS.HTTP.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - FSS.HTTP ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.HTTP - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Functions -

    - - - -
    - -
    - - -
    -

    - - -Functions - -

    -
    -
    - - - -
    - - - Link to this function - -

    parse(url, opts \\ [])

    - - - - View Source - - - -
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.Local.Entry.html b/FSS.Local.Entry.html deleted file mode 100644 index a719b8a01..000000000 --- a/FSS.Local.Entry.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - FSS.Local.Entry ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.Local.Entry - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Types -

    - -
    -
    - t() - -
    - -
    - -
    - -
    - - -
    -

    - - -Types - -

    -
    -
    - - - -
    - -
    - -
    @type t() :: %FSS.Local.Entry{path: String.t()}
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.Local.html b/FSS.Local.html deleted file mode 100644 index 733d5c6b4..000000000 --- a/FSS.Local.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - FSS.Local ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.Local - (Explorer v0.6.2-dev) - -

    - - - - - -
    -
    -
    -
    - - - - diff --git a/FSS.S3.Config.html b/FSS.S3.Config.html deleted file mode 100644 index ed8746093..000000000 --- a/FSS.S3.Config.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - FSS.S3.Config ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.S3.Config - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Types -

    - -
    -
    - t() - -
    - -
    - -
    - -
    - - -
    -

    - - -Types - -

    -
    -
    - - - -
    - -
    - -
    @type t() :: %FSS.S3.Config{
    -  access_key_id: String.t(),
    -  endpoint: String.t() | nil,
    -  region: String.t(),
    -  secret_access_key: String.t(),
    -  token: String.t() | nil
    -}
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.S3.Entry.html b/FSS.S3.Entry.html deleted file mode 100644 index 8c47fc158..000000000 --- a/FSS.S3.Entry.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - FSS.S3.Entry ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.S3.Entry - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Types -

    - -
    -
    - t() - -
    - -
    - -
    -
    -

    - Functions -

    - - - - - -
    - -
    - - -
    -

    - - -Types - -

    -
    -
    - - - -
    - -
    - -
    @type t() :: %FSS.S3.Entry{
    -  bucket: String.t(),
    -  config: FSS.S3.Config.t(),
    -  key: String.t(),
    -  port: pos_integer()
    -}
    - -
    - - -
    -
    - -
    -
    - -
    -

    - - -Functions - -

    -
    -
    - -
    - - - Link to this function - -

    check!(config, key, env)

    - - - - View Source - - - -
    - -
    - - -
    -
    -
    - - - -
    - - - Link to this function - -

    parse(url, opts \\ [])

    - - - - View Source - - - -
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.S3.html b/FSS.S3.html deleted file mode 100644 index 16a98ddb9..000000000 --- a/FSS.S3.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - FSS.S3 ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS.S3 - (Explorer v0.6.2-dev) - -

    - - - -
    -

    - - - Summary - -

    -
    -

    - Functions -

    - - - -
    - -
    - - -
    -

    - - -Functions - -

    -
    -
    - -
    - - - Link to this function - -

    config_from_system_env()

    - - - - View Source - - - -
    - -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - - - diff --git a/FSS.html b/FSS.html deleted file mode 100644 index 25648ce88..000000000 --- a/FSS.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - FSS ā€” Explorer v0.6.2-dev - - - - - - - - - - - - - - - - -
    - - - - - -
    - -
    -
    - -

    - - - - - - View Source - - - FSS - (Explorer v0.6.2-dev) - -

    - - -
    -

    A small abstraction for filesystems.

    -
    - - - - -
    -
    -
    -
    - - - - diff --git a/api-reference.html b/api-reference.html index 249c5040b..fec2a0aaf 100644 --- a/api-reference.html +++ b/api-reference.html @@ -13,7 +13,7 @@ - + @@ -228,71 +228,6 @@

    TensorFrame is a representation of Explorer.DataFrame that is designed to work inside Nx's defn expressions.

    - -
    -
    - FSS - -
    - -

    A small abstraction for filesystems.

    - -
    -
    -
    - FSS.HTTP - -
    - -
    -
    - - -
    -
    - - -
    -
    -
    - FSS.Local - -
    - -
    -
    - - -
    -
    -
    - FSS.S3 - -
    - -
    -
    - - -
    -
    -
    - FSS.S3.Entry - -
    -
    diff --git a/changelog.html b/changelog.html index ea81c8db1..0e0d2dade 100644 --- a/changelog.html +++ b/changelog.html @@ -13,7 +13,7 @@ - + @@ -307,13 +307,13 @@

    • Add across and comprehensions to Explorer.Query. These features allow a -more flexible and elegant way to work with multiple columns at once. Example:

      iris = Explorer.Datasets.iris()
      -Explorer.DataFrame.mutate(iris,
      - for col <- across(["sepal_width", "sepal_length", "petal_length", "petal_width"]) do
      -   {col.name, (col - mean(col)) / variance(col)}
      - end
      -)

      See the Explorer.Query documentation for further details.

    • Add support for regexes to select columns of a dataframe. Example:

      df = Explorer.Datasets.wine()
      -df[~r/(class|hue)/]
    • Add the :max_rows and :columns options to Explorer.DataFrame.from_parquet/2. This mirrors +more flexible and elegant way to work with multiple columns at once. Example:

      iris = Explorer.Datasets.iris()
      +Explorer.DataFrame.mutate(iris,
      + for col <- across(["sepal_width", "sepal_length", "petal_length", "petal_width"]) do
      +   {col.name, (col - mean(col)) / variance(col)}
      + end
      +)

      See the Explorer.Query documentation for further details.

    • Add support for regexes to select columns of a dataframe. Example:

      df = Explorer.Datasets.wine()
      +df[~r/(class|hue)/]
    • Add the :max_rows and :columns options to Explorer.DataFrame.from_parquet/2. This mirrors the from_csv/2 function.

    • Allow Explorer.Series functions that accept floats to work with :nan, :infinity and :neg_infinity values.

    • Add Explorer.DataFrame.shuffle/2 and Explorer.Series.shuffle/2.

    • Add support for a list of filters in Explorer.DataFrame.filter/2. These filters are joined as and expressions.

    @@ -368,7 +368,7 @@

    • Add DataFrame.describe/2 to gather some statistics from a dataframe.

    • Add Series.nil_count/1 to count nil values.

    • Add Series.in/2 to check if a given value is inside a series.

    • Add Series float predicates: is_finite/1, is_infinite/1 and is_nan/1.

    • Add Series string functions: contains/2, trim/1, trim_leading/1, trim_trailing/1, upcase/1 and downcase/1.

    • Enable slicing of lazy frames (LazyFrame).

    • Add IO operations "from/load" to the lazy frame implementation.

    • Add support for the :lazy option in the DataFrame.new/2 function.

    • Add Series float rounding methods: round/2, floor/1 and ceil/1.

    • Add support for precompiling to Linux running on RISCV CPUs.

    • Add support for precompiling to Linux - with musl - running on AARCH64 computers.

    • Allow DataFrame.new/1 to receive the :dtypes option.

    • Accept :nan as an option for Series.fill_missing/2 with float series.

    • Add basic support for the categorical dtype - the :category dtype.

    • Add Series.categories/1 to return categories from a categorical series.

    • Add Series.categorise/2 to categorise a series of integers using predefined categories.

    • Add Series.replace/2 to replace the contents of a series.

    • Support selecting columns with unusual names (like with spaces) inside Explorer.Query -with col/1.

      The usage is like this:

      Explorer.DataFrame.filter(df, col("my col") > 42)

    +with col/1.

    The usage is like this:

    Explorer.DataFrame.filter(df, col("my col") > 42)

    Fixed @@ -396,7 +396,7 @@

    • Add Series.quotient/2 and Series.remainder/2 to work with integer division.

    • Add Series.iotype/1 to return the underlying representation type.

    • Allow series on both sides of binary operations, like: add(series, 1) and add(1, series).

    • Allow comparison, concat and coalesce operations on "(series, lazy series)".

    • Add lazy version of Series.sample/3 and Series.size/1.

    • Add support for Arrow IPC Stream files.

    • Add Explorer.Query and the macros that allow a simplified query API. This is a huge improvement to some of the main functions, and allow refering to -columns as they were variables.

      Before this change we would need to write a filter like this:

      Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1["col1"], 42))

      But now it's also possible to write this operation like this:

      Explorer.DataFrame.filter(df, col1 > 42)

      This operation is going to use filter_with/2 underneath, which means that +columns as they were variables.

      Before this change we would need to write a filter like this:

      Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1["col1"], 42))

      But now it's also possible to write this operation like this:

      Explorer.DataFrame.filter(df, col1 > 42)

      This operation is going to use filter_with/2 underneath, which means that is going to use lazy series and compute the results at once. Notice that is mandatory to "require" the DataFrame module, since these operations are implemented as macros.

      The following new macros were added:

      • filter/2
      • mutate/2
      • summarise/2
      • arrange/2

      They substitute older versions that did not accept the new query syntax.

    • Add DataFrame.put/3 to enable adding or replacing columns in a eager manner. diff --git a/dist/search_data-45C0429C.js b/dist/search_data-8C0D2CAA.js similarity index 77% rename from dist/search_data-45C0429C.js rename to dist/search_data-8C0D2CAA.js index dc726272e..777fc15f5 100644 --- a/dist/search_data-45C0429C.js +++ b/dist/search_data-8C0D2CAA.js @@ -1 +1 @@ -searchData={"items":[{"type":"module","title":"Explorer","doc":"Explorer brings series (one-dimensional) and dataframes (two-dimensional) for fast\ndata exploration to Elixir.","ref":"Explorer.html"},{"type":"module","title":"Getting started - Explorer","doc":"Inside an Elixir script or [Livebook](https://livebook.dev):\n\n```elixir\nMix.install([\n {:explorer, \"~> 0.6.0\"}\n])\n```\n\nOr in the `mix.exs` file of your application:\n\n```elixir\ndef deps do\n [\n {:explorer, \"~> 0.6.0\"}\n ]\nend\n```","ref":"Explorer.html#module-getting-started"},{"type":"module","title":"A glimpse of the API - Explorer","doc":"We have two ways to represent data with Explorer:\n\n- using a series, that is similar to a list, but is guaranteed to contain items\n of one data type only - or one *dtype* for short. Notice that nil values are\n permitted in series of any dtype.\n\n- using a dataframe, that is just a way to represent one or more series together,\n and work with them as a whole. The only restriction is that all the series shares\n the same size.\n\nA series can be created from a list:\n\n```elixir\nfruits = Explorer.Series.from_list([\"apple\", \"mango\", \"banana\", \"orange\"])\n```\n\nYour newly created series is going to look like:\n\n```\n#Explorer.Series \n```\n\nAnd you can, for example, sort that series:\n\n```elixir\nExplorer.Series.sort(fruits)\n```\n\nResulting in the following:\n\n```\n#Explorer.Series \n```\n\n#","ref":"Explorer.html#module-a-glimpse-of-the-api"},{"type":"module","title":"Dataframes - Explorer","doc":"Dataframes can be created in two ways:\n\n- by reading from files or memory using the\n [IO functions](https://hexdocs.pm/explorer/Explorer.DataFrame.html#module-io-operations).\n This is by far the most common way to load dataframes in Explorer.\n We accept Parquet, IPC, CSV, and NDJSON files.\n\n- by using the `Explorer.DataFrame.new/2` function, that is neat for small experiments.\n We are going to use this function here.\n\nYou can pass either series or lists to it:\n\n```elixir\nmountains = Explorer.DataFrame.new(name: [\"Everest\", \"K2\", \"Aconcagua\"], elevation: [8848, 8611, 6962])\n```\n\nYour dataframe is going to look like this:\n\n```\n#Explorer.DataFrame \n```\n\nIt's also possible to see a dataframe like a table, using the `Explorer.DataFrame.table/2`\nfunction:\n\n```elixir\nExplorer.DataFrame.table(mountains)\n```\n\nPrints:\n\n```\n+-------------------------------------------+\n| Explorer DataFrame: [rows: 3, columns: 2] |\n+---------------------+---------------------+\n| name | elevation |\n| | |\n+=====================+=====================+\n| Everest | 8848 |\n+---------------------+---------------------+\n| K2 | 8611 |\n+---------------------+---------------------+\n| Aconcagua | 6962 |\n+---------------------+---------------------+\n```\n\nAnd now I want to show you how to filter our dataframe. But first, let's require\nthe `Explorer.DataFrame` module and give a short name to it:\n\n```elixir\nrequire Explorer.DataFrame, as: DF\n```\n\nThe \"require\" is needed to load the macro features of that module.\nWe give it a shorter name to simplify our examples.\n\nNow let's go to the filter. I want to filter the mountains that are above\nthe mean elevation in our dataframe:\n\n```elixir\nDF.filter(mountains, elevation > mean(elevation))\n```\n\nYou can see that we can refer to the columns using their names, and use functions\nwithout define them. This is possible due the powerful `Explorer.Query` features,\nand it's the main reason we need to \"require\" the `Explorer.DataFrame` module.\n\nThe result is going to look like this:\n\n```\n#Explorer.DataFrame \n```\n\nThere is an extensive guide that you can play with Livebook:\n[Ten Minutes to Explorer](https://hexdocs.pm/explorer/exploring_explorer.html)\n\nYou can also check the `Explorer.DataFrame` and `Explorer.Series` docs for further\ndetails.","ref":"Explorer.html#module-dataframes"},{"type":"module","title":"Features and design - Explorer","doc":"Explorer high-level features are:\n\n- Simply typed series: `:binary`, `:boolean`, `:category`, `:date`, `:datetime`, `:float`, `:integer`, `:string`, and `:time`.\n\n- A powerful but constrained and opinionated API, so you spend less time looking\n for the right function and more time doing data manipulation.\n\n- Pluggable backends, providing a uniform API whether you're working in-memory\n or (forthcoming) on remote databases or even Spark dataframes.\n\n- The first (and default) backend is based on NIF bindings to the blazing-fast\n [polars](https://docs.rs/polars) library.\n\nThe API is heavily influenced by [Tidy Data](https://vita.had.co.nz/papers/tidy-data.pdf)\nand borrows much of its design from [dplyr](https://dplyr.tidyverse.org). The philosophy\nis heavily influenced by this passage from `dplyr`'s documentation:\n\n> - By constraining your options, it helps you think about your data manipulation\n> challenges.\n>\n> - It provides simple ā€œverbsā€, functions that correspond to the most common data\n> manipulation tasks, to help you translate your thoughts into code.\n>\n> - It uses efficient backends, so you spend less time waiting for the computer.\n\nThe aim here isn't to have the fastest dataframe library around (though it certainly\nhelps that [we're building on Polars, one of the fastest](https://h2oai.github.io/db-benchmark/)).\nInstead, we're aiming to bridge the best of many worlds:\n\n- the elegance of `dplyr`\n- the speed of `polars`\n- the joy of Elixir\n\nThat means you can expect the guiding principles to be 'Elixir-ish'. For example,\nyou won't see the underlying data mutated, even if that's the most efficient implementation.\nExplorer functions will always return a new dataframe or series.","ref":"Explorer.html#module-features-and-design"},{"type":"module","title":"Explorer.DataFrame","doc":"The DataFrame struct and API.\n\nDataframes are two-dimensional tabular data structures similar to a spreadsheet.\nFor example, the Iris dataset:\n\n iex> Explorer.Datasets.iris()\n #Explorer.DataFrame \n\nThis dataframe has 150 rows and five columns. Each column is an `Explorer.Series`\nof the same size (150):\n\n iex> df = Explorer.Datasets.iris()\n iex> df[\"sepal_length\"]\n #Explorer.Series","ref":"Explorer.DataFrame.html"},{"type":"module","title":"Creating dataframes - Explorer.DataFrame","doc":"Dataframes can be created from normal Elixir terms. The main way you might do this is\nwith the `new/1` function. For example:\n\n iex> Explorer.DataFrame.new(a: [\"a\", \"b\"], b: [1, 2])\n #Explorer.DataFrame \n\nOr with a list of maps:\n\n iex> Explorer.DataFrame.new([%{\"col1\" => \"a\", \"col2\" => 1}, %{\"col1\" => \"b\", \"col2\" => 2}])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#module-creating-dataframes"},{"type":"module","title":"Verbs - Explorer.DataFrame","doc":"Explorer uses the idea of a consistent set of SQL-like `verbs` like\n[`dplyr`](https://dplyr.tidyverse.org) which can help solve common\ndata manipulation challenges. These are split into single table verbs,\nmultiple table verbs, and row-based verbs:\n\n#","ref":"Explorer.DataFrame.html#module-verbs"},{"type":"module","title":"Single table verbs - Explorer.DataFrame","doc":"Single table verbs are (unsurprisingly) used for manipulating a single dataframe.\nThose operations typically driven by column names. These are:\n\n- `select/2` for picking columns and `discard/2` to discard them\n- `filter/2` for picking rows based on predicates\n- `mutate/2` for adding or replacing columns that are functions of existing columns\n- `arrange/2` for changing the ordering of rows\n- `distinct/2` for picking unique rows\n- `summarise/2` for reducing multiple rows down to a single summary\n- `pivot_longer/3` and `pivot_wider/4` for massaging dataframes into longer or\n wider forms, respectively\n\nEach of these combine with `Explorer.DataFrame.group_by/2` for operating by group.\n\n#","ref":"Explorer.DataFrame.html#module-single-table-verbs"},{"type":"module","title":"Multiple table verbs - Explorer.DataFrame","doc":"Multiple table verbs are used for combining tables. These are:\n\n- `join/3` for performing SQL-like joins\n- `concat_columns/1` for horizontally \"stacking\" dataframes\n- `concat_rows/1` for vertically \"stacking\" dataframes\n\n#","ref":"Explorer.DataFrame.html#module-multiple-table-verbs"},{"type":"module","title":"Row-based verbs - Explorer.DataFrame","doc":"Those operations are driven by the row index. These are:\n\n- `head/2` for picking the first rows\n- `tail/2` for picking the last rows\n- `slice/2` for slicing the dataframe by row indexes or a range\n- `slice/3` for slicing a section by an offset\n- `sample/2` for sampling the data-frame by row","ref":"Explorer.DataFrame.html#module-row-based-verbs"},{"type":"module","title":"IO operations - Explorer.DataFrame","doc":"Explorer supports reading and writing of:\n\n- delimited files (such as CSV or TSV)\n- [Parquet](https://databricks.com/glossary/what-is-parquet)\n- [Arrow IPC](https://arrow.apache.org/docs/format/Columnar.html#ipc-file-format)\n- [Arrow Streaming IPC](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format)\n- [Newline Delimited JSON](http://ndjson.org)\n- Databases via `Adbc` in `from_query/3`\n\nThe convention Explorer uses is to have `from_*` and `to_*` functions to read and write\nto files in the formats above. `load_*` and `dump_*` versions are also available to read\nand write those formats directly in memory.\n\nFiles can be fetched from local or remote file system, such as S3, using the following formats:\n\n # path to a file in disk\n Explorer.DataFrame.from_parquet(\"/path/to/file.parquet\")\n\n # path to a URL schema (with optional configuration)\n Explorer.DataFrame.from_parquet(\"s3://bucket/file.parquet\", config: FSS.S3.config_from_system_env())\n\n # it's possible to configure using keyword lists\n Explorer.DataFrame.from_parquet(\"s3://bucket/file.parquet\", config: [access_key_id: \"my-key\", secret_access_key: \"my-secret\"])\n\n # a FSS entry (it already includes its config)\n Explorer.DataFrame.from_parquet(FSS.S3.parse(\"s3://bucket/file.parquet\"))\n\nThe `:config` option of `from_*` functions is only required if the filename is a path\nto a remote resource. In case it's a FSS entry, the requirement is that the config is passed\ninside the entry struct.","ref":"Explorer.DataFrame.html#module-io-operations"},{"type":"module","title":"Selecting columns and access - Explorer.DataFrame","doc":"Several functions in this module, such as `select/2`, `discard/2`, `drop_nil/2`, and so\nforth accept a single or multiple columns as arguments. The columns can be specified in\na variety of formats, which we describe below.\n\n`Explorer.DataFrame` also implements the `Access` behaviour (also known as the brackets\nsyntax). This should be familiar for users coming from other language with dataframes\nsuch as R or Python. For example:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[\"class\"]\n #Explorer.Series \n\nAccessing the dataframe with a column name either as a string or an atom, will return\nthe column. You can also pass an integer representing the column order:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[0]\n #Explorer.Series \n\nYou can also pass a list, a range, or a regex to return a dataframe matching\nthe given data type. For example, by passing a list:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[[\"class\", \"hue\"]]\n #Explorer.DataFrame \n\nOr a range for the given positions:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[0..2]\n #Explorer.DataFrame \n\nOr a regex to keep only columns matching a given pattern:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[~r/(class|hue)/]\n #Explorer.DataFrame \n\nGiven you can also access a series using its index, you can use\nmultiple accesses to select a column and row at the same time:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[\"class\"][3]\n 1","ref":"Explorer.DataFrame.html#module-selecting-columns-and-access"},{"type":"macro","title":"Explorer.DataFrame.arrange/2","doc":"Arranges/sorts rows by columns using `Explorer.Query`.\n\n> ##","ref":"Explorer.DataFrame.html#arrange/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.arrange/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nSee `arrange_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#arrange/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.arrange/2","doc":"A single column name will sort ascending by that column:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange(df, a)\n #Explorer.DataFrame \n\nYou can also sort descending:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange(df, desc: a)\n #Explorer.DataFrame \n\nSorting by more than one column sorts them in the order they are entered:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.arrange(df, asc: total, desc: country)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.arrange/2","doc":"When used in a grouped dataframe, arrange is going to sort each group individually and\nthen return the entire dataframe with the existing groups. If one of the arrange columns\nis also a group, the sorting for that column is not going to work. It is necessary to\nfirst summarise the desired column and then arrange it.\n\nHere is an example using the Iris dataset. We group by species and then we try to sort\nthe dataframe by species and petal length, but only \"petal length\" is taken into account\nbecause \"species\" is a group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.arrange(grouped, desc: species, asc: sepal_width)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.arrange_with/2","doc":"Arranges/sorts rows by columns using a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe does\nhold any values, instead it stores all operations in order to\nexecute all sorting performantly.\n\nThis is a callback version of `arrange/2`.\n\nSorting is stable by default.","ref":"Explorer.DataFrame.html#arrange_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.arrange_with/2","doc":"A single column name will sort ascending by that column:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange_with(df, &(&1[\"a\"]))\n #Explorer.DataFrame \n\nYou can also sort descending:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange_with(df, &[desc: &1[\"a\"]])\n #Explorer.DataFrame \n\nSorting by more than one column sorts them in the order they are entered:\n\n iex> df = Explorer.DataFrame.new(a: [3, 1, 3], b: [2, 1, 3])\n iex> Explorer.DataFrame.arrange_with(df, &[desc: &1[\"a\"], asc: &1[\"b\"]])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.arrange_with/2","doc":"iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.arrange_with(grouped, &[desc: &1[\"species\"], asc: &1[\"sepal_width\"]])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.collect/1","doc":"This collects the lazy data frame into an eager one, computing the query.\n\nIf already eager, this is a noop.\n\nCollecting a grouped dataframe should return a grouped dataframe.","ref":"Explorer.DataFrame.html#collect/1"},{"type":"function","title":"Explorer.DataFrame.concat_columns/1","doc":"Combine two or more dataframes column-wise.\n\nThis function expects the dataframes to have the same number of rows,\notherwise rows may be silently discarded. Eager backends may check\nwhenever this happens and raise instead of silently fail. But this may not\nbe possible for lazy dataframes as the number of rows is not known upfront.\n\nWhen working with grouped dataframes, be aware that only groups from the first\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_columns/1"},{"type":"function","title":"Examples - Explorer.DataFrame.concat_columns/1","doc":"iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(z: [4, 5, 6], a: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_columns([df1, df2])\n #Explorer.DataFrame \n\nConflicting names are suffixed with the index of the dataframe in the array:\n\n iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], a: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_columns([df1, df2])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#concat_columns/1-examples"},{"type":"function","title":"Explorer.DataFrame.concat_columns/2","doc":"Combine two dataframes column-wise.\n\nWhen working with grouped dataframes, be aware that only groups from the left-hand side\ndataframe are kept in the resultant dataframe.\n\n`concat_columns(df1, df2)` is equivalent to `concat_columns([df1, df2])`.","ref":"Explorer.DataFrame.html#concat_columns/2"},{"type":"function","title":"Explorer.DataFrame.concat_rows/1","doc":"Combine two or more dataframes row-wise (stack).\n\nColumn names and dtypes must match. The only exception is for numeric\ncolumns that can be mixed together, and casted automatically to float columns.\n\nWhen working with grouped dataframes, be aware that only groups from the first\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_rows/1"},{"type":"function","title":"Examples - Explorer.DataFrame.concat_rows/1","doc":"iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], y: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_rows([df1, df2])\n #Explorer.DataFrame \n\n iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4.2, 5.3, 6.4], y: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_rows([df1, df2])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#concat_rows/1-examples"},{"type":"function","title":"Explorer.DataFrame.concat_rows/2","doc":"Combine two dataframes row-wise.\n\n`concat_rows(df1, df2)` is equivalent to `concat_rows([df1, df2])`.\n\nWhen working with grouped dataframes, be aware that only groups from the left-hand side\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_rows/2"},{"type":"function","title":"Explorer.DataFrame.describe/2","doc":"Describe numeric columns of a DataFrame.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#describe/2"},{"type":"function","title":"Options - Explorer.DataFrame.describe/2","doc":"* `:percentiles` - Floating point list with the percentiles to be calculated. (default: `[0.25, 0.5, 0.75]`)","ref":"Explorer.DataFrame.html#describe/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.describe/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [1, 2, 3], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.describe(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [1, 2, 3], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.describe(df, percentiles: [0.3, 0.5, 0.8])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#describe/2-examples"},{"type":"function","title":"Explorer.DataFrame.discard/2","doc":"Discards a subset of columns by name.\n\nIt's important to notice that groups are kept:\nyou can't discard grouping columns.","ref":"Explorer.DataFrame.html#discard/2"},{"type":"function","title":"Examples - Explorer.DataFrame.discard/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.discard(df, [\"b\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.discard(df, [\"a\", \"b\"])\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#discard/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.discard/2","doc":"You cannot discard grouped columns. You need to ungroup before removing them:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.discard(grouped, [\"species\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#discard/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.distinct/3","doc":"Takes distinct rows by a selection of columns.\n\nDistinct is not affected by groups, although groups are kept in the\ncolumns selection if `keep_all` option is false (the default).","ref":"Explorer.DataFrame.html#distinct/3"},{"type":"function","title":"Options - Explorer.DataFrame.distinct/3","doc":"* `:keep_all` - If set to `true`, keep all columns. Default is `false`.","ref":"Explorer.DataFrame.html#distinct/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.distinct/3","doc":"By default will return unique values of the requested columns:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.distinct(df, [\"year\", \"country\"])\n #Explorer.DataFrame \n\nIf `keep_all` is set to `true`, then the first value of each column not in the requested\ncolumns will be returned:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.distinct(df, [\"year\", \"country\"], keep_all: true)\n #Explorer.DataFrame \n\nA callback on the dataframe's names can be passed instead of a list (like `select/2`):\n\n iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: [\"a\", \"c\", \"c\"], y1: [1, 2, 3])\n iex> Explorer.DataFrame.distinct(df, &String.starts_with?(&1, \"x\"))\n #Explorer.DataFrame \n\nIf the dataframe has groups, then the columns of each group will be added to the distinct columns:\n\n iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: [\"a\", \"c\", \"c\"], y1: [1, 2, 3])\n iex> df = Explorer.DataFrame.group_by(df, \"x1\")\n iex> Explorer.DataFrame.distinct(df, [\"x2\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#distinct/3-examples"},{"type":"function","title":"Explorer.DataFrame.drop_nil/2","doc":"Drop nil values.\n\nOptionally accepts a subset of columns.","ref":"Explorer.DataFrame.html#drop_nil/2"},{"type":"function","title":"Examples - Explorer.DataFrame.drop_nil/2","doc":"To drop nils on all columns:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])\n iex> Explorer.DataFrame.drop_nil(df)\n #Explorer.DataFrame \n\n To drop nils on a single column:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])\n iex> Explorer.DataFrame.drop_nil(df, :a)\n #Explorer.DataFrame \n\nTo drop some columns:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3], c: [nil, 5, 6])\n iex> Explorer.DataFrame.drop_nil(df, [:a, :c])\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#drop_nil/2-examples"},{"type":"function","title":"Explorer.DataFrame.dtypes/1","doc":"Gets the dtypes of the dataframe columns.","ref":"Explorer.DataFrame.html#dtypes/1"},{"type":"function","title":"Examples - Explorer.DataFrame.dtypes/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])\n iex> Explorer.DataFrame.dtypes(df)\n %{\"floats\" => :float, \"ints\" => :integer}","ref":"Explorer.DataFrame.html#dtypes/1-examples"},{"type":"function","title":"Explorer.DataFrame.dummies/2","doc":"Turns a set of columns to dummy variables.\n\nIn case the dataframe is using groups, all groups will be removed.","ref":"Explorer.DataFrame.html#dummies/2"},{"type":"function","title":"Examples - Explorer.DataFrame.dummies/2","doc":"To mark a single column as dummy:\n\n iex> df = Explorer.DataFrame.new(col_x: [\"a\", \"b\", \"a\", \"c\"], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, \"col_x\")\n #Explorer.DataFrame \n\nOr multiple columns:\n\n iex> df = Explorer.DataFrame.new(col_x: [\"a\", \"b\", \"a\", \"c\"], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, [\"col_x\", \"col_y\"])\n #Explorer.DataFrame \n\nOr all string columns:\n\n iex> df = Explorer.DataFrame.new(num: [1, 2, 3, 4], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, fn _name, type -> type == :string end)\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#dummies/2-examples"},{"type":"function","title":"Explorer.DataFrame.dump_csv/2","doc":"Writes a dataframe to a binary representation of a delimited file.","ref":"Explorer.DataFrame.html#dump_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_csv/2","doc":"* `:header` - Should the column names be written as the first line of the file? (default: `true`)\n * `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)","ref":"Explorer.DataFrame.html#dump_csv/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.dump_csv/2","doc":"iex> df = Explorer.Datasets.fossil_fuels() |> Explorer.DataFrame.head(2)\n iex> Explorer.DataFrame.dump_csv(df)\n {:ok, \"year,country,total,solid_fuel,liquid_fuel,gas_fuel,cement,gas_flaring,per_capita,bunker_fuels\\n2010,AFGHANISTAN,2308,627,1601,74,5,0,0.08,9\\n2010,ALBANIA,1254,117,953,7,177,0,0.43,7\\n\"}","ref":"Explorer.DataFrame.html#dump_csv/2-examples"},{"type":"function","title":"Explorer.DataFrame.dump_csv!/2","doc":"Similar to `dump_csv/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_csv!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ipc/2","doc":"Writes a dataframe to a binary representation of an IPC file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_ipc/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.","ref":"Explorer.DataFrame.html#dump_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_ipc!/2","doc":"Similar to `dump_ipc/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ipc_stream/2","doc":"Writes a dataframe to a binary representation of an IPC Stream file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_ipc_stream/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.","ref":"Explorer.DataFrame.html#dump_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_ipc_stream!/2","doc":"Similar to `dump_ipc_stream/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ndjson/1","doc":"Writes a dataframe to a binary representation of a NDJSON file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ndjson/1"},{"type":"function","title":"Examples - Explorer.DataFrame.dump_ndjson/1","doc":"iex> df = Explorer.DataFrame.new(col_a: [1, 2], col_b: [5.1, 5.2])\n iex> Explorer.DataFrame.dump_ndjson(df)\n {:ok, ~s({\"col_a\":1,\"col_b\":5.1}\\n{\"col_a\":2,\"col_b\":5.2}\\n)}","ref":"Explorer.DataFrame.html#dump_ndjson/1-examples"},{"type":"function","title":"Explorer.DataFrame.dump_ndjson!/1","doc":"Similar to `dump_ndjson!/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ndjson!/1"},{"type":"function","title":"Explorer.DataFrame.dump_parquet/2","doc":"Writes a dataframe to a binary representation of a Parquet file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_parquet/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_parquet/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Where a compression level is available, this can be passed as a tuple,\n such as `{:zstd, 3}`. Supported options are:\n\n * `nil` (uncompressed, default)\n * `:snappy`\n * `:gzip` (with levels 1-9)\n * `:brotli` (with levels 1-11)\n * `:zstd` (with levels -7-22)\n * `:lz4raw`.","ref":"Explorer.DataFrame.html#dump_parquet/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_parquet!/2","doc":"Similar to `dump_parquet/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_parquet!/2"},{"type":"macro","title":"Explorer.DataFrame.filter/2","doc":"Picks rows based on `Explorer.Query`.\n\nThe query is compiled and runs efficiently against the dataframe.\nThe query must return a boolean expression or a list of boolean expressions.\nWhen a list is returned, they are joined as `and` expressions.\n\n> ##","ref":"Explorer.DataFrame.html#filter/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.filter/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nBesides element-wise series operations, you can also use window functions\nand aggregations inside comparisons. In such cases, grouped dataframes\nmay have different results than ungrouped ones, because the filtering\nis computed withing groups. See examples below.\n\nSee `filter_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#filter/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.filter/2","doc":"iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col2 > 2)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col1 == \"b\")\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [5, 4, 3], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, [col1 > 3, col2 \n\nReturning a non-boolean expression errors:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, cumulative_max(col2))\n ** (ArgumentError) expecting the function to return a boolean LazySeries, but instead it returned a LazySeries of type :integer\n\nWhich can be addressed by converting it to boolean:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, cumulative_max(col2) == 1)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.filter/2","doc":"In a grouped dataframe, the aggregation is calculated within each group.\n\nIn the following example we select the flowers of the Iris dataset that have the \"petal length\"\nabove the average of each species group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.filter(grouped, petal_length > mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.filter_with/2","doc":"Picks rows based on a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe does\nnot hold any values, instead it stores all operations in order to\nexecute all filtering performantly.\n\nThis is a callback version of `filter/2`.","ref":"Explorer.DataFrame.html#filter_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.filter_with/2","doc":"iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1[\"col2\"], 2))\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.equal(df[\"col1\"], \"b\") end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.filter_with/2","doc":"In a grouped dataframe, the aggregation is calculated within each group.\n\nIn the following example we select the flowers of the Iris dataset that have the \"petal length\"\nabove the average of each species group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.filter_with(grouped, &Explorer.Series.greater(&1[\"petal_length\"], Explorer.Series.mean(&1[\"petal_length\"])))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.frequencies/2","doc":"Creates a new dataframe with unique rows and the frequencies of each.","ref":"Explorer.DataFrame.html#frequencies/2"},{"type":"function","title":"Examples - Explorer.DataFrame.frequencies/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"a\", \"a\", \"b\"], b: [1, 1, nil])\n iex> Explorer.DataFrame.frequencies(df, [:a, :b])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#frequencies/2-examples"},{"type":"function","title":"Explorer.DataFrame.from_csv/2","doc":"Reads a delimited file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.\n\nIf the CSV is compressed, it is automatically decompressed.","ref":"Explorer.DataFrame.html#from_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_csv/2","doc":"* `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\n * `:dtypes` - A list/map of `{\"column_name\", dtype}` tuples. Any non-specified column has its type\n imputed from the first 1000 rows. (default: `[]`)\n\n * `:header` - Does the file have a header of column names as the first row or not? (default: `true`)\n\n * `:max_rows` - Maximum number of lines to read. (default: `nil`)\n\n * `:nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n\n * `:skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n\n * `:columns` - A list of column names or indexes to keep.\n If present, only these columns are read into the dataframe. (default: `nil`)\n\n * `:infer_schema_length` Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:parse_dates` - Automatically try to parse dates/ datetimes and time.\n If parsing fails, columns remain of dtype `string`\n\n * `:eol_delimiter` - A single character used to represent new lines. (default: `\"\n\"`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_csv/2-options"},{"type":"function","title":"Explorer.DataFrame.from_csv!/2","doc":"Similar to `from_csv/2` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#from_csv!/2"},{"type":"function","title":"Explorer.DataFrame.from_ipc/2","doc":"Reads an IPC file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.","ref":"Explorer.DataFrame.html#from_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ipc/2","doc":"* `:columns` - List with the name or index of columns to be selected.\n Defaults to all columns.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ipc!/2","doc":"Similar to `from_ipc/2` but raises if there is a problem reading the IPC file.","ref":"Explorer.DataFrame.html#from_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.from_ipc_stream/2","doc":"Reads an IPC Streaming file into a dataframe.\n\nIt's possible to read from an IPC Streaming file using the lazy Polars\nbackend, but the implementation is not truly lazy. We are going to read it\nfirst using the eager backend, and then convert the dataframe to lazy.","ref":"Explorer.DataFrame.html#from_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ipc_stream/2","doc":"* `:columns` - List with the name or index of columns to be selected.\n Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#from_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ipc_stream!/2","doc":"Similar to `from_ipc_stream/2` but raises if there is a problem reading the IPC Stream file.","ref":"Explorer.DataFrame.html#from_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.from_ndjson/2","doc":"Read a file of JSON objects or lists separated by new lines","ref":"Explorer.DataFrame.html#from_ndjson/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ndjson/2","doc":"* `:batch_size` - Sets the batch size for reading rows.\n This value may have significant impact in performance,\n so adjust it for your needs (default: `1000`).\n\n * `:infer_schema_length` - Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#from_ndjson/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ndjson!/2","doc":"Similar to `from_ndjson/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#from_ndjson!/2"},{"type":"function","title":"Explorer.DataFrame.from_parquet/2","doc":"Reads a parquet file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.","ref":"Explorer.DataFrame.html#from_parquet/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_parquet/2","doc":"* `:max_rows` - Maximum number of lines to read. (default: `nil`)\n\n * `:columns` - A list of column names or indexes to keep. If present,\n only these columns are read into the dataframe. (default: `nil`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_parquet/2-options"},{"type":"function","title":"Explorer.DataFrame.from_parquet!/2","doc":"Similar to `from_parquet/2` but raises if there is a problem reading the Parquet file.","ref":"Explorer.DataFrame.html#from_parquet!/2"},{"type":"function","title":"Explorer.DataFrame.from_query/4","doc":"Reads data from a query.\n\n`conn` must be a `Adbc.Connection` process. `sql` is a string representing\nthe sql query and `params` is the list of query parameters. See `Adbc`\nfor more information.","ref":"Explorer.DataFrame.html#from_query/4"},{"type":"function","title":"Example - Explorer.DataFrame.from_query/4","doc":"In order to read data from a database, you must list `:adbc` as a dependency,\ndownload the relevant driver, and start both database and connection processes\nin your supervision tree.\n\nFirst, add `:adbc` as a dependency in your `mix.exs`:\n\n {:adbc, \"~> 0.1\"}\n\nNow, in your config/config.exs, configure the drivers you are going to use\n(see `Adbc` module docs for more information on supported drivers):\n\n config :adbc, :drivers, [:sqlite]\n\nIf you are using a notebook or scripting, you can also use `Adbc.download_driver!/1`\nto dynamically download one.\n\nThen start the database and the relevant connection processes in your\nsupervision tree:\n\n children = [\n {Adbc.Database,\n driver: :sqlite,\n process_options: [name: MyApp.DB]},\n {Adbc.Connection,\n database: MyApp.DB,\n process_options: [name: MyApp.Conn]}\n ]\n\n Supervisor.start_link(children, strategy: :one_for_one)\n\nIn a notebook, the above would look like this:\n\n db = Kino.start_child!({Adbc.Database, driver: :sqlite})\n conn = Kino.start_child!({Adbc.Connection, database: db})\n\nAnd now you can make queries with:\n\n # For named connections\n {:ok, _} = Explorer.DataFrame.from_query(MyApp.Conn, \"SELECT 123\")\n\n # When using the conn PID directly\n {:ok, _} = Explorer.DataFrame.from_query(conn, \"SELECT 123\")","ref":"Explorer.DataFrame.html#from_query/4-example"},{"type":"function","title":"Options - Explorer.DataFrame.from_query/4","doc":"* `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_query/4-options"},{"type":"function","title":"Explorer.DataFrame.from_query!/4","doc":"Similar to `from_query/4` but raises if there is an error.","ref":"Explorer.DataFrame.html#from_query!/4"},{"type":"function","title":"Explorer.DataFrame.group_by/2","doc":"Group the dataframe by one or more variables.\n\nWhen the dataframe has grouping variables, operations are performed per group.\n`Explorer.DataFrame.ungroup/2` removes grouping.","ref":"Explorer.DataFrame.html#group_by/2"},{"type":"function","title":"Examples - Explorer.DataFrame.group_by/2","doc":"You can group by a single variable:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, \"country\")\n #Explorer.DataFrame \n\nOr you can group by multiple columns in a given list:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n #Explorer.DataFrame \n\nOr by a range:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, 0..1)\n #Explorer.DataFrame \n\nRegexes and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#group_by/2-examples"},{"type":"function","title":"Explorer.DataFrame.groups/1","doc":"Returns the groups of a dataframe.","ref":"Explorer.DataFrame.html#groups/1"},{"type":"function","title":"Examples - Explorer.DataFrame.groups/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, \"country\")\n iex> Explorer.DataFrame.groups(df)\n [\"country\"]\n\n iex> df = Explorer.Datasets.iris()\n iex> Explorer.DataFrame.groups(df)\n []","ref":"Explorer.DataFrame.html#groups/1-examples"},{"type":"function","title":"Explorer.DataFrame.head/2","doc":"Returns the first *n* rows of the dataframe.\n\nBy default it returns the first 5 rows.\n\nIf the dataframe is using groups, then the first *n* rows of each group is\nreturned.","ref":"Explorer.DataFrame.html#head/2"},{"type":"function","title":"Examples - Explorer.DataFrame.head/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.head(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.head(df, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#head/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.head/2","doc":"Using grouped dataframes makes `head/2` return *n* rows from each group.\nHere is an example using the Iris dataset, and returning two rows from each group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.head(grouped, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#head/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.join/3","doc":"Join two tables.","ref":"Explorer.DataFrame.html#join/3"},{"type":"function","title":"Join types - Explorer.DataFrame.join/3","doc":"* `:inner` - Returns all rows from `left` where there are matching values in `right`, and all columns from `left` and `right`.\n * `:left` - Returns all rows from `left` and all columns from `left` and `right`. Rows in `left` with no match in `right` will have `nil` values in the new columns.\n * `:right` - Returns all rows from `right` and all columns from `left` and `right`. Rows in `right` with no match in `left` will have `nil` values in the new columns.\n * `:outer` - Returns all rows and all columns from both `left` and `right`. Where there are not matching values, returns `nil` for the one missing.\n * `:cross` - Also known as a cartesian join. Returns all combinations of `left` and `right`. Can be very computationally expensive.","ref":"Explorer.DataFrame.html#join/3-join-types"},{"type":"function","title":"Options - Explorer.DataFrame.join/3","doc":"* `:on` - The columns to join on. Defaults to overlapping columns. Does not apply to cross join.\n * `:how` - One of the join types (as an atom) described above. Defaults to `:inner`.","ref":"Explorer.DataFrame.html#join/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.join/3","doc":"Inner join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right)\n #Explorer.DataFrame \n\nLeft join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :left)\n #Explorer.DataFrame \n\nRight join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :right)\n #Explorer.DataFrame \n\nOuter join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :outer)\n #Explorer.DataFrame \n\nCross join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :cross)\n #Explorer.DataFrame \n\nInner join with different names:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(d: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, on: [{\"a\", \"d\"}])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#join/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.join/3","doc":"When doing a join operation with grouped dataframes, the joined dataframe\nmay keep the groups from only one side.\n\nAn inner join operation will keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right)\n #Explorer.DataFrame \n\nA left join operation will keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :left)\n #Explorer.DataFrame \n\nA right join operation will keep the groups from the right-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :right)\n #Explorer.DataFrame \n\nAn outer join operation is going to keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :outer)\n #Explorer.DataFrame \n\nA cross join operation is going to keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :cross)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#join/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.load_csv/2","doc":"Reads a representation of a CSV file into a dataframe.\n\nIf the CSV is compressed, it is automatically decompressed.","ref":"Explorer.DataFrame.html#load_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_csv/2","doc":"* `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n * `:dtypes` - A list/map of `{\"column_name\", dtype}` tuples. Any non-specified column has its type\n imputed from the first 1000 rows. (default: `[]`)\n * `:header` - Does the file have a header of column names as the first row or not? (default: `true`)\n * `:max_rows` - Maximum number of lines to read. (default: `nil`)\n * `:nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n * `:skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n * `:columns` - A list of column names or indexes to keep. If present, only these columns are read into the dataframe. (default: `nil`)\n * `:infer_schema_length` Maximum number of rows read for schema inference. Setting this to nil will do a full table scan and will be slow (default: `1000`).\n * `:parse_dates` - Automatically try to parse dates/ datetimes and time. If parsing fails, columns remain of dtype `string`\n * `:eol_delimiter` - A single character used to represent new lines. (default: `\"\n\"`)\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_csv/2-options"},{"type":"function","title":"Explorer.DataFrame.load_csv!/2","doc":"Similar to `load_csv/2` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#load_csv!/2"},{"type":"function","title":"Explorer.DataFrame.load_ipc/2","doc":"Reads a binary representing an IPC file into a dataframe.","ref":"Explorer.DataFrame.html#load_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ipc/2","doc":"* `:columns` - List with the name or index of columns to be selected. Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ipc!/2","doc":"Similar to `load_ipc/2` but raises if there is a problem reading the IPC file.","ref":"Explorer.DataFrame.html#load_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.load_ipc_stream/2","doc":"Reads a binary representing an IPC Stream file into a dataframe.","ref":"Explorer.DataFrame.html#load_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ipc_stream/2","doc":"* `:columns` - List with the name or index of columns to be selected. Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ipc_stream!/2","doc":"Similar to `load_ipc_stream/2` but raises if there is a problem.","ref":"Explorer.DataFrame.html#load_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.load_ndjson/2","doc":"Reads a representation of a NDJSON file into a dataframe.","ref":"Explorer.DataFrame.html#load_ndjson/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ndjson/2","doc":"* `:batch_size` - Sets the batch size for reading rows.\n This value may have significant impact in performance,\n so adjust it for your needs (default: `1000`).\n\n * `:infer_schema_length` - Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ndjson/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ndjson!/2","doc":"Similar to `load_ndjson/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#load_ndjson!/2"},{"type":"function","title":"Examples - Explorer.DataFrame.load_ndjson!/2","doc":"iex> contents = ~s({\"col_a\":1,\"col_b\":5.1}\\n{\"col_a\":2,\"col_b\":5.2}\\n)\n iex> Explorer.DataFrame.load_ndjson!(contents)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#load_ndjson!/2-examples"},{"type":"function","title":"Explorer.DataFrame.load_parquet/2","doc":"Reads a binary representation of a parquet file into a dataframe.","ref":"Explorer.DataFrame.html#load_parquet/2"},{"type":"function","title":"Explorer.DataFrame.load_parquet!/2","doc":"Similar to `load_parquet/2` but raises if there is a problem reading the Parquet file.","ref":"Explorer.DataFrame.html#load_parquet!/2"},{"type":"function","title":"Explorer.DataFrame.mask/2","doc":"Picks rows based on a list or series of values.","ref":"Explorer.DataFrame.html#mask/2"},{"type":"function","title":"Examples - Explorer.DataFrame.mask/2","doc":"This function must only be used when you need to select rows based\non external values that are not available to the dataframe. For example,\nyou can pass a list:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.mask(df, [false, true, false])\n #Explorer.DataFrame \n\nYou must avoid using masks when the masks themselves are computed from\nother columns. For example, DO NOT do this:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.mask(df, Explorer.Series.greater(df[\"col2\"], 1))\n #Explorer.DataFrame \n\nInstead, do this:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df[\"col2\"], 1) end)\n #Explorer.DataFrame \n\nThe `filter_with/2` version is much more efficient because it doesn't need\nto create intermediate series representations to apply the mask.","ref":"Explorer.DataFrame.html#mask/2-examples"},{"type":"macro","title":"Explorer.DataFrame.mutate/2","doc":"Creates or modifies columns based on `Explorer.Query`.\n\nThe query is compiled and runs efficiently against the dataframe.\nNew variables overwrite existing variables of the same name.\nColumn names are coerced from atoms to strings.\n\n> ##","ref":"Explorer.DataFrame.html#mutate/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.mutate/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nBesides element-wise series operations, you can also use window functions\nand aggregations inside mutations. In such cases, grouped dataframes\nmay have different results than ungrouped ones, because the mutation\nis computed withing groups. See examples below.\n\nSee `mutate_with/2` for a callback version of this function without\n`Explorer.Query`. If your mutation cannot be expressed with queries,\nyou may compute the values using the `Explorer.Series` API directly\nand then add it to the dataframe using `put/3`.","ref":"Explorer.DataFrame.html#mutate/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.mutate/2","doc":"Mutations are useful to add or modify columns in your dataframe:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, c: b + 1)\n #Explorer.DataFrame \n\nIt's also possible to overwrite existing columns:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, a: b * 2)\n #Explorer.DataFrame \n\nScalar values are repeated to fill the series:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, a: 4)\n #Explorer.DataFrame \n\nIt's also possible to use functions from the Series module, like `Explorer.Series.window_sum/3`:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, b: window_sum(a, 2))\n #Explorer.DataFrame \n\nAlternatively, all of the above works with a map instead of a keyword list:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, %{\"c\" => cast(b, :float)})\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.mutate/2","doc":"Mutations in grouped dataframes takes the context of the group.\nThis enables some aggregations to be made considering each group. It's almost like `summarise/2`,\nbut repeating the results for each member in the group.\nFor example, if we want to count how many elements of a given group, we can add a new\ncolumn with that aggregation:\n\n iex> df = Explorer.DataFrame.new(id: [\"a\", \"a\", \"b\"], b: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, :id)\n iex> Explorer.DataFrame.mutate(grouped, count: count(b))\n #Explorer.DataFrame \n\nIn case we want to get the average size of the petal length from the Iris dataset, we can:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.mutate(grouped, petal_length_avg: mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.mutate_with/2","doc":"Creates or modifies columns using a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe doesn't\nhold any values, instead it stores all operations in order to\nexecute all mutations performantly.\n\nThis is a callback version of `mutate/2`. If your mutation\ncannot be expressed with lazy dataframes, you may compute the\nvalues using the `Explorer.Series` API directly and then add\nit to the dataframe using `put/3`.","ref":"Explorer.DataFrame.html#mutate_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.mutate_with/2","doc":"Here is an example of a new column that sums the value of two other columns:\n\n iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, &[c: Explorer.Series.add(&1[\"a\"], &1[\"b\"])])\n #Explorer.DataFrame \n\nYou can overwrite existing columns as well:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, &[b: Explorer.Series.pow(&1[\"b\"], 2)])\n #Explorer.DataFrame \n\nIt's possible to \"reuse\" a variable for different computations:\n\n iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, fn ldf ->\n iex> c = Explorer.Series.add(ldf[\"a\"], ldf[\"b\"])\n iex> [c: c, d: Explorer.Series.window_sum(c, 2)]\n iex> end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.mutate_with/2","doc":"Mutations in grouped dataframes takes the context of the group.\nFor example, if we want to count how many elements of a given group,\nwe can add a new column with that aggregation:\n\n iex> df = Explorer.DataFrame.new(id: [\"a\", \"a\", \"b\"], b: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, :id)\n iex> Explorer.DataFrame.mutate_with(grouped, &[count: Explorer.Series.count(&1[\"b\"])])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.n_columns/1","doc":"Returns the number of columns in the dataframe.\n\nThis function works the same way for grouped dataframes.","ref":"Explorer.DataFrame.html#n_columns/1"},{"type":"function","title":"Examples - Explorer.DataFrame.n_columns/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.n_columns(df)\n 10","ref":"Explorer.DataFrame.html#n_columns/1-examples"},{"type":"function","title":"Explorer.DataFrame.n_rows/1","doc":"Returns the number of rows in the dataframe.\n\nThis function works the same way for grouped dataframes, considering the entire\ndataframe in the counting of rows.","ref":"Explorer.DataFrame.html#n_rows/1"},{"type":"function","title":"Examples - Explorer.DataFrame.n_rows/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.n_rows(df)\n 1094","ref":"Explorer.DataFrame.html#n_rows/1-examples"},{"type":"function","title":"Explorer.DataFrame.names/1","doc":"Gets the names of the dataframe columns.","ref":"Explorer.DataFrame.html#names/1"},{"type":"function","title":"Examples - Explorer.DataFrame.names/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])\n iex> Explorer.DataFrame.names(df)\n [\"floats\", \"ints\"]","ref":"Explorer.DataFrame.html#names/1-examples"},{"type":"function","title":"Explorer.DataFrame.new/2","doc":"Creates a new dataframe.\n\nIt accepts any of:\n\n * a map or keyword list of string/atom keys and series as values\n * a map or keyword list of string/atom keys and tensors as values\n * any data structure adhering to the `Table.Reader` protocol","ref":"Explorer.DataFrame.html#new/2"},{"type":"function","title":"Options - Explorer.DataFrame.new/2","doc":"* `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n * `:dtypes` - A list/map of `{column_name, dtype}` pairs. (default: `[]`)","ref":"Explorer.DataFrame.html#new/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.new/2","doc":"#","ref":"Explorer.DataFrame.html#new/2-examples"},{"type":"function","title":"From series - Explorer.DataFrame.new/2","doc":"Series can be given either as keyword lists or maps\nwhere the keys are the name and the values are series:\n\n iex> Explorer.DataFrame.new(%{\n ...> floats: Explorer.Series.from_list([1.0, 2.0]),\n ...> ints: Explorer.Series.from_list([1, nil])\n ...> })\n #Explorer.DataFrame \n\n#","ref":"Explorer.DataFrame.html#new/2-from-series"},{"type":"function","title":"From tensors - Explorer.DataFrame.new/2","doc":"To create dataframe from tensors, you can pass a matrix as argument.\nEach matrix column becomes a dataframe column with names x1, x2, x3,\netc:\n\n iex> Explorer.DataFrame.new(Nx.tensor([\n ...> [1, 2, 3],\n ...> [4, 5, 6]\n ...> ]))\n #Explorer.DataFrame \n\nExplorer expects tensors to have certain types, so you may need to cast\nthe data accordingly. See `Explorer.Series.from_tensor/2` for more info.\n\nYou can also pass a keyword list or maps of vectors (rank 1 tensors):\n\n iex> Explorer.DataFrame.new(%{\n ...> floats: Nx.tensor([1.0, 2.0], type: :f64),\n ...> ints: Nx.tensor([3, 4])\n ...> })\n #Explorer.DataFrame \n\nUse dtypes to force a particular representation:\n\n iex> Explorer.DataFrame.new([\n ...> floats: Nx.tensor([1.0, 2.0], type: :f64),\n ...> times: Nx.tensor([3_000, 4_000])\n ...> ], dtypes: [times: :time])\n #Explorer.DataFrame \n\n#","ref":"Explorer.DataFrame.html#new/2-from-tensors"},{"type":"function","title":"From tabular - Explorer.DataFrame.new/2","doc":"Tabular data can be either columnar or row-based.\nLet's start with column data:\n\n iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, nil]})\n #Explorer.DataFrame \n\n iex> Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n #Explorer.DataFrame \n\n iex> Explorer.DataFrame.new([floats: [1.0, 2.0], ints: [1, nil], binaries: [ >, nil]], dtypes: [{:binaries, :binary}])\n #Explorer.DataFrame >, nil]\n >\n\n iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, \"wrong\"]})\n ** (ArgumentError) cannot create series \"ints\": the value \"wrong\" does not match the inferred series dtype :integer\n\nFrom row data:\n\n iex> rows = [%{id: 1, name: \"JosĆ©\"}, %{id: 2, name: \"Christopher\"}, %{id: 3, name: \"Cristine\"}]\n iex> Explorer.DataFrame.new(rows)\n #Explorer.DataFrame \n\n iex> rows = [[id: 1, name: \"JosĆ©\"], [id: 2, name: \"Christopher\"], [id: 3, name: \"Cristine\"]]\n iex> Explorer.DataFrame.new(rows)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#new/2-from-tabular"},{"type":"function","title":"Explorer.DataFrame.nil_count/1","doc":"Counts the number of null elements in each column.","ref":"Explorer.DataFrame.html#nil_count/1"},{"type":"function","title":"Examples - Explorer.DataFrame.nil_count/1","doc":"iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [nil, 2, nil], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.nil_count(df)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#nil_count/1-examples"},{"type":"function","title":"Explorer.DataFrame.pivot_longer/3","doc":"Pivot data from wide to long.\n\n`pivot_longer/3` \"lengthens\" data, increasing the number of rows and\ndecreasing the number of columns. The inverse transformation is `pivot_wider/4`.\n\nThe second argument, `columns_to_pivot`, can be either list of column names to pivot.\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.\nThe selected columns must always have the same data type.\n\nIn case the dataframe is using groups, the groups that are also in the list of columns\nto pivot will be removed from the resultant dataframe. See the examples below.","ref":"Explorer.DataFrame.html#pivot_longer/3"},{"type":"function","title":"Options - Explorer.DataFrame.pivot_longer/3","doc":"* `:select` - Columns that are not in the list of pivot and should be kept in the dataframe.\n Ranges, regexes, and functions are also accepted in column names, as in `select/2`.\n Defaults to all columns except the ones to pivot.\n\n * `:discard` - Columns that are not in the list of pivot and should be dropped from the dataframe.\n Ranges, regexes, and functions are also accepted in column names, as in `select/2`.\n This list of columns is going to be subtracted from the list of `select`.\n Defaults to an empty list.\n\n * `:names_to` - A string specifying the name of the column to create from the data stored\n in the column names of the dataframe. Defaults to `\"variable\"`.\n\n * `:values_to` - A string specifying the name of the column to create from the data stored\n in series element values. Defaults to `\"value\"`.","ref":"Explorer.DataFrame.html#pivot_longer/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.pivot_longer/3","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, \"fuel\"))\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, \"fuel\"), select: [\"year\", \"country\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, [\"total\"], select: [\"year\", \"country\"], discard: [\"country\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, [\"total\"], select: [], names_to: \"my_var\", values_to: \"my_value\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_longer/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.pivot_longer/3","doc":"In the following example we want to take the Iris dataset and increase the number of rows by\npivoting the \"sepal_length\" column. This dataset is grouped by \"species\", so the resultant\ndataframe is going to keep the \"species\" group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.pivot_longer(grouped, [\"sepal_length\"])\n #Explorer.DataFrame \n\nNow we want to do something different: we want to pivot the \"species\" column that is also a group.\nThis is going to remove the group in the resultant dataframe:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.pivot_longer(grouped, [\"species\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_longer/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.pivot_wider/4","doc":"Pivot data from long to wide.\n\n`pivot_wider/4` \"widens\" data, increasing the number of columns and decreasing the number of rows.\nThe inverse transformation is `pivot_longer/3`.\n\nDue to a restriction upstream, `values_from` must be a numeric type.\n\nIn case the dataframe is using groups, the groups that are also in the list of columns\nto pivot will be removed from the resultant dataframe. See the examples below.","ref":"Explorer.DataFrame.html#pivot_wider/4"},{"type":"function","title":"Options - Explorer.DataFrame.pivot_wider/4","doc":"* `:id_columns` - A set of columns that uniquely identifies each observation.\n\n Defaults to all columns in data except for the columns specified in `names_from` and `values_from`,\n and columns that are of the `:float` dtype.\n\n Typically used when you have redundant variables, i.e. variables whose values are perfectly correlated\n with existing variables. May accept a filter callback, a list or a range of column names.\n Default value is `0..-1//1`. If an empty list is passed, or a range that results in a empty list of\n column names, it raises an error.\n\n ID columns cannot be of the float type and any columns of this dtype is discarded.\n If you need to use float columns as IDs, you must carefully consider rounding\n or truncating the column and converting it to integer, as long as doing so\n preserves the properties of the column.\n\n* `:names_prefix` - String added to the start of every variable name.\n This is particularly useful if `names_from` is a numeric vector and you want to create syntactic variable names.","ref":"Explorer.DataFrame.html#pivot_wider/4-options"},{"type":"function","title":"Examples - Explorer.DataFrame.pivot_wider/4","doc":"Suppose we have a basketball court and multiple teams that want to train in that court. They need\nto share a schedule with the hours each team is going to use it. Here is a dataframe representing\nthat schedule:\n\n iex> Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n\nThis dataframe is going to look like this - using `table/2`:\n\n +----------------------------------------------+\n | Explorer DataFrame: [rows: 10, columns: 3] |\n +---------------+--------------+---------------+\n | weekday | team | hour |\n | | | |\n +===============+==============+===============+\n | Monday | A | 10 |\n +---------------+--------------+---------------+\n | Tuesday | B | 9 |\n +---------------+--------------+---------------+\n | Wednesday | C | 10 |\n +---------------+--------------+---------------+\n | Thursday | A | 10 |\n +---------------+--------------+---------------+\n | Friday | B | 11 |\n +---------------+--------------+---------------+\n | Monday | C | 15 |\n +---------------+--------------+---------------+\n | Tuesday | A | 14 |\n +---------------+--------------+---------------+\n | Wednesday | B | 16 |\n +---------------+--------------+---------------+\n | Thursday | C | 14 |\n +---------------+--------------+---------------+\n | Friday | A | 16 |\n +---------------+--------------+---------------+\n\nYou can see that the \"weekday\" repeats, and it's not clear how free the agenda is.\nWe can solve that by pivoting the \"weekday\" column in multiple columns, making each weekday\na new column in the resultant dataframe.\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"weekday\", \"hour\")\n #Explorer.DataFrame \n\nNow if we print that same dataframe with `table/2`, we get a better picture of the schedule:\n\n +----------------------------------------------------------------------+\n | Explorer DataFrame: [rows: 3, columns: 6] |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | team | Monday | Tuesday | Wednesday | Thursday | Friday |\n | | | | | | |\n +==========+===========+===========+===========+===========+===========+\n | A | 10 | 14 | | 10 | 16 |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | B | | 9 | 16 | | 11 |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | C | 15 | | 10 | 14 | |\n +----------+-----------+-----------+-----------+-----------+-----------+\n\nPivot wider can create unpredictable column names, and sometimes they can conflict with ID columns.\nIn that scenario, we add a number as suffix to duplicated column names. Here is an example:\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", \"property_value\")\n #Explorer.DataFrame \n\nBut if the option `:names_prefix` is used, that suffix is not added:\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", \"property_value\", names_prefix: \"col_\")\n #Explorer.DataFrame \n\nMultiple columns are accepted for the `values_from` parameter, but the behaviour is slightly\ndifferent for the naming of new columns in the resultant dataframe. The new columns are going\nto be prefixed by the name of the original value column, followed by an underscore and the\noriginal column name, followed by the name of the variable.\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40],\n iex> another_value: [1, 43, 41, 65, 2, 36, 21, 42]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", [\"property_value\", \"another_value\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_wider/4-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.pivot_wider/4","doc":"Now using the same idea, we can see that there is not much difference for grouped dataframes.\nThe only detail is that groups that are not ID columns are discarded.\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> grouped = Explorer.DataFrame.group_by(df, \"team\")\n iex> Explorer.DataFrame.pivot_wider(grouped, \"weekday\", \"hour\")\n #Explorer.DataFrame \n\nIn the following example the group \"weekday\" is going to be removed, because the column is going\nto be pivoted in multiple columns:\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> grouped = Explorer.DataFrame.group_by(df, \"weekday\")\n iex> Explorer.DataFrame.pivot_wider(grouped, \"weekday\", \"hour\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_wider/4-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.pull/2","doc":"Extracts a single column as a series.\n\nThis is equivalent to `df[field]` for retrieving a single field.\nThe returned series will have its `:name` field set to the column name.","ref":"Explorer.DataFrame.html#pull/2"},{"type":"function","title":"Examples - Explorer.DataFrame.pull/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pull(df, \"total\")\n #Explorer.Series \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pull(df, 2)\n #Explorer.Series","ref":"Explorer.DataFrame.html#pull/2-examples"},{"type":"function","title":"Explorer.DataFrame.put/4","doc":"Creates or modifies a single column.\n\nThis is a simplified way to add or modify one column,\naccepting a series, tensor, or a list.\n\nIf you are computing a series, it is preferrable to use\n`mutate/2` or `mutate_with/2` to compute the series and\nmodify it in a single step, as it is more powerful and\nit handles both expressions and scalar values accordingly.\n\nIf you are passing tensors or lists, they will be automatically\nconverted to a series. By default, the new series will have the\nsame dtype as the existing series, unless the `:dtype` option\nis given. If there is no existing series, one is inferred from\nthe tensor/list.","ref":"Explorer.DataFrame.html#put/4"},{"type":"function","title":"Examples - Explorer.DataFrame.put/4","doc":"iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :b, Explorer.Series.transform(df[:a], fn n -> n * 2 end))\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :b, Explorer.Series.from_list([4, 5, 6]))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.put/4","doc":"If the dataframe is grouped, `put/3` is going to ignore the groups.\nSo the series must be of the same size of the entire dataframe.\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, \"a\")\n iex> series = Explorer.Series.from_list([9, 8, 7])\n iex> Explorer.DataFrame.put(grouped, :b, series)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-grouped-examples"},{"type":"function","title":"Tensor examples - Explorer.DataFrame.put/4","doc":"You can also put tensors into the dataframe:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]))\n #Explorer.DataFrame \n\nYou can specify which dtype the tensor represents.\nFor example, a tensor of s64 represents integers\nby default, but it may also represent timestamps\nin microseconds from the Unix epoch:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]), dtype: {:datetime, :microsecond})\n #Explorer.DataFrame \n\nIf there is already a column where we want to place the tensor,\nthe column dtype will be automatically used, this means that\nupdating dataframes in place while preserving their types is\nstraight-forward:\n\n iex> df = Explorer.DataFrame.new(a: [~N[1970-01-01 00:00:00]])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(529550625987654))\n #Explorer.DataFrame \n\nThis is particularly useful for categorical columns:\n\n iex> cat = Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"], dtype: :category)\n iex> df = Explorer.DataFrame.new(a: cat)\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([2, 1, 0]))\n #Explorer.DataFrame \n\nOn the other hand, if you try to put a floating tensor on\nan integer column, an error will be raised unless a dtype\nor `dtype: :infer` is given:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64))\n ** (ArgumentError) dtype integer expects a tensor of type {:s, 64} but got type {:f, 64}\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :float)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :infer)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-tensor-examples"},{"type":"function","title":"List examples - Explorer.DataFrame.put/4","doc":"Similar to tensors, we can also put lists in the dataframe:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, [1, 2, 3])\n #Explorer.DataFrame \n\nThe same considerations as above apply.","ref":"Explorer.DataFrame.html#put/4-list-examples"},{"type":"function","title":"Explorer.DataFrame.relocate/3","doc":"Relocates columns.\n\nChange column order within a DataFrame. The `before` and `after` options are mutually exclusive.\nProviding no options will relocate the columns to beginning of the DataFrame.","ref":"Explorer.DataFrame.html#relocate/3"},{"type":"function","title":"Options - Explorer.DataFrame.relocate/3","doc":"* `:before` - Specifies to relocate before the given column.\n It can be an index or a column name.\n\n * `:after` - Specifies to relocate after the given column.\n It can be an index or a column name.","ref":"Explorer.DataFrame.html#relocate/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.relocate/3","doc":"Relocate a single column\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1], c: [nil, 5, 6])\n iex> Explorer.DataFrame.relocate(df, \"a\", after: \"c\")\n #Explorer.DataFrame \n\nRelocate (and reorder) multiple columns to the beginning\n\n iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: [\"yes\", \"no\"])\n iex> Explorer.DataFrame.relocate(df, [\"d\", 1], before: 0)\n #Explorer.DataFrame \n\nRelocate before another column\n\n iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: [\"yes\", \"no\"])\n iex> Explorer.DataFrame.relocate(df, [\"a\", \"c\"], before: \"b\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#relocate/3-examples"},{"type":"function","title":"Explorer.DataFrame.rename/2","doc":"Renames columns.\n\nRenaming a column that is also a group is going to rename the group as well.\nTo apply a function to a subset of columns, see `rename_with/3`.","ref":"Explorer.DataFrame.html#rename/2"},{"type":"function","title":"Examples - Explorer.DataFrame.rename/2","doc":"You can pass in a list of new names:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, [\"c\", \"d\"])\n #Explorer.DataFrame \n\nOr you can rename individual columns using keyword args:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, a: \"first\")\n #Explorer.DataFrame \n\nOr you can rename individual columns using a map:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, %{\"a\" => \"first\"})\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#rename/2-examples"},{"type":"function","title":"Explorer.DataFrame.rename_with/3","doc":"Renames columns with a function.\n\nRenaming a column that is also a group is going to rename the group as well.","ref":"Explorer.DataFrame.html#rename_with/3"},{"type":"function","title":"Examples - Explorer.DataFrame.rename_with/3","doc":"If no columns are specified, it will apply the function to all column names:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, &String.upcase/1)\n #Explorer.DataFrame \n\nA callback can be used to filter the column names that will be renamed, similarly to `select/2`:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, &String.ends_with?(&1, \"_fuel\"), &String.trim_trailing(&1, \"_fuel\"))\n #Explorer.DataFrame \n\nOr you can just pass in the list of column names you'd like to apply the function to:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, [\"total\", \"cement\"], &String.upcase/1)\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#rename_with/3-examples"},{"type":"function","title":"Explorer.DataFrame.sample/3","doc":"Sample rows from a dataframe.\n\nIf given an integer as the second argument, it will return N samples. If given a float, it will\nreturn that proportion of the series.\n\nCan sample with or without replacement.\n\nFor grouped dataframes, sample will take into account the rows of each group, meaning that\nif you try to get N samples and you have G groups, you will get N * G rows. See the examples\nbelow.","ref":"Explorer.DataFrame.html#sample/3"},{"type":"function","title":"Options - Explorer.DataFrame.sample/3","doc":"* `:replace` - If set to `true`, each sample will be independent and therefore\n values may repeat. Required to be `true` for `n` greater then the number of rows\n in the dataframe or `frac` > 1.0. (default: `false`)\n\n * `:seed` - An integer to be used as a random seed. If nil, a random value between 0\n and 2^64 - 1 will be used. (default: `nil`)\n\n * `:shuffle` - If set to `true`, the resultant dataframe is going to be shuffle\n if the sample is equal to the size of the dataframe. (default: `false`)","ref":"Explorer.DataFrame.html#sample/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.sample/3","doc":"You can sample N rows:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.sample(df, 3, seed: 100)\n #Explorer.DataFrame \n\nOr you can sample a proportion of rows:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.sample(df, 0.03, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#sample/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.sample/3","doc":"In the following example we have the Iris dataset grouped by species, and we want\nto take a sample of two plants from each group. Since we have three species, the\nresultant dataframe is going to have six rows (2 * 3).\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.sample(grouped, 2, seed: 100)\n #Explorer.DataFrame \n\nThe behaviour is similar when you want to take a fraction of the rows from each group. The main\ndifference is that each group can have more or less rows, depending on its size.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.sample(grouped, 0.1, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#sample/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.select/2","doc":"Selects a subset of columns by name.\n\nIt's important to notice that groups are kept:\nyou can't select off grouping columns.","ref":"Explorer.DataFrame.html#select/2"},{"type":"function","title":"Examples - Explorer.DataFrame.select/2","doc":"You can select a single column:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, \"a\")\n #Explorer.DataFrame \n\nOr a list of names:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, [\"a\"])\n #Explorer.DataFrame \n\nYou can also use a range or a list of integers:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.select(df, [0, 1])\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.select(df, 0..1)\n #Explorer.DataFrame \n\nOr you can use a callback function that takes the dataframe's names as its first argument:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, &String.starts_with?(&1, \"b\"))\n #Explorer.DataFrame \n\nOr, if you prefer, a regex:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, ~r/^b$/)\n #Explorer.DataFrame \n\nOr a callback function that takes names and types:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, fn _name, type -> type == :integer end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#select/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.select/2","doc":"Columns that are also groups cannot be removed,\nyou need to ungroup before removing these columns.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.select(grouped, [\"sepal_width\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#select/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.shape/1","doc":"Gets the shape of the dataframe as a `{height, width}` tuple.\n\nThis function works the same way for grouped dataframes, considering the entire\ndataframe in the counting of rows.","ref":"Explorer.DataFrame.html#shape/1"},{"type":"function","title":"Examples - Explorer.DataFrame.shape/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0, 3.0], ints: [1, 2, 3])\n iex> Explorer.DataFrame.shape(df)\n {3, 2}","ref":"Explorer.DataFrame.html#shape/1-examples"},{"type":"function","title":"Explorer.DataFrame.shuffle/2","doc":"Change the order of the rows of a dataframe randomly.\n\nThis function is going to ignore groups.","ref":"Explorer.DataFrame.html#shuffle/2"},{"type":"function","title":"Options - Explorer.DataFrame.shuffle/2","doc":"* `:seed` - An integer to be used as a random seed. If nil, a random value between 0\n and 2^64 - 1 will be used. (default: `nil`)","ref":"Explorer.DataFrame.html#shuffle/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.shuffle/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.shuffle(df, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#shuffle/2-examples"},{"type":"function","title":"Explorer.DataFrame.slice/2","doc":"Slices rows at the given indices as a new dataframe.\n\nThe indices may be a list or series of indices, or a range.\nA list of indices does not support negative numbers.\nRanges may be negative on either end, which are then\nnormalized. Note ranges in Elixir are inclusive.\n\nSlice works differently when a dataframe is grouped.\nIt is going to consider the indices of each group\ninstead of the entire dataframe. See the examples below.\n\nIf your intention is to grab a portion of each group,\nprefer to use `sample/3` instead.","ref":"Explorer.DataFrame.html#slice/2"},{"type":"function","title":"Examples - Explorer.DataFrame.slice/2","doc":"iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, [0, 2])\n #Explorer.DataFrame \n\nWith a series\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, Explorer.Series.from_list([0, 2]))\n #Explorer.DataFrame \n\nWith a range:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, 1..2)\n #Explorer.DataFrame \n\nWith a range with negative first and last:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, -2..-1)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.slice/2","doc":"We are going to once again use the Iris dataset.\nIn this example we want to take elements at indexes\n0 and 2:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, [0, 2])\n #Explorer.DataFrame \n\nNow we want to take the first 3 rows of each group.\nThis is going to work with the range `0..2`:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, 0..2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.slice/3","doc":"Subset a continuous set of rows.","ref":"Explorer.DataFrame.html#slice/3"},{"type":"function","title":"Examples - Explorer.DataFrame.slice/3","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, 1, 2)\n #Explorer.DataFrame \n\nNegative offsets count from the end of the series:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, -10, 2)\n #Explorer.DataFrame \n\nIf the length would run past the end of the dataframe, the result may be shorter than the length:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, -10, 20)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.slice/3","doc":"We want to take the first 3 rows of each group. We need the offset 0 and the length 3:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, 0, 3)\n #Explorer.DataFrame \n\nWe can also pass a negative offset:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, -6, 3)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/3-grouped-examples"},{"type":"macro","title":"Explorer.DataFrame.summarise/2","doc":"Summarise each group to a single row using `Explorer.Query`.\n\nTo summarise, you must perform aggregation, defined in `Explorer.Series`,\non the desired columns. The query is compiled and runs efficiently\nagainst the dataframe. This function performs aggregations based on groups,\nand the query must contain at least one aggregation.\nIt implicitly ungroups the resultant dataframe.\n\n> ##","ref":"Explorer.DataFrame.html#summarise/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.summarise/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nSee `summarise_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#summarise/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.summarise/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> grouped_df = Explorer.DataFrame.group_by(df, \"year\")\n iex> Explorer.DataFrame.summarise(grouped_df, total_max: max(total), total_min: min(total))\n #Explorer.DataFrame \n\nSuppose you want to get the mean petal length of each Iris species. You could do something\nlike this:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped_df = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.summarise(grouped_df, mean_petal_length: mean(petal_length))\n #Explorer.DataFrame \n\nIn case aggregations for all the dataframe is what you want, you can use ungrouped\ndataframes:\n\n iex> df = Explorer.Datasets.iris()\n iex> Explorer.DataFrame.summarise(df, mean_petal_length: mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#summarise/2-examples"},{"type":"function","title":"Explorer.DataFrame.summarise_with/2","doc":"Summarise each group to a single row using a callback function.\n\nIn case no group is set, the entire dataframe will be considered.\nThe callback receives a lazy dataframe. A lazy dataframe does not\nhold any values, instead it stores all operations in order to\nexecute all summarizations performantly.\n\nThis is a callback version of `summarise/2`.","ref":"Explorer.DataFrame.html#summarise_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.summarise_with/2","doc":"iex> alias Explorer.{DataFrame, Series}\n iex> df = Explorer.Datasets.fossil_fuels() |> DataFrame.group_by(\"year\")\n iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1[\"total\"]), countries: Series.n_distinct(&1[\"country\"])])\n #Explorer.DataFrame \n\n iex> alias Explorer.{DataFrame, Series}\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1[\"total\"]), countries: Series.n_distinct(&1[\"country\"])])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#summarise_with/2-examples"},{"type":"function","title":"Explorer.DataFrame.tail/2","doc":"Returns the last *n* rows of the dataframe.\n\nBy default it returns the last 5 rows.\n\nIf the dataframe is using groups, then the last *n* rows of each group is\nreturned.","ref":"Explorer.DataFrame.html#tail/2"},{"type":"function","title":"Examples - Explorer.DataFrame.tail/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.tail(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.tail(df, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#tail/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.tail/2","doc":"Using grouped dataframes makes `tail/2` return **n rows** from each group.\nHere is an example using the Iris dataset, and returning two rows from each group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.tail(grouped, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#tail/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.to_columns/2","doc":"Converts a dataframe to a list of columns with lists as values.\n\nSee `to_series/2` if you want a list of columns with series as values.\nNote that this function does not take into account groups.\n\n> ##","ref":"Explorer.DataFrame.html#to_columns/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_columns/2","doc":">\n> This is an expensive operation since it converts series to lists and doing\n> so will copy the whole dataframe. Prefer to use the operations in this and\n> the `Explorer.Series` module rather than the ones in `Enum` whenever possible,\n> as Explorer is optimized for large series.","ref":"Explorer.DataFrame.html#to_columns/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_columns/2","doc":"* `:atom_keys` - Configure if the resultant map should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_columns/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_columns/2","doc":"iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])\n iex> Explorer.DataFrame.to_columns(df)\n %{\"floats\" => [1.0, 2.0], \"ints\" => [1, nil]}\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_columns(df, atom_keys: true)\n %{floats: [1.0, 2.0], ints: [1, nil]}","ref":"Explorer.DataFrame.html#to_columns/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_csv/3","doc":"Writes a dataframe to a delimited file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_csv/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_csv/3","doc":"* `:header` - Should the column names be written as the first line of the file? (default: `true`)\n\n * `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_csv/3-options"},{"type":"function","title":"Explorer.DataFrame.to_csv!/3","doc":"Similar to `to_csv/3` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#to_csv!/3"},{"type":"function","title":"Explorer.DataFrame.to_ipc/3","doc":"Writes a dataframe to an IPC file.\n\nApache IPC is a language-agnostic columnar data structure that can be used to store dataframes.\nIt excels as a format for quickly exchange data between different programming languages.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_ipc/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ipc/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.\n\n * `:streaming` - Tells the backend if it should use streaming, which means\n that the dataframe is not loaded to the memory at once, and instead it is\n written in chunks from a lazy dataframe.\n\n This option has no effect on eager - the default - dataframes.\n It defaults to `true`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ipc/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ipc!/3","doc":"Similar to `to_ipc/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ipc!/3"},{"type":"function","title":"Explorer.DataFrame.to_ipc_stream/3","doc":"Writes a dataframe to an IPC Stream file.\n\nArrow IPC Streams provide a streaming protocol or ā€œformat\" for sending an arbitrary\nlength sequence of record batches.\nThe format must be processed from start to end, and does not support random access.","ref":"Explorer.DataFrame.html#to_ipc_stream/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ipc_stream/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ipc_stream/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ipc_stream!/3","doc":"Similar to `to_ipc_stream/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ipc_stream!/3"},{"type":"function","title":"Explorer.DataFrame.to_lazy/1","doc":"Converts the dataframe to the lazy version of the current backend.\n\nIf already lazy, this is a noop.\n\nConverting a grouped dataframe should return a lazy dataframe with groups.","ref":"Explorer.DataFrame.html#to_lazy/1"},{"type":"function","title":"Explorer.DataFrame.to_ndjson/3","doc":"Writes a dataframe to a ndjson file.\n\nGroups are ignored if the dataframe is using any.\n\nNDJSON are files that contains JSON files separated by new lines.\nThey are often used as structured logs.","ref":"Explorer.DataFrame.html#to_ndjson/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ndjson/3","doc":"* `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ndjson/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ndjson!/3","doc":"Similar to `to_ndjson/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ndjson!/3"},{"type":"function","title":"Explorer.DataFrame.to_parquet/3","doc":"Writes a dataframe to a parquet file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_parquet/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_parquet/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Where a compression level is available, this can be passed as a tuple,\n such as `{:zstd, 3}`. Supported options are:\n\n * `nil` (uncompressed, default)\n * `:snappy`\n * `:gzip` (with levels 1-9)\n * `:brotli` (with levels 1-11)\n * `:zstd` (with levels -7-22)\n * `:lz4raw`.\n\n * `:streaming` - Tells the backend if it should use streaming, which means\n that the dataframe is not loaded to the memory at once, and instead it is\n written in chunks from a lazy dataframe.\n\n This option has no effect on eager - the default - dataframes.\n It defaults to `true`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_parquet/3-options"},{"type":"function","title":"Explorer.DataFrame.to_parquet!/3","doc":"Similar to `to_parquet/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_parquet!/3"},{"type":"function","title":"Explorer.DataFrame.to_rows/2","doc":"Converts a dataframe to a list of maps (rows).\n\n> ##","ref":"Explorer.DataFrame.html#to_rows/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_rows/2","doc":">\n> This is an expensive operation since data is stored in a columnar format.\n> You must avoid converting a dataframe to rows, as that will transform and\n> copy the whole dataframe in memory. Prefer to use the operations in this\n> module rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.DataFrame.html#to_rows/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_rows/2","doc":"* `:atom_keys` - Configure if the resultant maps should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_rows/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_rows/2","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows(df)\n [%{\"floats\" => 1.0, \"ints\" => 1}, %{\"floats\" => 2.0 ,\"ints\" => nil}]\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows(df, atom_keys: true)\n [%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]","ref":"Explorer.DataFrame.html#to_rows/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_rows_stream/2","doc":"Converts a dataframe to a stream of maps (rows).\n\n> ##","ref":"Explorer.DataFrame.html#to_rows_stream/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_rows_stream/2","doc":">\n> This is an expensive operation since data is stored in a columnar format.\n> Prefer to use the operations in this module rather than the ones in `Enum`\n> whenever possible, as this module is optimized for large series.","ref":"Explorer.DataFrame.html#to_rows_stream/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_rows_stream/2","doc":"* `:atom_keys` - Configure if the resultant maps should have atom keys. (default: `false`)\n * `:chunk_size` - Number of rows passed to `to_rows/2` while streaming over the data. (default: `1000`)","ref":"Explorer.DataFrame.html#to_rows_stream/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_rows_stream/2","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows_stream(df) |> Enum.map(& &1)\n [%{\"floats\" => 1.0, \"ints\" => 1}, %{\"floats\" => 2.0 ,\"ints\" => nil}]\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows_stream(df, atom_keys: true) |> Enum.map(& &1)\n [%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]","ref":"Explorer.DataFrame.html#to_rows_stream/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_series/2","doc":"Converts a dataframe to a list of columns with series as values.\n\nSee `to_columns/2` if you want a list of columns with lists as values.\nNote that this function does not take into account groups.","ref":"Explorer.DataFrame.html#to_series/2"},{"type":"function","title":"Options - Explorer.DataFrame.to_series/2","doc":"* `:atom_keys` - Configure if the resultant map should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_series/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_series/2","doc":"iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])\n iex> map = Explorer.DataFrame.to_series(df)\n iex> Explorer.Series.to_list(map[\"floats\"])\n [1.0, 2.0]\n iex> Explorer.Series.to_list(map[\"ints\"])\n [1, nil]","ref":"Explorer.DataFrame.html#to_series/2-examples"},{"type":"function","title":"Explorer.DataFrame.ungroup/2","doc":"Removes grouping variables.\n\nAccepts a list of group names. If groups is not specified, then all groups are\nremoved.","ref":"Explorer.DataFrame.html#ungroup/2"},{"type":"function","title":"Examples - Explorer.DataFrame.ungroup/2","doc":"Ungroups all by default:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n iex> Explorer.DataFrame.ungroup(df)\n #Explorer.DataFrame \n\nUngrouping a single column:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n iex> Explorer.DataFrame.ungroup(df, \"country\")\n #Explorer.DataFrame \n\nLists, ranges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#ungroup/2-examples"},{"type":"type","title":"Explorer.DataFrame.column/0","doc":"Represents a column name or its index.","ref":"Explorer.DataFrame.html#t:column/0"},{"type":"type","title":"Explorer.DataFrame.column_name/0","doc":"Represents a column name as atom or string.","ref":"Explorer.DataFrame.html#t:column_name/0"},{"type":"type","title":"Explorer.DataFrame.column_names/0","doc":"Represents multiple column names as atoms or strings.","ref":"Explorer.DataFrame.html#t:column_names/0"},{"type":"type","title":"Explorer.DataFrame.column_pairs/1","doc":"Represents a column pair where the value is a column name or\na column index, and the value is of type `value`.","ref":"Explorer.DataFrame.html#t:column_pairs/1"},{"type":"type","title":"Explorer.DataFrame.columns/0","doc":"Represents multiple columns.\n\nThe columns may be specified as one of:\n\n * a list of columns indexes or names as atoms and strings\n\n * a range\n\n * a regex that keeps only the names matching the regex\n\n * a one-arity function that receives column names and returns\n true for column names to keep\n\n * a two-arity function that receives column names and types and\n returns true for column names to keep","ref":"Explorer.DataFrame.html#t:columns/0"},{"type":"type","title":"Explorer.DataFrame.fs_entry/0","doc":"Represents a filesystem entry, that can be local or S3.","ref":"Explorer.DataFrame.html#t:fs_entry/0"},{"type":"type","title":"Explorer.DataFrame.t/0","doc":"Represents a dataframe.","ref":"Explorer.DataFrame.html#t:t/0"},{"type":"module","title":"Explorer.Datasets","doc":"Datasets used in examples and exploration.\n\nNote those datasets are not available inside Elixir releases\n(see `mix release`), which is the usual way to deploy Elixir\nin production. Therefore, if you need one of those datasets\nin production, you must download the source files to your\nown application `priv` directory and load them yourself.\nFor example:\n\n Explorer.DataFrame.from_csv!(Application.app_dir(:my_app, \"priv/iris.csv\"))","ref":"Explorer.Datasets.html"},{"type":"function","title":"Explorer.Datasets.fossil_fuels/0","doc":"CO2 emissions from fossil fuels since 2010, by country","ref":"Explorer.Datasets.html#fossil_fuels/0"},{"type":"function","title":"Citation - Explorer.Datasets.fossil_fuels/0","doc":"Boden, T.A., G. Marland, and R.J. Andres. 2013. Global, Regional, and National Fossil-Fuel CO2\n Emissions. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S.\n Department of Energy, Oak Ridge, Tenn., U.S.A. doi 10.3334/CDIAC/00001_V2013","ref":"Explorer.Datasets.html#fossil_fuels/0-citation"},{"type":"function","title":"Explorer.Datasets.iris/0","doc":"Iris Dataset.\n\nThis classic dataset was collected by Edgar Anderson in 1936\nand made famous by R. A. Fisher's 1936 paper. It consists of\nseveral measurements of three species of Iris (Iris setosa,\nIris virginica and Iris versicolor).\n\nDownloaded and modified from: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data","ref":"Explorer.Datasets.html#iris/0"},{"type":"function","title":"Citation - Explorer.Datasets.iris/0","doc":"Fisher,R. A.. (1988). Iris. UCI Machine Learning Repository. https://doi.org/10.24432/C56C76.","ref":"Explorer.Datasets.html#iris/0-citation"},{"type":"function","title":"Explorer.Datasets.wine/0","doc":"Wine Dataset.\n\nThe data is the result of a chemical analysis of wines grown in the same\nregion in Italy but derived from three different cultivars. The analysis\ndetermined the quantities of 13 constituents found in each of the three\ntypes of wines.\n\nDownloaded and modified from: https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data","ref":"Explorer.Datasets.html#wine/0"},{"type":"function","title":"Citation - Explorer.Datasets.wine/0","doc":"Aeberhard,Stefan and Forina,M.. (1991). Wine. UCI Machine Learning Repository. https://doi.org/10.24432/C5PC7J.","ref":"Explorer.Datasets.html#wine/0-citation"},{"type":"module","title":"Explorer.Query","doc":"High-level query for Explorer.\n\n> ##","ref":"Explorer.Query.html"},{"type":"module","title":"Explorer.DataFrame vs DF {: .tip} - Explorer.Query","doc":">\n> All examples below assume you have defined aliased\n> `Explorer.DataFrame` to `DF` as shown below:\n>\n> alias Explorer.DataFrame, as: DF\n>\n\nQueries convert regular Elixir code which compile to efficient\ndataframes operations. Inside a query, only the limited set of\nSeries operations are available and identifiers, such as `strs`\nand `nums`, represent dataframe column names:\n\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums > 2)\n #Explorer.DataFrame \n\nIf a column has unusual format, you can either rename it before-hand,\nor use `col/1` inside queries:\n\n iex> df = DF.new(\"unusual nums\": [1, 2, 3])\n iex> DF.filter(df, col(\"unusual nums\") > 2)\n #Explorer.DataFrame \n\nAll operations from `Explorer.Series` are imported inside queries.\nThis module also provides operators to use in queries, which are\nalso imported into queries.","ref":"Explorer.Query.html#module-explorer-dataframe-vs-df-tip"},{"type":"module","title":"Supported operations - Explorer.Query","doc":"Queries are supported in the following operations:\n\n * `Explorer.DataFrame.arrange/2`\n * `Explorer.DataFrame.filter/2`\n * `Explorer.DataFrame.mutate/2`\n * `Explorer.DataFrame.summarise/2`","ref":"Explorer.Query.html#module-supported-operations"},{"type":"module","title":"Interpolation - Explorer.Query","doc":"If you want to access variables defined outside of the query\nor get access to all Elixir constructs, you must use `^`:\n\n iex> min = 2\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums > ^min)\n #Explorer.DataFrame \n\n iex> min = 2\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums 0, do: 10, else: -10))\n #Explorer.DataFrame \n\n`^` can be used with `col` to access columns dynamically:\n\n iex> df = DF.new(\"unusual nums\": [1, 2, 3])\n iex> name = \"unusual nums\"\n iex> DF.filter(df, col(^name) > 2)\n #Explorer.DataFrame","ref":"Explorer.Query.html#module-interpolation"},{"type":"module","title":"Across and comprehensions - Explorer.Query","doc":"`Explorer.Query` leverages the power behind Elixir for-comprehensions\nto provide a powerful syntax for traversing several columns in a dataframe\nat once. For example, imagine you want to standardization the data on the\niris dataset, you could write this:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> sepal_width: (sepal_width - mean(sepal_width)) / variance(sepal_width),\n ...> sepal_length: (sepal_length - mean(sepal_length)) / variance(sepal_length),\n ...> petal_length: (petal_length - mean(petal_length)) / variance(petal_length),\n ...> petal_width: (petal_width - mean(petal_width)) / variance(petal_width)\n ...> )\n #Explorer.DataFrame \n\nWhile the code above does its job, it is quite repetitive. With across and for-comprehensions,\nwe could instead write:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> for col {col.name, (col - mean(col)) / variance(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\nWhich achieves the same result in a more concise and maintainable way.\n`across/1` may receive any of the following input as arguments:\n\n * a list of columns indexes or names as atoms and strings\n\n * a range\n\n * a regex that keeps only the names matching the regex\n\nFor example, since we know the width and length columns are the first four,\nwe could also have written (remember ranges in Elixir are inclusive):\n\n DF.mutate(iris,\n for col iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> for col {col.name, (col - mean(col)) / variance(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\nFor-comprehensions works with all dataframe verbs. As we have seen\nabove, for mutations we must return tuples as pair with the mutation\nname and its value. `summarise` works similarly. Note in both cases\nthe name could also be generated dynamically. For example, to compute\nthe mean per species, you could write:\n\n iex> Explorer.Datasets.iris()\n ...> |> DF.group_by(\"species\")\n ...> |> DF.summarise(\n ...> for col {\"#{col.name}_mean\", mean(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\n`arrange` expects a list of columns to sort by, while for-comprehensions\nin `filter` generate a list of conditions, which are joined using `and`.\nFor example, to filter all entries have both sepal and petal length above\naverage, using a filter on the column name, one could write:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.filter(iris,\n ...> for col col > mean(col)\n ...> end\n ...> )\n #Explorer.DataFrame \n\n> ##","ref":"Explorer.Query.html#module-across-and-comprehensions"},{"type":"module","title":"Do not mix comprehension and queries {: .warning} - Explorer.Query","doc":">\n> The filter inside a for-comprehension works at the meta level:\n> it can only filter columns based on their names and dtypes, but\n> not on their values. For example, this code does not make any\n> sense and it will fail to compile:\n>\n> |> DF.filter(\n> for col mean(col) do\n> col\n> end\n> end)\n>\n> Another way to think about it, the comprehensions traverse on the\n> columns themselves, the contents inside the comprehension do-block\n> traverse on the values inside the columns.","ref":"Explorer.Query.html#module-do-not-mix-comprehension-and-queries-warning"},{"type":"module","title":"Implementation details - Explorer.Query","doc":"Queries simply become lazy dataframe operations at runtime.\nFor example, the following query\n\n Explorer.DataFrame.filter(df, nums > 2)\n\nis equivalent to\n\n Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df[\"nums\"], 2) end)\n\nThis means that, whenever you want to generate queries programatically,\nyou can fallback to the regular `_with` APIs.","ref":"Explorer.Query.html#module-implementation-details"},{"type":"function","title":"Explorer.Query.**/2","doc":"Delegate to `Explorer.Series.pow/2`.","ref":"Explorer.Query.html#**/2"},{"type":"function","title":"Explorer.Query.*/2","doc":"Delegate to `Explorer.Series.multiply/2`.","ref":"Explorer.Query.html#*/2"},{"type":"function","title":"Explorer.Query.+/1","doc":"Unary plus operator.\n\nWorks with numbers and series.","ref":"Explorer.Query.html#+/1"},{"type":"function","title":"Explorer.Query.+/2","doc":"Delegate to `Explorer.Series.add/2`.","ref":"Explorer.Query.html#+/2"},{"type":"function","title":"Explorer.Query.-/1","doc":"Unary minus operator.\n\nWorks with numbers and series.","ref":"Explorer.Query.html#-/1"},{"type":"function","title":"Explorer.Query.-/2","doc":"Delegate to `Explorer.Series.subtract/2`.","ref":"Explorer.Query.html#-/2"},{"type":"function","title":"Explorer.Query.//2","doc":"Delegate to `Explorer.Series.divide/2`.","ref":"Explorer.Query.html#//2"},{"type":"function","title":"Explorer.Query.!=/2","doc":"Delegate to `Explorer.Series.not_equal/2`.","ref":"Explorer.Query.html#!=/2"},{"type":"function","title":"Explorer.Query./2","doc":"String concatenation operator.\n\nWorks with strings and series of strings.","ref":"Explorer.Query.html#%3C%3E/2"},{"type":"macro","title":"Examples - Explorer.Query.<>/2","doc":"DF.mutate(df, name: first_name \" \" last_name)\n\nIf you want to convert concatenate non-string\nseries, you can explicitly cast them to string\nbefore:\n\n DF.mutate(df, name: cast(year, :string) \"-\" cast(month, :string))\n\nOr use format:\n\n DF.mutate(df, name: format([year, \"-\", month]))","ref":"Explorer.Query.html#%3C%3E/2-examples"},{"type":"function","title":"Explorer.Query.==/2","doc":"Delegate to `Explorer.Series.equal/2`.","ref":"Explorer.Query.html#==/2"},{"type":"function","title":"Explorer.Query.>/2","doc":"Delegate to `Explorer.Series.greater/2`.","ref":"Explorer.Query.html#%3E/2"},{"type":"function","title":"Explorer.Query.>=/2","doc":"Delegate to `Explorer.Series.greater_equal/2`.","ref":"Explorer.Query.html#%3E=/2"},{"type":"macro","title":"Explorer.Query.across/0","doc":"Accesses all columns in the dataframe.\n\nThis is the equivalent to `across(0..-1//1)`.\n\nSee the module docs for more information.","ref":"Explorer.Query.html#across/0"},{"type":"macro","title":"Explorer.Query.across/1","doc":"Accesses the columns given by `selector` in the dataframe.\n\n`across/1` is used as the generator inside for-comprehensions.\n\nSee the module docs for more information.","ref":"Explorer.Query.html#across/1"},{"type":"macro","title":"Explorer.Query.col/1","doc":"Accesses a column by name.\n\nIf your column name contains whitespace or start with\nuppercase letters, you can still access its name by\nusing this macro:\n\n iex> df = Explorer.DataFrame.new(\"unusual nums\": [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col(\"unusual nums\") > 2)\n #Explorer.DataFrame \n\n`name` must be an atom, a string, or an integer.\nIt is equivalent to `df[name]` but inside a query.\n\nThis can also be used if you want to access a column\nprogramatically, for example:\n\n iex> df = Explorer.DataFrame.new(nums: [1, 2, 3])\n iex> name = :nums\n iex> Explorer.DataFrame.filter(df, col(^name) > 2)\n #Explorer.DataFrame \n\nFor traversing multiple columns programatically,\nsee `across/0` and `across/1`.","ref":"Explorer.Query.html#col/1"},{"type":"macro","title":"Explorer.Query.query/1","doc":"Builds an anonymous function from a query.\n\nThis is the entry point used by `Explorer.DataFrame.filter/2`\nand friends to convert queries into anonymous functions.\nSee the moduledoc for more information.","ref":"Explorer.Query.html#query/1"},{"type":"module","title":"Explorer.Series","doc":"The Series struct and API.\n\nA series can be of the following data types:\n\n * `:binary` - Binary\n * `:boolean` - Boolean\n * `:category` - UTF-8 encoded binary but represented internally as integers\n * `:date` - Date type that unwraps to `Elixir.Date`\n * `{:datetime, :millisecond}` - DateTime type with milli-second precision that unwraps to `Elixir.NaiveDateTime`\n * `{:datetime, :microsecond}` - DateTime type with micro-second precision that unwraps to `Elixir.NaiveDateTime`\n * `{:datetime, :nanosecond}` - DateTime type with nano-second precision that unwraps to `Elixir.NaiveDateTime`\n * `:float` - 64-bit floating point number\n * `:integer` - 64-bit signed integer\n * `:string` - UTF-8 encoded binary\n * `:time` - Time type that unwraps to `Elixir.Time`\n\nA series must consist of a single data type only. Series may have `nil` values in them.\nThe series `dtype` can be retrieved via the `dtype/1` function or directly accessed as\n`series.dtype`. A `series.name` field is also available, but it is always `nil` unless\nthe series is retrieved from a dataframe.\n\nMany functions only apply to certain dtypes. These functions may appear on distinct\ncategories on the sidebar. Other functions may work on several datatypes, such as\ncomparison functions. In such cases, a \"Supported dtypes\" section will be available\nin the function documentation.","ref":"Explorer.Series.html"},{"type":"module","title":"Creating series - Explorer.Series","doc":"Series can be created using `from_list/2`, `from_binary/3`, and friends:\n\nSeries can be made of numbers:\n\n iex> Explorer.Series.from_list([1, 2, 3])\n #Explorer.Series \n\nSeries are nullable, so you may also include nils:\n\n iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])\n #Explorer.Series \n\nAny of the dtypes above are supported, such as strings:\n\n iex> Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"])\n #Explorer.Series","ref":"Explorer.Series.html#module-creating-series"},{"type":"function","title":"Explorer.Series.abs/1","doc":"Gets the series absolute values.","ref":"Explorer.Series.html#abs/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.abs/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#abs/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.abs/1","doc":"iex> s = Explorer.Series.from_list([1, 2, -1, -3])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, -1.0, -3.0])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, -3.0])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.abs(s)\n ** (ArgumentError) Explorer.Series.abs/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#abs/1-examples"},{"type":"function","title":"Explorer.Series.acos/1","doc":"Computes the the arccosine of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between 0 and pi.","ref":"Explorer.Series.html#acos/1"},{"type":"function","title":"Supported dtype - Explorer.Series.acos/1","doc":"* `:float`","ref":"Explorer.Series.html#acos/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.acos/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.acos(s)\n #Explorer.Series","ref":"Explorer.Series.html#acos/1-examples"},{"type":"function","title":"Explorer.Series.add/2","doc":"Adds right to left, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#add/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.add/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#add/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.add/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.add(s1, s2)\n #Explorer.Series \n\nYou can also use scalar values on both sides:\n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.add(s1, 2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.add(2, s1)\n #Explorer.Series","ref":"Explorer.Series.html#add/2-examples"},{"type":"function","title":"Explorer.Series.all_equal/2","doc":"Checks equality between two entire series.","ref":"Explorer.Series.html#all_equal/2"},{"type":"function","title":"Examples - Explorer.Series.all_equal/2","doc":"iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> Explorer.Series.all_equal(s1, s2)\n true\n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([\"a\", \"c\"])\n iex> Explorer.Series.all_equal(s1, s2)\n false\n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([1, 2])\n iex> Explorer.Series.all_equal(s1, s2)\n false","ref":"Explorer.Series.html#all_equal/2-examples"},{"type":"function","title":"Explorer.Series.and/2","doc":"Returns a boolean mask of `left and right`, element-wise.\n\nBoth sizes must be series, the series must have the same\nsize or at last one of them must have size of 1.","ref":"Explorer.Series.html#and/2"},{"type":"function","title":"Examples - Explorer.Series.and/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> mask1 = Explorer.Series.greater(s1, 1)\n iex> mask2 = Explorer.Series.less(s1, 3)\n iex> Explorer.Series.and(mask1, mask2)\n #Explorer.Series","ref":"Explorer.Series.html#and/2-examples"},{"type":"function","title":"Explorer.Series.argmax/1","doc":"Gets the index of the maximum value of the series.","ref":"Explorer.Series.html#argmax/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.argmax/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#argmax/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.argmax/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.argmax(s)\n 3\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.argmax(s)\n 3\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.argmax(s)\n 0\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.argmax(s)\n 0\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.argmax(s)\n 1\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.argmax(s)\n ** (ArgumentError) Explorer.Series.argmax/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#argmax/1-examples"},{"type":"function","title":"Explorer.Series.argmin/1","doc":"Gets the index of the minimum value of the series.\n\nNote that `nil` is treated as a minimum value.","ref":"Explorer.Series.html#argmin/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.argmin/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#argmin/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.argmin/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.argmin(s)\n 2\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.argmin(s)\n 2\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.argmin(s)\n 1\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.argmin(s)\n 1\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.argmin(s)\n 0\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.argmin(s)\n ** (ArgumentError) Explorer.Series.argmin/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#argmin/1-examples"},{"type":"function","title":"Explorer.Series.argsort/2","doc":"Returns the indices that would sort the series.","ref":"Explorer.Series.html#argsort/2"},{"type":"function","title":"Options - Explorer.Series.argsort/2","doc":"* `:direction` - `:asc` or `:desc`, meaning \"ascending\" or \"descending\", respectively.\n By default it sorts in ascending order.\n\n * `:nils` - `:first` or `:last`. By default it is `:last` if direction is `:asc`, and\n `:first` otherwise.","ref":"Explorer.Series.html#argsort/2-options"},{"type":"function","title":"Examples - Explorer.Series.argsort/2","doc":"iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.argsort(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.argsort(s, direction: :desc)\n #Explorer.Series","ref":"Explorer.Series.html#argsort/2-examples"},{"type":"function","title":"Explorer.Series.asin/1","doc":"Computes the the arcsine of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between -pi/2 and pi/2.","ref":"Explorer.Series.html#asin/1"},{"type":"function","title":"Supported dtype - Explorer.Series.asin/1","doc":"* `:float`","ref":"Explorer.Series.html#asin/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.asin/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.asin(s)\n #Explorer.Series","ref":"Explorer.Series.html#asin/1-examples"},{"type":"function","title":"Explorer.Series.at/2","doc":"Returns the value of the series at the given index.\n\nThis function will raise an error in case the index\nis out of bounds.","ref":"Explorer.Series.html#at/2"},{"type":"function","title":"Examples - Explorer.Series.at/2","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.at(s, 2)\n \"c\"\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.at(s, 4)\n ** (ArgumentError) index 4 out of bounds for series of size 3","ref":"Explorer.Series.html#at/2-examples"},{"type":"function","title":"Explorer.Series.at_every/2","doc":"Takes every *n*th value in this series, returned as a new series.","ref":"Explorer.Series.html#at_every/2"},{"type":"function","title":"Examples - Explorer.Series.at_every/2","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.at_every(s, 2)\n #Explorer.Series \n\nIf *n* is bigger than the size of the series, the result is a new series with only the first value of the supplied series.\n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.at_every(s, 20)\n #Explorer.Series","ref":"Explorer.Series.html#at_every/2-examples"},{"type":"function","title":"Explorer.Series.atan/1","doc":"Computes the the arctangent of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between -pi/2 and pi/2.","ref":"Explorer.Series.html#atan/1"},{"type":"function","title":"Supported dtype - Explorer.Series.atan/1","doc":"* `:float`","ref":"Explorer.Series.html#atan/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.atan/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.atan(s)\n #Explorer.Series","ref":"Explorer.Series.html#atan/1-examples"},{"type":"function","title":"Explorer.Series.cast/2","doc":"Cast the series to another type.","ref":"Explorer.Series.html#cast/2"},{"type":"function","title":"Examples - Explorer.Series.cast/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :string)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :float)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :date)\n #Explorer.Series \n\nNote that `time` is represented as an integer of nanoseconds since midnight.\nIn Elixir we can't represent nanoseconds, only microseconds. So be aware that\ninformation can be lost if a conversion is needed (e.g. calling `to_list/1`).\n\n iex> s = Explorer.Series.from_list([1_000, 2_000, 3_000])\n iex> Explorer.Series.cast(s, :time)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([86399 * 1_000 * 1_000 * 1_000])\n iex> Explorer.Series.cast(s, :time)\n #Explorer.Series \n\nNote that `datetime` is represented as an integer of microseconds since Unix Epoch (1970-01-01 00:00:00).\n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, {:datetime, :microsecond})\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1649883642 * 1_000 * 1_000])\n iex> Explorer.Series.cast(s, {:datetime, :microsecond})\n #Explorer.Series \n\nYou can also use `cast/2` to categorise a string:\n\n iex> s = Explorer.Series.from_list([\"apple\", \"banana\", \"apple\", \"lemon\"])\n iex> Explorer.Series.cast(s, :category)\n #Explorer.Series \n\n`cast/2` will return the series as a no-op if you try to cast to the same dtype.\n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :integer)\n #Explorer.Series","ref":"Explorer.Series.html#cast/2-examples"},{"type":"function","title":"Explorer.Series.categories/1","doc":"Return a series with the category names of a categorical series.\n\nEach category has the index equal to its position.\nNo order for the categories is guaranteed.","ref":"Explorer.Series.html#categories/1"},{"type":"function","title":"Examples - Explorer.Series.categories/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\", nil, \"a\", \"c\"], dtype: :category)\n iex> Explorer.Series.categories(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"c\", \"a\", \"b\"], dtype: :category)\n iex> Explorer.Series.categories(s)\n #Explorer.Series","ref":"Explorer.Series.html#categories/1-examples"},{"type":"function","title":"Explorer.Series.categorise/2","doc":"Categorise a series of integers according to `categories`.\n\nThis function receives a series of integers and convert them into the\ncategories specified by the second argument. The second argument can\nbe one of:\n\n * a series with dtype `:category`. The integers will be indexes into\n the categories of the given series (returned by `categories/1`)\n\n * a series with dtype `:string`. The integers will be indexes into\n the series itself\n\n * a list of strings. The integers will be indexes into the list\n\nIf you have a series of strings and you want to convert them into categories,\ninvoke `cast(series, :category)` instead.","ref":"Explorer.Series.html#categorise/2"},{"type":"function","title":"Examples - Explorer.Series.categorise/2","doc":"If a categorical series is given as second argument, we will extract its\ncategories and map the integers into it:\n\n iex> categories = Explorer.Series.from_list([\"a\", \"b\", \"c\", nil, \"a\"], dtype: :category)\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, categories)\n #Explorer.Series \n\nOtherwise, if a list of strings or a series of strings is given, they are\nconsidered to be the categories series itself:\n\n iex> categories = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, categories)\n #Explorer.Series \n\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, [\"a\", \"b\", \"c\"])\n #Explorer.Series \n\nElements that are not mapped to a category will become `nil`:\n\n iex> indexes = Explorer.Series.from_list([0, 2, nil, 0, 2, 7])\n iex> Explorer.Series.categorise(indexes, [\"a\", \"b\", \"c\"])\n #Explorer.Series","ref":"Explorer.Series.html#categorise/2-examples"},{"type":"function","title":"Explorer.Series.ceil/1","doc":"Ceil floating point series to highest integers smaller or equal to the float value.","ref":"Explorer.Series.html#ceil/1"},{"type":"function","title":"Examples - Explorer.Series.ceil/1","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.ceil(s)\n #Explorer.Series","ref":"Explorer.Series.html#ceil/1-examples"},{"type":"function","title":"Explorer.Series.clip/3","doc":"Clip (or clamp) the values in a series.\n\nValues that fall outside of the interval defined by the `min` and `max`\nbounds are clipped to the bounds.","ref":"Explorer.Series.html#clip/3"},{"type":"function","title":"Supported dtypes - Explorer.Series.clip/3","doc":"* `:integer`\n * `:float`\n\nClipping other dtypes are possible using `select/3`.","ref":"Explorer.Series.html#clip/3-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.clip/3","doc":"iex> s = Explorer.Series.from_list([-50, 5, nil, 50])\n iex> Explorer.Series.clip(s, 1, 10)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([-50, 5, nil, 50])\n iex> Explorer.Series.clip(s, 1.5, 10.5)\n #Explorer.Series","ref":"Explorer.Series.html#clip/3-examples"},{"type":"function","title":"Explorer.Series.coalesce/1","doc":"Finds the first non-missing element at each position.","ref":"Explorer.Series.html#coalesce/1"},{"type":"function","title":"Examples - Explorer.Series.coalesce/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, nil, nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> s3 = Explorer.Series.from_list([nil, nil, 3, 4])\n iex> Explorer.Series.coalesce([s1, s2, s3])\n #Explorer.Series","ref":"Explorer.Series.html#coalesce/1-examples"},{"type":"function","title":"Explorer.Series.coalesce/2","doc":"Finds the first non-missing element at each position.\n\n`coalesce(s1, s2)` is equivalent to `coalesce([s1, s2])`.","ref":"Explorer.Series.html#coalesce/2"},{"type":"function","title":"Examples - Explorer.Series.coalesce/2","doc":"iex> s1 = Explorer.Series.from_list([1, nil, 3, nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.coalesce(s1, s2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([\"foo\", nil, \"bar\", nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.coalesce(s1, s2)\n ** (ArgumentError) cannot invoke Explorer.Series.coalesce/2 with mismatched dtypes: :string and :integer","ref":"Explorer.Series.html#coalesce/2-examples"},{"type":"function","title":"Explorer.Series.concat/1","doc":"Concatenate one or more series.\n\nThe dtypes must match unless all are numeric, in which case all series will be downcast to float.","ref":"Explorer.Series.html#concat/1"},{"type":"function","title":"Examples - Explorer.Series.concat/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.concat([s1, s2])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4.0, 5.0, 6.4])\n iex> Explorer.Series.concat([s1, s2])\n #Explorer.Series","ref":"Explorer.Series.html#concat/1-examples"},{"type":"function","title":"Explorer.Series.concat/2","doc":"Concatenate two series.\n\n`concat(s1, s2)` is equivalent to `concat([s1, s2])`.","ref":"Explorer.Series.html#concat/2"},{"type":"function","title":"Explorer.Series.contains/2","doc":"Detects whether a string contains a substring.","ref":"Explorer.Series.html#contains/2"},{"type":"function","title":"Examples - Explorer.Series.contains/2","doc":"iex> s = Explorer.Series.from_list([\"abc\", \"def\", \"bcd\"])\n iex> Explorer.Series.contains(s, \"bc\")\n #Explorer.Series","ref":"Explorer.Series.html#contains/2-examples"},{"type":"function","title":"Explorer.Series.correlation/3","doc":"Compute the Pearson's correlation between two series.\n\nThe parameter `ddof` refers to the 'delta degrees of freedom' - the divisor\nused in the correlation calculation. Defaults to 1.","ref":"Explorer.Series.html#correlation/3"},{"type":"function","title":"Supported dtypes - Explorer.Series.correlation/3","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#correlation/3-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.correlation/3","doc":"iex> s1 = Series.from_list([1, 8, 3])\n iex> s2 = Series.from_list([4, 5, 2])\n iex> Series.correlation(s1, s2)\n 0.5447047794019223","ref":"Explorer.Series.html#correlation/3-examples"},{"type":"function","title":"Explorer.Series.cos/1","doc":"Computes the the cosine of a number (in radians).\nThe resultant series is going to be of dtype `:float`, with values between 1 and -1.","ref":"Explorer.Series.html#cos/1"},{"type":"function","title":"Supported dtype - Explorer.Series.cos/1","doc":"* `:float`","ref":"Explorer.Series.html#cos/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.cos/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.cos(s)\n #Explorer.Series","ref":"Explorer.Series.html#cos/1-examples"},{"type":"function","title":"Explorer.Series.count/1","doc":"Counts the number of elements in a series.\n\nIn the context of lazy series and `Explorer.Query`,\n`count/1` counts the elements inside the same group.\nIf no group is in use, then count is going to return\nthe size of the series.","ref":"Explorer.Series.html#count/1"},{"type":"function","title":"Examples - Explorer.Series.count/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.count(s)\n 3","ref":"Explorer.Series.html#count/1-examples"},{"type":"function","title":"Explorer.Series.covariance/2","doc":"Compute the covariance between two series.","ref":"Explorer.Series.html#covariance/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.covariance/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#covariance/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.covariance/2","doc":"iex> s1 = Series.from_list([1, 8, 3])\n iex> s2 = Series.from_list([4, 5, 2])\n iex> Series.covariance(s1, s2)\n 3.0","ref":"Explorer.Series.html#covariance/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_max/2","doc":"Calculates the cumulative maximum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_max/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_max/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#cumulative_max/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_max/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_max/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_min/2","doc":"Calculates the cumulative minimum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_min/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_min/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#cumulative_min/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_min/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_min/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_product/2","doc":"Calculates the cumulative product of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_product/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_product/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#cumulative_product/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_product/2","doc":"iex> s = [1, 2, 3, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_product(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_product(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_product/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_sum/2","doc":"Calculates the cumulative sum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_sum/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_sum/2","doc":"* `:integer`\n * `:float`\n * `:boolean`","ref":"Explorer.Series.html#cumulative_sum/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_sum/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_sum(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_sum(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_sum/2-examples"},{"type":"function","title":"Explorer.Series.cut/3","doc":"Bins values into discrete values.\n\nGiven a `bins` length of N, there will be N+1 categories.","ref":"Explorer.Series.html#cut/3"},{"type":"function","title":"Options - Explorer.Series.cut/3","doc":"* `:labels` - The labels assigned to the bins. Given `bins` of\n length N, `:labels` must be of length N+1. Defaults to the bin\n bounds (e.g. `(-inf -1.0]`, `(-1.0, 1.0]`, `(1.0, inf]`)\n\n * `:break_point_label` - The name given to the breakpoint column.\n Defaults to `break_point`.\n\n * `:category_label` - The name given to the category column.\n Defaults to `category`.","ref":"Explorer.Series.html#cut/3-options"},{"type":"function","title":"Examples - Explorer.Series.cut/3","doc":"iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0])\n iex> Explorer.Series.cut(s, [1.5, 2.5])\n #Explorer.DataFrame","ref":"Explorer.Series.html#cut/3-examples"},{"type":"function","title":"Explorer.Series.day_of_week/1","doc":"Returns a day-of-week number starting from Monday = 1. (ISO 8601 weekday number)","ref":"Explorer.Series.html#day_of_week/1"},{"type":"function","title":"Examples - Explorer.Series.day_of_week/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-01-16], ~D[2023-01-20], nil])\n iex> Explorer.Series.day_of_week(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-01-16 23:59:59.999999], ~N[2023-01-20 12:00:00], nil])\n iex> Explorer.Series.day_of_week(s)\n #Explorer.Series","ref":"Explorer.Series.html#day_of_week/1-examples"},{"type":"function","title":"Explorer.Series.distinct/1","doc":"Returns the unique values of the series.","ref":"Explorer.Series.html#distinct/1"},{"type":"function","title":"Examples - Explorer.Series.distinct/1","doc":"iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.distinct(s)\n #Explorer.Series","ref":"Explorer.Series.html#distinct/1-examples"},{"type":"function","title":"Explorer.Series.divide/2","doc":"Divides left by right, element-wise.\n\nThe resulting series will have the dtype as `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#divide/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.divide/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#divide/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.divide/2","doc":"iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, 2)\n #Explorer.Series \n\n iex> s1 = [10, 52 ,10] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, 2.5)\n #Explorer.Series \n\n iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 0, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#divide/2-examples"},{"type":"function","title":"Explorer.Series.downcase/1","doc":"Converts all characters to lowercase.","ref":"Explorer.Series.html#downcase/1"},{"type":"function","title":"Examples - Explorer.Series.downcase/1","doc":"iex> s = Explorer.Series.from_list([\"ABC\", \"DEF\", \"BCD\"])\n iex> Explorer.Series.downcase(s)\n #Explorer.Series","ref":"Explorer.Series.html#downcase/1-examples"},{"type":"function","title":"Explorer.Series.dtype/1","doc":"Returns the data type of the series.\n\nA series can be of the following data types:\n\n * `:float` - 64-bit floating point number\n * `:integer` - 64-bit signed integer\n * `:boolean` - Boolean\n * `:string` - UTF-8 encoded binary\n * `:date` - Date type that unwraps to `Elixir.Date`\n * `:time` - Time type that unwraps to `Elixir.Time`\n * `:datetime` - DateTime type that unwraps to `Elixir.NaiveDateTime`","ref":"Explorer.Series.html#dtype/1"},{"type":"function","title":"Examples - Explorer.Series.dtype/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.dtype(s)\n :integer\n\n iex> s = Explorer.Series.from_list([\"a\", nil, \"b\", \"c\"])\n iex> Explorer.Series.dtype(s)\n :string","ref":"Explorer.Series.html#dtype/1-examples"},{"type":"function","title":"Explorer.Series.equal/2","doc":"Returns boolean mask of `left == right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#equal/2"},{"type":"function","title":"Examples - Explorer.Series.equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.equal(s1, s2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.equal(s, 1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([true, true, false])\n iex> Explorer.Series.equal(s, true)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.equal(s, \"a\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.equal(s, ~D[1999-12-31])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])\n iex> Explorer.Series.equal(s, ~N[2022-01-01 00:00:00])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.equal(s, false)\n ** (ArgumentError) cannot invoke Explorer.Series.equal/2 with mismatched dtypes: :string and false","ref":"Explorer.Series.html#equal/2-examples"},{"type":"function","title":"Explorer.Series.ewm_mean/2","doc":"Calculate the exponentially weighted moving average, given smoothing factor alpha.","ref":"Explorer.Series.html#ewm_mean/2"},{"type":"function","title":"Options - Explorer.Series.ewm_mean/2","doc":"* `:alpha` - Optional smoothing factor which specifies the imporance given\n to most recent observations. It is a value such that, 0 < alpha <= 1. Defaults to 0.5.\n\n * `:adjust` - If set to true, it corrects the bias introduced by smoothing process.\n Defaults to `true`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. Defaults to `1`.\n\n * `:ignore_nils` - If set to true, it ignore nulls in the calculation. Defaults to `true`.","ref":"Explorer.Series.html#ewm_mean/2-options"},{"type":"function","title":"Examples - Explorer.Series.ewm_mean/2","doc":"iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.ewm_mean(s)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.ewm_mean(s, alpha: 0.1)\n #Explorer.Series","ref":"Explorer.Series.html#ewm_mean/2-examples"},{"type":"function","title":"Explorer.Series.exp/1","doc":"Calculates the exponential of all elements.","ref":"Explorer.Series.html#exp/1"},{"type":"function","title":"Explorer.Series.fill_missing/2","doc":"Fill missing values with the given strategy. If a scalar value is provided instead of a strategy\natom, `nil` will be replaced with that value. It must be of the same `dtype` as the series.","ref":"Explorer.Series.html#fill_missing/2"},{"type":"function","title":"Strategies - Explorer.Series.fill_missing/2","doc":"* `:forward` - replace nil with the previous value\n * `:backward` - replace nil with the next value\n * `:max` - replace nil with the series maximum\n * `:min` - replace nil with the series minimum\n * `:mean` - replace nil with the series mean\n * `:nan` (float only) - replace nil with `NaN`","ref":"Explorer.Series.html#fill_missing/2-strategies"},{"type":"function","title":"Examples - Explorer.Series.fill_missing/2","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :forward)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :backward)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :max)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :min)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :mean)\n #Explorer.Series \n\nValues that belong to the series itself can also be added as missing:\n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, 3)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", nil, \"d\"])\n iex> Explorer.Series.fill_missing(s, \"c\")\n #Explorer.Series \n\nMismatched types will raise:\n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, \"foo\")\n ** (ArgumentError) cannot invoke Explorer.Series.fill_missing/2 with mismatched dtypes: :integer and \"foo\"\n\nFloats in particular accept missing values to be set to NaN, Inf, and -Inf:\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :nan)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :infinity)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :neg_infinity)\n #Explorer.Series","ref":"Explorer.Series.html#fill_missing/2-examples"},{"type":"function","title":"Explorer.Series.first/1","doc":"Returns the first element of the series.","ref":"Explorer.Series.html#first/1"},{"type":"function","title":"Examples - Explorer.Series.first/1","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.first(s)\n 1","ref":"Explorer.Series.html#first/1-examples"},{"type":"function","title":"Explorer.Series.floor/1","doc":"Floor floating point series to lowest integers smaller or equal to the float value.","ref":"Explorer.Series.html#floor/1"},{"type":"function","title":"Examples - Explorer.Series.floor/1","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.floor(s)\n #Explorer.Series","ref":"Explorer.Series.html#floor/1-examples"},{"type":"function","title":"Explorer.Series.format/1","doc":"Returns a string series with all values concatenated.","ref":"Explorer.Series.html#format/1"},{"type":"function","title":"Examples - Explorer.Series.format/1","doc":"iex> s1 = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> s2 = Explorer.Series.from_list([\"d\", \"e\", \"f\"])\n iex> s3 = Explorer.Series.from_list([\"g\", \"h\", \"i\"])\n iex> Explorer.Series.format([s1, s2, s3])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"d\"])\n iex> s2 = Explorer.Series.from_list([1, 2, 3, 4])\n iex> s3 = Explorer.Series.from_list([1.5, :nan, :infinity, :neg_infinity])\n iex> Explorer.Series.format([s1, \"/\", s2, \"/\", s3])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([ >, >], dtype: :binary)\n iex> s2 = Explorer.Series.from_list([ >, >], dtype: :binary)\n iex> Explorer.Series.format([s1, s2])\n ** (RuntimeError) Polars Error: External error: invalid utf-8 sequence","ref":"Explorer.Series.html#format/1-examples"},{"type":"function","title":"Explorer.Series.frequencies/1","doc":"Creates a new dataframe with unique values and the frequencies of each.","ref":"Explorer.Series.html#frequencies/1"},{"type":"function","title":"Examples - Explorer.Series.frequencies/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"a\", \"b\", \"c\", \"c\", \"c\"])\n iex> Explorer.Series.frequencies(s)\n #Explorer.DataFrame","ref":"Explorer.Series.html#frequencies/1-examples"},{"type":"function","title":"Explorer.Series.from_binary/3","doc":"Builds a series of `dtype` from `binary`.\n\nAll binaries must be in native endianness.","ref":"Explorer.Series.html#from_binary/3"},{"type":"function","title":"Options - Explorer.Series.from_binary/3","doc":"* `:backend` - The backend to allocate the series on.","ref":"Explorer.Series.html#from_binary/3-options"},{"type":"function","title":"Examples - Explorer.Series.from_binary/3","doc":"Integers and floats follow their native encoding:\n\n iex> Explorer.Series.from_binary( >, :float)\n #Explorer.Series \n\n iex> Explorer.Series.from_binary( >, :integer)\n #Explorer.Series \n\nBooleans are unsigned integers:\n\n iex> Explorer.Series.from_binary( >, :boolean)\n #Explorer.Series \n\nDates are encoded as i32 representing days from the Unix epoch (1970-01-01):\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, :date)\n #Explorer.Series \n\nTimes are encoded as i64 representing nanoseconds from midnight:\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, :time)\n #Explorer.Series \n\nDatetimes are encoded as i64 representing microseconds from the Unix epoch (1970-01-01):\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, {:datetime, :microsecond})\n #Explorer.Series","ref":"Explorer.Series.html#from_binary/3-examples"},{"type":"function","title":"Explorer.Series.from_list/2","doc":"Creates a new series from a list.\n\nThe list must consist of a single data type and nils. It is possible to have\na list of only nil values. In this case, the list will have the `:dtype` of float.","ref":"Explorer.Series.html#from_list/2"},{"type":"function","title":"Options - Explorer.Series.from_list/2","doc":"* `:backend` - The backend to allocate the series on.\n * `:dtype` - Cast the series to a given `:dtype`. By default this is `nil`, which means\n that Explorer will infer the type from the values in the list.","ref":"Explorer.Series.html#from_list/2-options"},{"type":"function","title":"Examples - Explorer.Series.from_list/2","doc":"Explorer will infer the type from the values in the list:\n\n iex> Explorer.Series.from_list([1, 2, 3])\n #Explorer.Series \n\nSeries are nullable, so you may also include nils:\n\n iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])\n #Explorer.Series \n\nA mix of integers and floats will be cast to a float:\n\n iex> Explorer.Series.from_list([1, 2.0])\n #Explorer.Series \n\nFloats series can accept NaN, Inf, and -Inf values:\n\n iex> Explorer.Series.from_list([1.0, 2.0, :nan, 4.0])\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1.0, 2.0, :infinity, 4.0])\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1.0, 2.0, :neg_infinity, 4.0])\n #Explorer.Series \n\nTrying to create a \"nil\" series will, by default, result in a series of floats:\n\n iex> Explorer.Series.from_list([nil, nil])\n #Explorer.Series \n\nYou can specify the desired `dtype` for a series with the `:dtype` option.\n\n iex> Explorer.Series.from_list([nil, nil], dtype: :integer)\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1, nil], dtype: :string)\n #Explorer.Series \n\nThe `dtype` option is particulary important if a `:binary` series is desired, because\nby default binary series will have the dtype of `:string`:\n\n iex> Explorer.Series.from_list([ >, >], dtype: :binary)\n #Explorer.Series >, >]\n >\n\nA series mixing UTF8 strings and binaries is possible:\n\n iex> Explorer.Series.from_list([ >, \"Elixir\"], dtype: :binary)\n #Explorer.Series >, \"Elixir\"]\n >\n\nAnother option is to create a categorical series from a list of strings:\n\n iex> Explorer.Series.from_list([\"EUA\", \"Brazil\", \"Poland\"], dtype: :category)\n #Explorer.Series \n\nIt is possible to create a series of `:datetime` from a list of microseconds since Unix Epoch.\n\n iex> Explorer.Series.from_list([1649883642 * 1_000 * 1_000], dtype: {:datetime, :microsecond})\n #Explorer.Series \n\nIt is possible to create a series of `:time` from a list of nanoseconds since midnight.\n\n iex> Explorer.Series.from_list([123 * 1_000 * 1_000 * 1_000], dtype: :time)\n #Explorer.Series \n\nMixing non-numeric data types will raise an ArgumentError:\n\n iex> Explorer.Series.from_list([1, \"a\"])\n ** (ArgumentError) the value \"a\" does not match the inferred series dtype :integer","ref":"Explorer.Series.html#from_list/2-examples"},{"type":"function","title":"Explorer.Series.from_tensor/2","doc":"Converts a `t:Nx.Tensor.t/0` to a series.\n\n> ##","ref":"Explorer.Series.html#from_tensor/2"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.from_tensor/2","doc":">\n> `Nx` is an optional dependency. You will need to ensure it's installed to use this function.","ref":"Explorer.Series.html#from_tensor/2-warning-warning"},{"type":"function","title":"Options - Explorer.Series.from_tensor/2","doc":"* `:backend` - The backend to allocate the series on.\n * `:dtype` - The dtype of the series, it must match the underlying tensor type.","ref":"Explorer.Series.html#from_tensor/2-options"},{"type":"function","title":"Examples - Explorer.Series.from_tensor/2","doc":"Integers and floats:\n\n iex> tensor = Nx.tensor([1, 2, 3])\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\n iex> tensor = Nx.tensor([1.0, 2.0, 3.0], type: :f64)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nUnsigned 8-bit tensors are assumed to be booleans:\n\n iex> tensor = Nx.tensor([1, 0, 1], type: :u8)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nSigned 32-bit tensors are assumed to be dates:\n\n iex> tensor = Nx.tensor([-719162, 0, 6129], type: :s32)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nTimes are signed 64-bit representing nanoseconds from midnight and\ntherefore must have their dtype explicitly given:\n\n iex> tensor = Nx.tensor([0, 86399999999000])\n iex> Explorer.Series.from_tensor(tensor, dtype: :time)\n #Explorer.Series \n\nDatetimes are signed 64-bit and therefore must have their dtype explicitly given:\n\n iex> tensor = Nx.tensor([0, 529550625987654])\n iex> Explorer.Series.from_tensor(tensor, dtype: {:datetime, :microsecond})\n #Explorer.Series","ref":"Explorer.Series.html#from_tensor/2-examples"},{"type":"function","title":"Explorer.Series.greater/2","doc":"Returns boolean mask of `left > right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#greater/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.greater/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#greater/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.greater/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.greater(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#greater/2-examples"},{"type":"function","title":"Explorer.Series.greater_equal/2","doc":"Returns boolean mask of `left >= right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#greater_equal/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.greater_equal/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#greater_equal/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.greater_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.greater_equal(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#greater_equal/2-examples"},{"type":"function","title":"Explorer.Series.head/2","doc":"Returns the first N elements of the series.","ref":"Explorer.Series.html#head/2"},{"type":"function","title":"Examples - Explorer.Series.head/2","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.head(s)\n #Explorer.Series","ref":"Explorer.Series.html#head/2-examples"},{"type":"function","title":"Explorer.Series.hour/1","doc":"Returns the hour number from 0 to 23.","ref":"Explorer.Series.html#hour/1"},{"type":"function","title":"Examples - Explorer.Series.hour/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.hour(s)\n #Explorer.Series","ref":"Explorer.Series.html#hour/1-examples"},{"type":"function","title":"Explorer.Series.in/2","doc":"Checks if each element of the series in the left exists in the series in the right, returning a boolean mask.\n\nThe series sizes do not have to match.","ref":"Explorer.Series.html#in/2"},{"type":"function","title":"Examples - Explorer.Series.in/2","doc":"iex> left = Explorer.Series.from_list([1, 2, 3])\n iex> right = Explorer.Series.from_list([1, 2])\n iex> Series.in(left, right)\n #Explorer.Series \n\n iex> left = Explorer.Series.from_list([~D[1970-01-01], ~D[2000-01-01], ~D[2010-04-17]])\n iex> right = Explorer.Series.from_list([~D[1970-01-01], ~D[2010-04-17]])\n iex> Series.in(left, right)\n #Explorer.Series","ref":"Explorer.Series.html#in/2-examples"},{"type":"function","title":"Explorer.Series.iotype/1","doc":"Returns the type of the underlying fixed-width binary representation.\n\nIt returns something in the shape of `{atom(), bits_size}` or `:none`.\nIt is often used in conjunction with `to_iovec/1` and `to_binary/1`.\n\nThe possible iotypes are:\n\n* `:u` for unsigned integers.\n* `:s` for signed integers.\n* `:f` for floats.","ref":"Explorer.Series.html#iotype/1"},{"type":"function","title":"Examples - Explorer.Series.iotype/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4])\n iex> Explorer.Series.iotype(s)\n {:s, 64}\n\n iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])\n iex> Explorer.Series.iotype(s)\n {:s, 32}\n\n iex> s = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])\n iex> Explorer.Series.iotype(s)\n {:s, 64}\n\n iex> s = Explorer.Series.from_list([1.2, 2.3, 3.5, 4.5])\n iex> Explorer.Series.iotype(s)\n {:f, 64}\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.iotype(s)\n {:u, 8}\n\nThe operation returns `:none` for strings and binaries, as they do not\nprovide a fixed-width binary representation:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.iotype(s)\n :none\n\nHowever, if appropriate, you can convert them to categorical types,\nwhich will then return the index of each category:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"], dtype: :category)\n iex> Explorer.Series.iotype(s)\n {:u, 32}","ref":"Explorer.Series.html#iotype/1-examples"},{"type":"function","title":"Explorer.Series.is_finite/1","doc":"Returns a mask of finite values.","ref":"Explorer.Series.html#is_finite/1"},{"type":"function","title":"Examples - Explorer.Series.is_finite/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_finite(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_finite/1-examples"},{"type":"function","title":"Explorer.Series.is_infinite/1","doc":"Returns a mask of infinite values.","ref":"Explorer.Series.html#is_infinite/1"},{"type":"function","title":"Examples - Explorer.Series.is_infinite/1","doc":"iex> s1 = Explorer.Series.from_list([1, -1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_infinite(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_infinite/1-examples"},{"type":"function","title":"Explorer.Series.is_nan/1","doc":"Returns a mask of infinite values.","ref":"Explorer.Series.html#is_nan/1"},{"type":"function","title":"Examples - Explorer.Series.is_nan/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_nan(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_nan/1-examples"},{"type":"function","title":"Explorer.Series.is_nil/1","doc":"Returns a mask of nil values.","ref":"Explorer.Series.html#is_nil/1"},{"type":"function","title":"Examples - Explorer.Series.is_nil/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.is_nil(s)\n #Explorer.Series","ref":"Explorer.Series.html#is_nil/1-examples"},{"type":"function","title":"Explorer.Series.is_not_nil/1","doc":"Returns a mask of not nil values.","ref":"Explorer.Series.html#is_not_nil/1"},{"type":"function","title":"Examples - Explorer.Series.is_not_nil/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.is_not_nil(s)\n #Explorer.Series","ref":"Explorer.Series.html#is_not_nil/1-examples"},{"type":"function","title":"Explorer.Series.last/1","doc":"Returns the last element of the series.","ref":"Explorer.Series.html#last/1"},{"type":"function","title":"Examples - Explorer.Series.last/1","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.last(s)\n 100","ref":"Explorer.Series.html#last/1-examples"},{"type":"function","title":"Explorer.Series.less/2","doc":"Returns boolean mask of `left < right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#less/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.less/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#less/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.less/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.less(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#less/2-examples"},{"type":"function","title":"Explorer.Series.less_equal/2","doc":"Returns boolean mask of `left <= right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#less_equal/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.less_equal/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#less_equal/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.less_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.less_equal(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#less_equal/2-examples"},{"type":"function","title":"Explorer.Series.log/1","doc":"Calculates the natural logarithm.\n\nThe resultant series is going to be of dtype `:float`.\nSee `log/2` for passing a custom base.","ref":"Explorer.Series.html#log/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.log/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#log/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.log/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, nil, 4])\n iex> Explorer.Series.log(s)\n #Explorer.Series","ref":"Explorer.Series.html#log/1-examples"},{"type":"function","title":"Explorer.Series.log/2","doc":"Calculates the logarithm on a given base.\n\nThe resultant series is going to be of dtype `:float`.","ref":"Explorer.Series.html#log/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.log/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#log/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.log/2","doc":"iex> s = Explorer.Series.from_list([8, 16, 32])\n iex> Explorer.Series.log(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#log/2-examples"},{"type":"function","title":"Explorer.Series.lstrip/1","doc":"Returns a string series where all leading Unicode whitespaces have been removed.","ref":"Explorer.Series.html#lstrip/1"},{"type":"function","title":"Examples - Explorer.Series.lstrip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd\"])\n iex> Explorer.Series.lstrip(s)\n #Explorer.Series","ref":"Explorer.Series.html#lstrip/1-examples"},{"type":"function","title":"Explorer.Series.lstrip/2","doc":"Returns a string series where all leading examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#lstrip/2"},{"type":"function","title":"Examples - Explorer.Series.lstrip/2","doc":"iex> s = Explorer.Series.from_list([\"$1\", \"$$200$$\", \"$$$3000$\"])\n iex> Explorer.Series.lstrip(s, \"$\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcda\"])\n iex> Explorer.Series.lstrip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#lstrip/2-examples"},{"type":"function","title":"Explorer.Series.mask/2","doc":"Filters a series with a mask.","ref":"Explorer.Series.html#mask/2"},{"type":"function","title":"Examples - Explorer.Series.mask/2","doc":"iex> s1 = Explorer.Series.from_list([1,2,3])\n iex> s2 = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.mask(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#mask/2-examples"},{"type":"function","title":"Explorer.Series.max/1","doc":"Gets the maximum value of the series.","ref":"Explorer.Series.html#max/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.max/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#max/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.max/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.max(s)\n 3\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.max(s)\n 3.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.max(s)\n ~D[2021-01-01]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.max(s)\n ~N[2021-01-01 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.max(s)\n ~T[00:05:04.000456]\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.max(s)\n ** (ArgumentError) Explorer.Series.max/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#max/1-examples"},{"type":"function","title":"Explorer.Series.mean/1","doc":"Gets the mean value of the series.","ref":"Explorer.Series.html#mean/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.mean/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#mean/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.mean/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.mean(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.mean(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.mean(s)\n ** (ArgumentError) Explorer.Series.mean/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#mean/1-examples"},{"type":"function","title":"Explorer.Series.median/1","doc":"Gets the median value of the series.","ref":"Explorer.Series.html#median/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.median/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#median/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.median/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.median(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.median(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.median(s)\n ** (ArgumentError) Explorer.Series.median/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#median/1-examples"},{"type":"function","title":"Explorer.Series.min/1","doc":"Gets the minimum value of the series.","ref":"Explorer.Series.html#min/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.min/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#min/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.min/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.min(s)\n 1\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.min(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.min(s)\n ~D[1999-12-31]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.min(s)\n ~N[1999-12-31 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000451], ~T[00:05:04.000134]])\n iex> Explorer.Series.min(s)\n ~T[00:02:03.000451]\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.min(s)\n ** (ArgumentError) Explorer.Series.min/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#min/1-examples"},{"type":"function","title":"Explorer.Series.minute/1","doc":"Returns the minute number from 0 to 59.","ref":"Explorer.Series.html#minute/1"},{"type":"function","title":"Examples - Explorer.Series.minute/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.minute(s)\n #Explorer.Series","ref":"Explorer.Series.html#minute/1-examples"},{"type":"function","title":"Explorer.Series.month/1","doc":"Returns the month number starting from 1. The return value ranges from 1 to 12.","ref":"Explorer.Series.html#month/1"},{"type":"function","title":"Examples - Explorer.Series.month/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-02-16], ~D[2023-03-20], nil])\n iex> Explorer.Series.month(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-02-16 23:59:59.999999], ~N[2023-03-20 12:00:00], nil])\n iex> Explorer.Series.month(s)\n #Explorer.Series","ref":"Explorer.Series.html#month/1-examples"},{"type":"function","title":"Explorer.Series.multiply/2","doc":"Multiplies left and right, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#multiply/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.multiply/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#multiply/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.multiply/2","doc":"iex> s1 = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> s2 = 11..20 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.multiply(s1, s2)\n #Explorer.Series \n\n iex> s1 = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.multiply(s1, 2)\n #Explorer.Series","ref":"Explorer.Series.html#multiply/2-examples"},{"type":"function","title":"Explorer.Series.n_distinct/1","doc":"Returns the number of unique values in the series.","ref":"Explorer.Series.html#n_distinct/1"},{"type":"function","title":"Examples - Explorer.Series.n_distinct/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"a\", \"b\"])\n iex> Explorer.Series.n_distinct(s)\n 2","ref":"Explorer.Series.html#n_distinct/1-examples"},{"type":"function","title":"Explorer.Series.nil_count/1","doc":"Counts the number of null elements in a series.","ref":"Explorer.Series.html#nil_count/1"},{"type":"function","title":"Examples - Explorer.Series.nil_count/1","doc":"iex> s = Explorer.Series.from_list([\"a\", nil, \"c\", nil, nil])\n iex> Explorer.Series.nil_count(s)\n 3","ref":"Explorer.Series.html#nil_count/1-examples"},{"type":"function","title":"Explorer.Series.not/1","doc":"Negate the elements of a boolean series.","ref":"Explorer.Series.html#not/1"},{"type":"function","title":"Examples - Explorer.Series.not/1","doc":"iex> s1 = Explorer.Series.from_list([true, false, false])\n iex> Explorer.Series.not(s1)\n #Explorer.Series","ref":"Explorer.Series.html#not/1-examples"},{"type":"function","title":"Explorer.Series.not_equal/2","doc":"Returns boolean mask of `left != right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#not_equal/2"},{"type":"function","title":"Examples - Explorer.Series.not_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.not_equal(s1, s2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.not_equal(s, 1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([true, true, false])\n iex> Explorer.Series.not_equal(s, true)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.not_equal(s, \"a\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.not_equal(s, ~D[1999-12-31])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])\n iex> Explorer.Series.not_equal(s, ~N[2022-01-01 00:00:00])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.not_equal(s, false)\n ** (ArgumentError) cannot invoke Explorer.Series.not_equal/2 with mismatched dtypes: :string and false","ref":"Explorer.Series.html#not_equal/2-examples"},{"type":"function","title":"Explorer.Series.or/2","doc":"Returns a boolean mask of `left or right`, element-wise.\n\nBoth sizes must be series, the series must have the same\nsize or at last one of them must have size of 1.","ref":"Explorer.Series.html#or/2"},{"type":"function","title":"Examples - Explorer.Series.or/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> mask1 = Explorer.Series.less(s1, 2)\n iex> mask2 = Explorer.Series.greater(s1, 2)\n iex> Explorer.Series.or(mask1, mask2)\n #Explorer.Series","ref":"Explorer.Series.html#or/2-examples"},{"type":"function","title":"Explorer.Series.peaks/2","doc":"Returns a boolean mask with `true` where the 'peaks' (series max or min, default max) are.","ref":"Explorer.Series.html#peaks/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.peaks/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#peaks/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.peaks/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 4, 1, 4])\n iex> Explorer.Series.peaks(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[13:24:56.000000], ~T[02:04:19.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.peaks(s)\n #Explorer.Series","ref":"Explorer.Series.html#peaks/2-examples"},{"type":"function","title":"Explorer.Series.pow/2","doc":"Raises a numeric series to the power of the exponent.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#pow/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.pow/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#pow/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.pow/2","doc":"iex> s = [8, 16, 32] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 2.0)\n #Explorer.Series \n\n iex> s = [2, 4, 6] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 3)\n #Explorer.Series \n\n iex> s = [2, 4, 6] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, -3.0)\n #Explorer.Series \n\n iex> s = [1.0, 2.0, 3.0] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 3.0)\n #Explorer.Series \n\n iex> s = [2.0, 4.0, 6.0] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#pow/2-examples"},{"type":"function","title":"Explorer.Series.product/1","doc":"Reduce this Series to the product value.","ref":"Explorer.Series.html#product/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.product/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#product/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.product/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.product(s)\n 6\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.product(s)\n ** (ArgumentError) Explorer.Series.product/1 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#product/1-examples"},{"type":"function","title":"Explorer.Series.qcut/3","doc":"Bins values into discrete values base on their quantiles.\n\nGiven a `quantiles` length of N, there will be N+1 categories. Each\nelement of `quantiles` is expected to be between 0.0 and 1.0.","ref":"Explorer.Series.html#qcut/3"},{"type":"function","title":"Options - Explorer.Series.qcut/3","doc":"* `:labels` - The labels assigned to the bins. Given `bins` of\n length N, `:labels` must be of length N+1. Defaults to the bin\n bounds (e.g. `(-inf -1.0]`, `(-1.0, 1.0]`, `(1.0, inf]`)\n\n * `:break_point_label` - The name given to the breakpoint column.\n Defaults to `break_point`.\n\n * `:category_label` - The name given to the category column.\n Defaults to `category`.","ref":"Explorer.Series.html#qcut/3-options"},{"type":"function","title":"Examples - Explorer.Series.qcut/3","doc":"iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0, 4.0, 5.0])\n iex> Explorer.Series.qcut(s, [0.25, 0.75])\n #Explorer.DataFrame","ref":"Explorer.Series.html#qcut/3-examples"},{"type":"function","title":"Explorer.Series.quantile/2","doc":"Gets the given quantile of the series.","ref":"Explorer.Series.html#quantile/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.quantile/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#quantile/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.quantile/2","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.quantile(s, 0.2)\n 1\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.quantile(s, 0.5)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~D[2021-01-01]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~N[2021-01-01 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[01:55:00], ~T[15:35:00], ~T[23:00:00]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~T[15:35:00]\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.quantile(s, 0.5)\n ** (ArgumentError) Explorer.Series.quantile/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#quantile/2-examples"},{"type":"function","title":"Explorer.Series.quotient/2","doc":"Element-wise integer division.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#quotient/2"},{"type":"function","title":"Supported dtype - Explorer.Series.quotient/2","doc":"* `:integer`\n\nReturns `nil` if there is a zero in the right-hand side.","ref":"Explorer.Series.html#quotient/2-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.quotient/2","doc":"iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 12, 15] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#quotient/2-examples"},{"type":"function","title":"Explorer.Series.rank/2","doc":"Assign ranks to data with appropriate handling of tied values.","ref":"Explorer.Series.html#rank/2"},{"type":"function","title":"Options - Explorer.Series.rank/2","doc":"* `:method` - Determine how ranks are assigned to tied elements. The following methods are available:\n - `\"average\"` : Each value receives the average rank that would be assigned to all tied values. (default)\n - `\"min\"` : Tied values are assigned the minimum rank. Also known as \"competition\" ranking.\n - `\"max\"` : Tied values are assigned the maximum of their ranks.\n - `\"dense\"` : Similar to `\"min\"`, but the rank of the next highest element is assigned the rank immediately after those assigned to the tied elements.\n - `\"ordinal\"` : Each value is given a distinct rank based on its occurrence in the series.\n - `\"random\"` : Similar to `\"ordinal\"`, but the rank for ties is not dependent on the order that the values occur in the Series.\n* `:descending` - Rank in descending order.\n* `:seed` - An integer to be used as a random seed. If nil, a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)","ref":"Explorer.Series.html#rank/2-options"},{"type":"function","title":"Examples - Explorer.Series.rank/2","doc":"iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.1, 2.4, 3.2])\n iex> Explorer.Series.rank(s, method: \"ordinal\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([ ~N[2022-07-07 17:44:13.020548], ~N[2022-07-07 17:43:08.473561], ~N[2022-07-07 17:45:00.116337] ])\n iex> Explorer.Series.rank(s, method: \"average\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"min\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"dense\")\n #Explorer.Series \n\n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"random\", seed: 42)\n #Explorer.Series","ref":"Explorer.Series.html#rank/2-examples"},{"type":"function","title":"Explorer.Series.remainder/2","doc":"Computes the remainder of an element-wise integer division.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#remainder/2"},{"type":"function","title":"Supported dtype - Explorer.Series.remainder/2","doc":"* `:integer`\n\nReturns `nil` if there is a zero in the right-hand side.","ref":"Explorer.Series.html#remainder/2-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.remainder/2","doc":"iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 9] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#remainder/2-examples"},{"type":"function","title":"Explorer.Series.replace/2","doc":"Replaces the contents of the given series by the one given in\na tensor or list.\n\nThe new series will have the same dtype and backend as the current\nseries, but the size may not necessarily match.","ref":"Explorer.Series.html#replace/2"},{"type":"function","title":"Tensor examples - Explorer.Series.replace/2","doc":"iex> s = Explorer.Series.from_list([0, 1, 2])\n iex> Explorer.Series.replace(s, Nx.tensor([1, 2, 3]))\n #Explorer.Series \n\nThis is particularly useful for categorical columns:\n\n iex> s = Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"], dtype: :category)\n iex> Explorer.Series.replace(s, Nx.tensor([2, 1, 0]))\n #Explorer.Series","ref":"Explorer.Series.html#replace/2-tensor-examples"},{"type":"function","title":"List examples - Explorer.Series.replace/2","doc":"Similar to tensors, we can also replace by lists:\n\n iex> s = Explorer.Series.from_list([0, 1, 2])\n iex> Explorer.Series.replace(s, [1, 2, 3, 4, 5])\n #Explorer.Series \n\nThe same considerations as above apply.","ref":"Explorer.Series.html#replace/2-list-examples"},{"type":"function","title":"Explorer.Series.reverse/1","doc":"Reverses the series order.","ref":"Explorer.Series.html#reverse/1"},{"type":"function","title":"Example - Explorer.Series.reverse/1","doc":"iex> s = [1, 2, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.reverse(s)\n #Explorer.Series","ref":"Explorer.Series.html#reverse/1-example"},{"type":"function","title":"Explorer.Series.round/2","doc":"Round floating point series to given decimal places.","ref":"Explorer.Series.html#round/2"},{"type":"function","title":"Examples - Explorer.Series.round/2","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.round(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#round/2-examples"},{"type":"function","title":"Explorer.Series.rstrip/1","doc":"Returns a string series where all trailing Unicode whitespaces have been removed.","ref":"Explorer.Series.html#rstrip/1"},{"type":"function","title":"Examples - Explorer.Series.rstrip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd\"])\n iex> Explorer.Series.rstrip(s)\n #Explorer.Series","ref":"Explorer.Series.html#rstrip/1-examples"},{"type":"function","title":"Explorer.Series.rstrip/2","doc":"Returns a string series where all trailing examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#rstrip/2"},{"type":"function","title":"Examples - Explorer.Series.rstrip/2","doc":"iex> s = Explorer.Series.from_list([\"__abc__\", \"def_\", \"__bcd_\"])\n iex> Explorer.Series.rstrip(s, \"_\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcdabaaa\"])\n iex> Explorer.Series.rstrip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#rstrip/2-examples"},{"type":"function","title":"Explorer.Series.sample/3","doc":"Returns a random sample of the series.\n\nIf given an integer as the second argument, it will return N samples. If given a float, it will\nreturn that proportion of the series.\n\nCan sample with or without replace.","ref":"Explorer.Series.html#sample/3"},{"type":"function","title":"Options - Explorer.Series.sample/3","doc":"* `:replace` - If set to `true`, each sample will be independent and therefore values may repeat.\n Required to be `true` for `n` greater then the number of rows in the series or `frac` > 1.0. (default: `false`)\n * `:seed` - An integer to be used as a random seed. If nil, a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)\n * `:shuffle` - In case the sample is equal to the size of the series, shuffle tells if the resultant\n series should be shuffled or if it should return the same series. (default: `false`).","ref":"Explorer.Series.html#sample/3-options"},{"type":"function","title":"Examples - Explorer.Series.sample/3","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 10, seed: 100)\n #Explorer.Series \n\n iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 0.05, seed: 100)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 7, seed: 100, replace: true)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.2, seed: 100, replace: true)\n #Explorer.Series \n\n iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: false)\n #Explorer.Series \n\n iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: true)\n #Explorer.Series","ref":"Explorer.Series.html#sample/3-examples"},{"type":"function","title":"Explorer.Series.second/1","doc":"Returns the second number from 0 to 59.","ref":"Explorer.Series.html#second/1"},{"type":"function","title":"Examples - Explorer.Series.second/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.second(s)\n #Explorer.Series","ref":"Explorer.Series.html#second/1-examples"},{"type":"function","title":"Explorer.Series.select/3","doc":"Returns a series from two series, based on a predicate.\n\nThe resulting series is built by evaluating each element of\n`predicate` and returning either the corresponding element from\n`on_true` or `on_false`.\n\n`predicate` must be a boolean series. `on_true` and `on_false` must be\na series of the same size as `predicate` or a series of size 1.","ref":"Explorer.Series.html#select/3"},{"type":"function","title":"Explorer.Series.shift/2","doc":"Shifts `series` by `offset` with `nil` values.\n\nPositive offset shifts from first, negative offset shifts from last.","ref":"Explorer.Series.html#shift/2"},{"type":"function","title":"Examples - Explorer.Series.shift/2","doc":"iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shift(s, 2)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shift(s, -2)\n #Explorer.Series","ref":"Explorer.Series.html#shift/2-examples"},{"type":"function","title":"Explorer.Series.shuffle/2","doc":"Change the elements order randomly.","ref":"Explorer.Series.html#shuffle/2"},{"type":"function","title":"Options - Explorer.Series.shuffle/2","doc":"* `:seed` - An integer to be used as a random seed. If nil,\n a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)","ref":"Explorer.Series.html#shuffle/2-options"},{"type":"function","title":"Examples - Explorer.Series.shuffle/2","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shuffle(s, seed: 100)\n #Explorer.Series","ref":"Explorer.Series.html#shuffle/2-examples"},{"type":"function","title":"Explorer.Series.sin/1","doc":"Computes the the sine of a number (in radians).\nThe resultant series is going to be of dtype `:float`, with values between 1 and -1.","ref":"Explorer.Series.html#sin/1"},{"type":"function","title":"Supported dtype - Explorer.Series.sin/1","doc":"* `:float`","ref":"Explorer.Series.html#sin/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.sin/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.sin(s)\n #Explorer.Series","ref":"Explorer.Series.html#sin/1-examples"},{"type":"function","title":"Explorer.Series.size/1","doc":"Returns the size of the series.\n\nThis is not allowed inside a lazy series. Use `count/1` instead.","ref":"Explorer.Series.html#size/1"},{"type":"function","title":"Examples - Explorer.Series.size/1","doc":"iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])\n iex> Explorer.Series.size(s)\n 2","ref":"Explorer.Series.html#size/1-examples"},{"type":"function","title":"Explorer.Series.skew/2","doc":"Compute the sample skewness of a series.\n\nFor normally distributed data, the skewness should be about zero.\n\nFor unimodal continuous distributions, a skewness value greater\nthan zero means that there is more weight in the right tail of the\ndistribution.","ref":"Explorer.Series.html#skew/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.skew/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#skew/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.skew/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])\n iex> Explorer.Series.skew(s)\n 1.6727687946848508\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])\n iex> Explorer.Series.skew(s, bias: false)\n 2.2905330058490514\n\n iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])\n iex> Explorer.Series.skew(s, bias: false)\n 0.8545630383279712\n\n iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])\n iex> Explorer.Series.skew(s)\n 0.49338220021815865\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.skew(s, false)\n ** (ArgumentError) Explorer.Series.skew/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#skew/2-examples"},{"type":"function","title":"Explorer.Series.slice/2","doc":"Slices the elements at the given indices as a new series.\n\nThe indices may be either a list of indices or a range.\nA list of indices does not support negative numbers.\nRanges may be negative on either end, which are then\nnormalized. Note ranges in Elixir are inclusive.","ref":"Explorer.Series.html#slice/2"},{"type":"function","title":"Examples - Explorer.Series.slice/2","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, [0, 2])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, 1..2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, -2..-1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, 3..2//1)\n #Explorer.Series","ref":"Explorer.Series.html#slice/2-examples"},{"type":"function","title":"Explorer.Series.slice/3","doc":"Returns a slice of the series, with `size` elements starting at `offset`.","ref":"Explorer.Series.html#slice/3"},{"type":"function","title":"Examples - Explorer.Series.slice/3","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, 1, 2)\n #Explorer.Series \n\nNegative offsets count from the end of the series:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, -3, 2)\n #Explorer.Series \n\nIf the offset runs past the end of the series,\nthe series is empty:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, 10, 3)\n #Explorer.Series \n\nIf the size runs past the end of the series,\nthe result may be shorter than the size:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, -3, 4)\n #Explorer.Series","ref":"Explorer.Series.html#slice/3-examples"},{"type":"function","title":"Explorer.Series.sort/2","doc":"Sorts the series.\n\nSorting is stable by default.","ref":"Explorer.Series.html#sort/2"},{"type":"function","title":"Options - Explorer.Series.sort/2","doc":"* `:direction` - `:asc` or `:desc`, meaning \"ascending\" or \"descending\", respectively.\n By default it sorts in ascending order.\n\n * `:nils` - `:first` or `:last`. By default it is `:last` if direction is `:asc`, and\n `:first` otherwise.","ref":"Explorer.Series.html#sort/2-options"},{"type":"function","title":"Examples - Explorer.Series.sort/2","doc":"iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.sort(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.sort(s, direction: :desc)\n #Explorer.Series","ref":"Explorer.Series.html#sort/2-examples"},{"type":"function","title":"Explorer.Series.standard_deviation/1","doc":"Gets the standard deviation of the series.","ref":"Explorer.Series.html#standard_deviation/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.standard_deviation/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#standard_deviation/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.standard_deviation/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.standard_deviation(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.standard_deviation(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.standard_deviation(s)\n ** (ArgumentError) Explorer.Series.standard_deviation/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#standard_deviation/1-examples"},{"type":"function","title":"Explorer.Series.strftime/2","doc":"Converts a datetime series to a string series.\n\nFor the format string specification, refer to the\n[chrono crate documentation](https://docs.rs/chrono/latest/chrono/format/strftime/index.html).\n\nUse `cast(series, :string)` for the default `\"%Y-%m-%d %H:%M:%S%.6f\"` format.","ref":"Explorer.Series.html#strftime/2"},{"type":"function","title":"Examples - Explorer.Series.strftime/2","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-05 12:34:56], nil])\n iex> Explorer.Series.strftime(s, \"%Y/%m/%d %H:%M:%S\")\n #Explorer.Series","ref":"Explorer.Series.html#strftime/2-examples"},{"type":"function","title":"Explorer.Series.strip/1","doc":"Returns a string series where all leading and trailing Unicode whitespaces\nhave been removed.","ref":"Explorer.Series.html#strip/1"},{"type":"function","title":"Examples - Explorer.Series.strip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd \"])\n iex> Explorer.Series.strip(s)\n #Explorer.Series","ref":"Explorer.Series.html#strip/1-examples"},{"type":"function","title":"Explorer.Series.strip/2","doc":"Returns a string series where all leading and trailing examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#strip/2"},{"type":"function","title":"Examples - Explorer.Series.strip/2","doc":"iex> s = Explorer.Series.from_list([\"Ā£123\", \"1.00Ā£\", \"Ā£1.00Ā£\"])\n iex> Explorer.Series.strip(s, \"Ā£\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcda\"])\n iex> Explorer.Series.strip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#strip/2-examples"},{"type":"function","title":"Explorer.Series.strptime/2","doc":"Converts a string series to a datetime series with a given `format_string`.\n\nFor the format string specification, refer to the\n[chrono crate documentation](https://docs.rs/chrono/latest/chrono/format/strftime/).\n\nUse `cast(series, :datetime)` if you prefer the format to be inferred (if possible).","ref":"Explorer.Series.html#strptime/2"},{"type":"function","title":"Examples - Explorer.Series.strptime/2","doc":"iex> s = Explorer.Series.from_list([\"2023-01-05 12:34:56\", \"XYZ\", nil])\n iex> Explorer.Series.strptime(s, \"%Y-%m-%d %H:%M:%S\")\n #Explorer.Series","ref":"Explorer.Series.html#strptime/2-examples"},{"type":"function","title":"Explorer.Series.substring/2","doc":"Returns a string sliced from the offset to the end of the string, supporting\nnegative indexing","ref":"Explorer.Series.html#substring/2"},{"type":"function","title":"Examples - Explorer.Series.substring/2","doc":"iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, -3)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, 1)\n #Explorer.Series","ref":"Explorer.Series.html#substring/2-examples"},{"type":"function","title":"Explorer.Series.substring/3","doc":"Returns a string sliced from the offset to the length provided, supporting\nnegative indexing","ref":"Explorer.Series.html#substring/3"},{"type":"function","title":"Examples - Explorer.Series.substring/3","doc":"iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, -3, 2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, 1, 5)\n #Explorer.Series \n\n iex> d = Explorer.Series.from_list([\"恓悓恫恔ćÆäø–ē•Œ\", \"Ł…Ų±Ų­ŲØŁ‹Ų§\", \"ģ•ˆė…•ķ•˜ģ„øģš”\"])\n iex> Explorer.Series.substring(d, 1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#substring/3-examples"},{"type":"function","title":"Explorer.Series.subtract/2","doc":"Subtracts right from left, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#subtract/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.subtract/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#subtract/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.subtract/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.subtract(s1, s2)\n #Explorer.Series \n\nYou can also use scalar values on both sides:\n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.subtract(s1, 2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.subtract(2, s1)\n #Explorer.Series","ref":"Explorer.Series.html#subtract/2-examples"},{"type":"function","title":"Explorer.Series.sum/1","doc":"Gets the sum of the series.","ref":"Explorer.Series.html#sum/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.sum/1","doc":"* `:integer`\n * `:float`\n * `:boolean`","ref":"Explorer.Series.html#sum/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.sum/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.sum(s)\n 6\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.sum(s)\n 6.0\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.sum(s)\n 2\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.sum(s)\n ** (ArgumentError) Explorer.Series.sum/1 not implemented for dtype :date. Valid dtypes are [:integer, :float, :boolean]","ref":"Explorer.Series.html#sum/1-examples"},{"type":"function","title":"Explorer.Series.tail/2","doc":"Returns the last N elements of the series.","ref":"Explorer.Series.html#tail/2"},{"type":"function","title":"Examples - Explorer.Series.tail/2","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.tail(s)\n #Explorer.Series","ref":"Explorer.Series.html#tail/2-examples"},{"type":"function","title":"Explorer.Series.tan/1","doc":"Computes the tangent of a number (in radians).\nThe resultant series is going to be of dtype `:float`.","ref":"Explorer.Series.html#tan/1"},{"type":"function","title":"Supported dtype - Explorer.Series.tan/1","doc":"* `:float`","ref":"Explorer.Series.html#tan/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.tan/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.tan(s)\n #Explorer.Series","ref":"Explorer.Series.html#tan/1-examples"},{"type":"function","title":"Explorer.Series.to_binary/1","doc":"Returns a series as a fixed-width binary.\n\nThis is a shortcut around `to_iovec/1`. If possible, prefer\nto use `to_iovec/1` as that avoids copying binaries.","ref":"Explorer.Series.html#to_binary/1"},{"type":"function","title":"Examples - Explorer.Series.to_binary/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_binary(series)\n >\n\n iex> series = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_binary(series)\n >","ref":"Explorer.Series.html#to_binary/1-examples"},{"type":"function","title":"Explorer.Series.to_date/1","doc":"","ref":"Explorer.Series.html#to_date/1"},{"type":"function","title":"Explorer.Series.to_enum/1","doc":"Converts a series to an enumerable.\n\nThe enumerable will lazily traverse the series.\n\n> ##","ref":"Explorer.Series.html#to_enum/1"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_enum/1","doc":">\n> You must avoid converting a series to enum, as that will copy the whole\n> series in memory as you traverse it. Prefer to use the operations in this\n> module rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.Series.html#to_enum/1-warning-warning"},{"type":"function","title":"Examples - Explorer.Series.to_enum/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> series |> Explorer.Series.to_enum() |> Enum.to_list()\n [1, 2, 3]","ref":"Explorer.Series.html#to_enum/1-examples"},{"type":"function","title":"Explorer.Series.to_iovec/1","doc":"Returns a series as a list of fixed-width binaries.\n\nAn io vector (`iovec`) is the Erlang VM term for a flat list of binaries.\nThis is typically a reference to the in-memory representation of the series.\nIf the whole series in contiguous in memory, then the list will have a single\nelement. All binaries are in native endianness.\n\nThis operation fails if the series has `nil` values.\nUse `fill_missing/1` to handle them accordingly.\n\nTo retrieve the type of the underlying io vector, use `iotype/1`.\nTo convert an iovec to a binary, you can use `IO.iodata_to_binary/1`.","ref":"Explorer.Series.html#to_iovec/1"},{"type":"function","title":"Examples - Explorer.Series.to_iovec/1","doc":"Integers and floats follow their native encoding:\n\n iex> series = Explorer.Series.from_list([-1, 0, 1])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\n iex> series = Explorer.Series.from_list([1.0, 2.0, 3.0])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nBooleans are encoded as 0 and 1:\n\n iex> series = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nDates are encoded as i32 representing days from the Unix epoch (1970-01-01):\n\n iex> series = Explorer.Series.from_list([~D[0001-01-01], ~D[1970-01-01], ~D[1986-10-13]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nTimes are encoded as i64 representing nanoseconds from midnight:\n\n iex> series = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nDatetimes are encoded as i64 representing their precision from the Unix epoch (1970-01-01):\n\n iex> series = Explorer.Series.from_list([~N[0001-01-01 00:00:00], ~N[1970-01-01 00:00:00], ~N[1986-10-13 01:23:45.987654]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nThe operation raises for binaries and strings, as they do not provide a fixed-width\nbinary representation:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"b\"])\n iex> Explorer.Series.to_iovec(s)\n ** (ArgumentError) cannot convert series of dtype :string into iovec\n\nHowever, if appropriate, you can convert them to categorical types,\nwhich will then return the index of each category:\n\n iex> series = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"b\"], dtype: :category)\n iex> Explorer.Series.to_iovec(series)\n [ >]","ref":"Explorer.Series.html#to_iovec/1-examples"},{"type":"function","title":"Explorer.Series.to_list/1","doc":"Converts a series to a list.\n\n> ##","ref":"Explorer.Series.html#to_list/1"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_list/1","doc":">\n> You must avoid converting a series to list, as that requires copying\n> the whole series in memory. Prefer to use the operations in this module\n> rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.Series.html#to_list/1-warning-warning"},{"type":"function","title":"Examples - Explorer.Series.to_list/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_list(series)\n [1, 2, 3]","ref":"Explorer.Series.html#to_list/1-examples"},{"type":"function","title":"Explorer.Series.to_tensor/2","doc":"Converts a series to a `t:Nx.Tensor.t/0`.\n\nNote that `Explorer.Series` are automatically converted\nto tensors when passed to numerical definitions.\nThe tensor type is given by `iotype/1`.\n\n> ##","ref":"Explorer.Series.html#to_tensor/2"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_tensor/2","doc":">\n> `Nx` is an optional dependency. You will need to ensure it's installed to use this function.","ref":"Explorer.Series.html#to_tensor/2-warning-warning"},{"type":"function","title":"Options - Explorer.Series.to_tensor/2","doc":"* `:backend` - the Nx backend to allocate the tensor on","ref":"Explorer.Series.html#to_tensor/2-options"},{"type":"function","title":"Examples - Explorer.Series.to_tensor/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_tensor(s)\n #Nx.Tensor \n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_tensor(s)\n #Nx.Tensor","ref":"Explorer.Series.html#to_tensor/2-examples"},{"type":"function","title":"Explorer.Series.to_time/1","doc":"","ref":"Explorer.Series.html#to_time/1"},{"type":"function","title":"Explorer.Series.transform/2","doc":"Returns an `Explorer.Series` where each element is the result of invoking `fun` on each\ncorresponding element of `series`.\n\nThis is an expensive operation meant to enable the use of arbitrary Elixir functions against\nany backend. The implementation will vary by backend but in most (all?) cases will require\nconverting to an `Elixir.List`, applying `Enum.map/2`, and then converting back to an\n`Explorer.Series`.","ref":"Explorer.Series.html#transform/2"},{"type":"function","title":"Examples - Explorer.Series.transform/2","doc":"iex> s = Explorer.Series.from_list([\"this \", \" is\", \"great \"])\n iex> Explorer.Series.transform(s, &String.trim/1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"this\", \"is\", \"great\"])\n iex> Explorer.Series.transform(s, &String.length/1)\n #Explorer.Series","ref":"Explorer.Series.html#transform/2-examples"},{"type":"function","title":"Explorer.Series.unordered_distinct/1","doc":"Returns the unique values of the series, but does not maintain order.\n\nFaster than `distinct/1`.","ref":"Explorer.Series.html#unordered_distinct/1"},{"type":"function","title":"Examples - Explorer.Series.unordered_distinct/1","doc":"iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.unordered_distinct(s)","ref":"Explorer.Series.html#unordered_distinct/1-examples"},{"type":"function","title":"Explorer.Series.upcase/1","doc":"Converts all characters to uppercase.","ref":"Explorer.Series.html#upcase/1"},{"type":"function","title":"Examples - Explorer.Series.upcase/1","doc":"iex> s = Explorer.Series.from_list([\"abc\", \"def\", \"bcd\"])\n iex> Explorer.Series.upcase(s)\n #Explorer.Series","ref":"Explorer.Series.html#upcase/1-examples"},{"type":"function","title":"Explorer.Series.variance/1","doc":"Gets the variance of the series.","ref":"Explorer.Series.html#variance/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.variance/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#variance/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.variance/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.variance(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.variance(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.variance(s)\n ** (ArgumentError) Explorer.Series.variance/1 not implemented for dtype {:datetime, :microsecond}. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#variance/1-examples"},{"type":"function","title":"Explorer.Series.window_max/3","doc":"Calculate the rolling max, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_max/3"},{"type":"function","title":"Options - Explorer.Series.window_max/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_max/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_max/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_max(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_max(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_max/3-examples"},{"type":"function","title":"Explorer.Series.window_mean/3","doc":"Calculate the rolling mean, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_mean/3"},{"type":"function","title":"Options - Explorer.Series.window_mean/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_mean/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_mean/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75])\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75], min_periods: nil)\n #Explorer.Series","ref":"Explorer.Series.html#window_mean/3-examples"},{"type":"function","title":"Explorer.Series.window_median/3","doc":"Calculate the rolling median, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_median/3"},{"type":"function","title":"Options - Explorer.Series.window_median/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_median/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_median/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75])\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75], min_periods: nil)\n #Explorer.Series","ref":"Explorer.Series.html#window_median/3-examples"},{"type":"function","title":"Explorer.Series.window_min/3","doc":"Calculate the rolling min, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_min/3"},{"type":"function","title":"Options - Explorer.Series.window_min/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_min/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_min/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_min(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_min(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_min/3-examples"},{"type":"function","title":"Explorer.Series.window_standard_deviation/3","doc":"Calculate the rolling standard deviation, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_standard_deviation/3"},{"type":"function","title":"Options - Explorer.Series.window_standard_deviation/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_standard_deviation/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_standard_deviation/3","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 1])\n iex> Explorer.Series.window_standard_deviation(s, 2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 6])\n iex> Explorer.Series.window_standard_deviation(s, 2, weights: [0.25, 0.75])\n #Explorer.Series","ref":"Explorer.Series.html#window_standard_deviation/3-examples"},{"type":"function","title":"Explorer.Series.window_sum/3","doc":"Calculate the rolling sum, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_sum/3"},{"type":"function","title":"Options - Explorer.Series.window_sum/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_sum/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_sum/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_sum(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_sum(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_sum/3-examples"},{"type":"function","title":"Explorer.Series.year/1","doc":"Returns the year number in the calendar date.","ref":"Explorer.Series.html#year/1"},{"type":"function","title":"Examples - Explorer.Series.year/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2022-02-16], ~D[2021-03-20], nil])\n iex> Explorer.Series.year(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.year(s)\n #Explorer.Series","ref":"Explorer.Series.html#year/1-examples"},{"type":"type","title":"Explorer.Series.datetime_dtype/0","doc":"","ref":"Explorer.Series.html#t:datetime_dtype/0"},{"type":"type","title":"Explorer.Series.dtype/0","doc":"","ref":"Explorer.Series.html#t:dtype/0"},{"type":"type","title":"Explorer.Series.inferable_scalar/0","doc":"","ref":"Explorer.Series.html#t:inferable_scalar/0"},{"type":"type","title":"Explorer.Series.lazy_t/0","doc":"","ref":"Explorer.Series.html#t:lazy_t/0"},{"type":"type","title":"Explorer.Series.non_finite/0","doc":"","ref":"Explorer.Series.html#t:non_finite/0"},{"type":"type","title":"Explorer.Series.t/0","doc":"","ref":"Explorer.Series.html#t:t/0"},{"type":"module","title":"Explorer.TensorFrame","doc":"TensorFrame is a representation of `Explorer.DataFrame`\nthat is designed to work inside Nx's `defn` expressions.\n\nFor example, imagine the following `defn`:\n\n defn add_columns(tf) do\n tf[:a] + tf[:b]\n end\n\nWe can now pass a DataFrame as argument:\n\n iex> add_columns(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\nPassing an `Explorer.DataFrame` to a `defn` will automatically\nconvert it to a TensorFrame. The TensorFrame will lazily\nbuild tensors out of the used dataframe fields.","ref":"Explorer.TensorFrame.html"},{"type":"module","title":"Stack and concatenating - Explorer.TensorFrame","doc":"Due to the integration with Nx, you can also pass dataframes\ninto `Nx.stack/2` and `Nx.concatenate` and they will be automatically\nconverted to tensors. This makes it easy to pass dataframes into\nneural networks and other computationally intensive algorithms:\n\n iex> Nx.concatenate(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\n iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\n iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]), axis: -1)\n #Nx.Tensor","ref":"Explorer.TensorFrame.html#module-stack-and-concatenating"},{"type":"module","title":"Warning: returning TensorFrames - Explorer.TensorFrame","doc":"It is not recommended to return a TensorFrame from a `defn`,\nas that would force all columns to be sent to the CPU/GPU\nand then copied back. Return only the columns that have been\nmodified during the computation. For example, in the example\nabove we used `Nx` to add two columns, if you want to\nput the result of the computation back into a DataFrame,\nyou can use `Explorer.DataFrame.put/4`, which also accepts\ntensors:\n\n iex> df = Explorer.DataFrame.new(a: [11, 12], b: [21, 22])\n iex> Explorer.DataFrame.put(df, \"result\", add_columns(df))\n #Explorer.DataFrame \n\nOne benefit of using `Explorer.DataFrame.put/4` is that it will\npreserve the type of the column if one already exists. Alternatively,\nuse `Explorer.Series.from_tensor/1` to explicitly convert a tensor\nback to a series.","ref":"Explorer.TensorFrame.html#module-warning-returning-tensorframes"},{"type":"module","title":"Supported dtypes - Explorer.TensorFrame","doc":"The following dtypes can be converted to tensors:\n\n * `:integer`\n * `:float`\n * `:boolean`\n * `:date`\n * `{:datetime, :millisecond}`\n * `{:datetime, :microsecond}`\n * `{:datetime, :nanosecond}`\n\nSee `Explorer.Series.to_iovec/1` and `Explorer.Series.to_tensor/1`\nto learn more about their internal representation.","ref":"Explorer.TensorFrame.html#module-supported-dtypes"},{"type":"function","title":"Explorer.TensorFrame.pull/2","doc":"Pulls a tensor from the TensorFrame.\n\nThis is equivalent to using the `tf[name]` to access\na tensor.","ref":"Explorer.TensorFrame.html#pull/2"},{"type":"function","title":"Examples - Explorer.TensorFrame.pull/2","doc":"Explorer.TensorFrame.pull(tf, \"some_column\")","ref":"Explorer.TensorFrame.html#pull/2-examples"},{"type":"function","title":"Explorer.TensorFrame.put/3","doc":"Puts a tensor in the TensorFrame.\n\nThis function can be invoked from within `defn`.","ref":"Explorer.TensorFrame.html#put/3"},{"type":"function","title":"Examples - Explorer.TensorFrame.put/3","doc":"Explorer.TensorFrame.put(tf, \"result\", some_tensor)","ref":"Explorer.TensorFrame.html#put/3-examples"},{"type":"type","title":"Explorer.TensorFrame.t/0","doc":"","ref":"Explorer.TensorFrame.html#t:t/0"},{"type":"module","title":"FSS","doc":"A small abstraction for filesystems.","ref":"FSS.html"},{"type":"module","title":"FSS.HTTP","doc":"","ref":"FSS.HTTP.html"},{"type":"function","title":"FSS.HTTP.parse/2","doc":"","ref":"FSS.HTTP.html#parse/2"},{"type":"module","title":"FSS.HTTP.Config","doc":"","ref":"FSS.HTTP.Config.html"},{"type":"type","title":"FSS.HTTP.Config.t/0","doc":"","ref":"FSS.HTTP.Config.html#t:t/0"},{"type":"module","title":"FSS.HTTP.Entry","doc":"","ref":"FSS.HTTP.Entry.html"},{"type":"type","title":"FSS.HTTP.Entry.t/0","doc":"","ref":"FSS.HTTP.Entry.html#t:t/0"},{"type":"module","title":"FSS.Local","doc":"","ref":"FSS.Local.html"},{"type":"module","title":"FSS.Local.Entry","doc":"","ref":"FSS.Local.Entry.html"},{"type":"type","title":"FSS.Local.Entry.t/0","doc":"","ref":"FSS.Local.Entry.html#t:t/0"},{"type":"module","title":"FSS.S3","doc":"","ref":"FSS.S3.html"},{"type":"function","title":"FSS.S3.config_from_system_env/0","doc":"","ref":"FSS.S3.html#config_from_system_env/0"},{"type":"module","title":"FSS.S3.Config","doc":"","ref":"FSS.S3.Config.html"},{"type":"type","title":"FSS.S3.Config.t/0","doc":"","ref":"FSS.S3.Config.html#t:t/0"},{"type":"module","title":"FSS.S3.Entry","doc":"","ref":"FSS.S3.Entry.html"},{"type":"function","title":"FSS.S3.Entry.check!/3","doc":"","ref":"FSS.S3.Entry.html#check!/3"},{"type":"function","title":"FSS.S3.Entry.parse/2","doc":"","ref":"FSS.S3.Entry.html#parse/2"},{"type":"type","title":"FSS.S3.Entry.t/0","doc":"","ref":"FSS.S3.Entry.html#t:t/0"},{"type":"module","title":"Explorer.Backend","doc":"The behaviour for Explorer backends and associated functions.\n\nEach backend is a module with `DataFrame` and `Series` submodules that match the \nrespective behaviours for each.\n\nThe default backend is read from the application environment. Currently, the only \nbackend is an in-memory, eager one based on\n[`Polars`](https://github.com/pola-rs/polars). When alternatives are\navailable, you can use them by configuring your runtime:\n\n # config/runtime.exs\n import Config\n config :explorer, default_backend: Lib.CustomBackend","ref":"Explorer.Backend.html"},{"type":"function","title":"Explorer.Backend.get/0","doc":"Gets the default backend for the current process.","ref":"Explorer.Backend.html#get/0"},{"type":"function","title":"Explorer.Backend.put/1","doc":"Sets the current process default backend to `backend`.\n\nThe default backend is stored only in the process dictionary. This means if\nyou start a separate process, such as `Task`, the default backend must be set\non the new process too.","ref":"Explorer.Backend.html#put/1"},{"type":"function","title":"Examples - Explorer.Backend.put/1","doc":"iex> Explorer.Backend.put(Lib.CustomBackend)\n Explorer.PolarsBackend\n iex> Explorer.Backend.get()\n Lib.CustomBackend","ref":"Explorer.Backend.html#put/1-examples"},{"type":"behaviour","title":"Explorer.Backend.DataFrame","doc":"The behaviour for DataFrame backends.","ref":"Explorer.Backend.DataFrame.html"},{"type":"callback","title":"Explorer.Backend.DataFrame.arrange_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:arrange_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.collect/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:collect/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.concat_columns/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:concat_columns/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.concat_rows/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:concat_rows/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.describe/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:describe/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.distinct/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:distinct/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.drop_nil/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:drop_nil/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dummies/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dummies/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_csv/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_csv/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ndjson/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ndjson/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_parquet/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_parquet/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.filter_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:filter_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_csv/12","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_csv/12"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ndjson/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ndjson/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_parquet/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_parquet/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_query/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_query/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_series/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_series/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_tabular/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_tabular/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.head/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:head/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.inspect/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:inspect/2"},{"type":"function","title":"Explorer.Backend.DataFrame.inspect/5","doc":"Default inspect implementation for backends.","ref":"Explorer.Backend.DataFrame.html#inspect/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.join/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:join/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.lazy/0","doc":"","ref":"Explorer.Backend.DataFrame.html#c:lazy/0"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_csv/12","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_csv/12"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ndjson/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ndjson/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_parquet/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_parquet/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.mask/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:mask/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.mutate_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:mutate_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.n_rows/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:n_rows/1"},{"type":"function","title":"Explorer.Backend.DataFrame.new/3","doc":"Creates a new DataFrame for a given backend.","ref":"Explorer.Backend.DataFrame.html#new/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.nil_count/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:nil_count/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.pivot_longer/6","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pivot_longer/6"},{"type":"callback","title":"Explorer.Backend.DataFrame.pivot_wider/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pivot_wider/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.pull/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pull/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.put/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:put/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.rename/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:rename/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.sample/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:sample/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.select/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:select/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.slice/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:slice/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.slice/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:slice/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.summarise_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:summarise_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.tail/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:tail/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_csv/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_csv/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ipc/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ipc/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ipc_stream/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ipc_stream/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_lazy/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_lazy/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ndjson/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ndjson/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_parquet/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_parquet/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_rows/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_rows/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_rows_stream/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_rows_stream/3"},{"type":"type","title":"Explorer.Backend.DataFrame.basic_types/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:basic_types/0"},{"type":"type","title":"Explorer.Backend.DataFrame.column_name/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:column_name/0"},{"type":"type","title":"Explorer.Backend.DataFrame.columns_for_io/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:columns_for_io/0"},{"type":"type","title":"Explorer.Backend.DataFrame.compression/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:compression/0"},{"type":"type","title":"Explorer.Backend.DataFrame.df/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:df/0"},{"type":"type","title":"Explorer.Backend.DataFrame.dtype/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:dtype/0"},{"type":"type","title":"Explorer.Backend.DataFrame.dtypes/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:dtypes/0"},{"type":"type","title":"Explorer.Backend.DataFrame.fs_entry/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:fs_entry/0"},{"type":"type","title":"Explorer.Backend.DataFrame.lazy_frame/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:lazy_frame/0"},{"type":"type","title":"Explorer.Backend.DataFrame.lazy_series/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:lazy_series/0"},{"type":"type","title":"Explorer.Backend.DataFrame.mutate_value/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:mutate_value/0"},{"type":"type","title":"Explorer.Backend.DataFrame.ok_result/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:ok_result/0"},{"type":"type","title":"Explorer.Backend.DataFrame.option/1","doc":"","ref":"Explorer.Backend.DataFrame.html#t:option/1"},{"type":"type","title":"Explorer.Backend.DataFrame.result/1","doc":"","ref":"Explorer.Backend.DataFrame.html#t:result/1"},{"type":"type","title":"Explorer.Backend.DataFrame.series/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:series/0"},{"type":"type","title":"Explorer.Backend.DataFrame.t/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:t/0"},{"type":"module","title":"Explorer.Backend.LazyFrame","doc":"Represents a lazy dataframe for building query expressions.\n\nThe LazyFrame is available inside `filter_with`, `mutate_with`, and\nsimilar. You cannot perform any operation on them except accessing\nits underlying series.","ref":"Explorer.Backend.LazyFrame.html"},{"type":"type","title":"Explorer.Backend.LazyFrame.t/0","doc":"","ref":"Explorer.Backend.LazyFrame.html#t:t/0"},{"type":"module","title":"Explorer.Backend.LazySeries","doc":"This is an opaque implementation of a Series.\n\nIt represents an operation with its arguments.","ref":"Explorer.Backend.LazySeries.html"},{"type":"type","title":"Explorer.Backend.LazySeries.t/0","doc":"","ref":"Explorer.Backend.LazySeries.html#t:t/0"},{"type":"behaviour","title":"Explorer.Backend.Series","doc":"The behaviour for series backends.","ref":"Explorer.Backend.Series.html"},{"type":"callback","title":"Explorer.Backend.Series.abs/1","doc":"","ref":"Explorer.Backend.Series.html#c:abs/1"},{"type":"callback","title":"Explorer.Backend.Series.acos/1","doc":"","ref":"Explorer.Backend.Series.html#c:acos/1"},{"type":"callback","title":"Explorer.Backend.Series.add/2","doc":"","ref":"Explorer.Backend.Series.html#c:add/2"},{"type":"callback","title":"Explorer.Backend.Series.all_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:all_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.argmax/1","doc":"","ref":"Explorer.Backend.Series.html#c:argmax/1"},{"type":"callback","title":"Explorer.Backend.Series.argmin/1","doc":"","ref":"Explorer.Backend.Series.html#c:argmin/1"},{"type":"callback","title":"Explorer.Backend.Series.argsort/3","doc":"","ref":"Explorer.Backend.Series.html#c:argsort/3"},{"type":"callback","title":"Explorer.Backend.Series.asin/1","doc":"","ref":"Explorer.Backend.Series.html#c:asin/1"},{"type":"callback","title":"Explorer.Backend.Series.at/2","doc":"","ref":"Explorer.Backend.Series.html#c:at/2"},{"type":"callback","title":"Explorer.Backend.Series.at_every/2","doc":"","ref":"Explorer.Backend.Series.html#c:at_every/2"},{"type":"callback","title":"Explorer.Backend.Series.atan/1","doc":"","ref":"Explorer.Backend.Series.html#c:atan/1"},{"type":"callback","title":"Explorer.Backend.Series.binary_and/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_and/2"},{"type":"callback","title":"Explorer.Backend.Series.binary_in/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_in/2"},{"type":"callback","title":"Explorer.Backend.Series.binary_or/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_or/2"},{"type":"callback","title":"Explorer.Backend.Series.cast/2","doc":"","ref":"Explorer.Backend.Series.html#c:cast/2"},{"type":"callback","title":"Explorer.Backend.Series.categories/1","doc":"","ref":"Explorer.Backend.Series.html#c:categories/1"},{"type":"callback","title":"Explorer.Backend.Series.categorise/2","doc":"","ref":"Explorer.Backend.Series.html#c:categorise/2"},{"type":"callback","title":"Explorer.Backend.Series.ceil/1","doc":"","ref":"Explorer.Backend.Series.html#c:ceil/1"},{"type":"callback","title":"Explorer.Backend.Series.clip/3","doc":"","ref":"Explorer.Backend.Series.html#c:clip/3"},{"type":"callback","title":"Explorer.Backend.Series.coalesce/2","doc":"","ref":"Explorer.Backend.Series.html#c:coalesce/2"},{"type":"callback","title":"Explorer.Backend.Series.concat/1","doc":"","ref":"Explorer.Backend.Series.html#c:concat/1"},{"type":"callback","title":"Explorer.Backend.Series.contains/2","doc":"","ref":"Explorer.Backend.Series.html#c:contains/2"},{"type":"callback","title":"Explorer.Backend.Series.correlation/3","doc":"","ref":"Explorer.Backend.Series.html#c:correlation/3"},{"type":"callback","title":"Explorer.Backend.Series.cos/1","doc":"","ref":"Explorer.Backend.Series.html#c:cos/1"},{"type":"callback","title":"Explorer.Backend.Series.count/1","doc":"","ref":"Explorer.Backend.Series.html#c:count/1"},{"type":"callback","title":"Explorer.Backend.Series.covariance/2","doc":"","ref":"Explorer.Backend.Series.html#c:covariance/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_max/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_max/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_min/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_min/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_product/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_product/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_sum/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_sum/2"},{"type":"callback","title":"Explorer.Backend.Series.cut/5","doc":"","ref":"Explorer.Backend.Series.html#c:cut/5"},{"type":"callback","title":"Explorer.Backend.Series.day_of_week/1","doc":"","ref":"Explorer.Backend.Series.html#c:day_of_week/1"},{"type":"callback","title":"Explorer.Backend.Series.distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:distinct/1"},{"type":"callback","title":"Explorer.Backend.Series.divide/2","doc":"","ref":"Explorer.Backend.Series.html#c:divide/2"},{"type":"callback","title":"Explorer.Backend.Series.downcase/1","doc":"","ref":"Explorer.Backend.Series.html#c:downcase/1"},{"type":"callback","title":"Explorer.Backend.Series.dtype/1","doc":"","ref":"Explorer.Backend.Series.html#c:dtype/1"},{"type":"callback","title":"Explorer.Backend.Series.equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:equal/2"},{"type":"callback","title":"Explorer.Backend.Series.ewm_mean/5","doc":"","ref":"Explorer.Backend.Series.html#c:ewm_mean/5"},{"type":"callback","title":"Explorer.Backend.Series.exp/1","doc":"","ref":"Explorer.Backend.Series.html#c:exp/1"},{"type":"callback","title":"Explorer.Backend.Series.fill_missing_with_strategy/2","doc":"","ref":"Explorer.Backend.Series.html#c:fill_missing_with_strategy/2"},{"type":"callback","title":"Explorer.Backend.Series.fill_missing_with_value/2","doc":"","ref":"Explorer.Backend.Series.html#c:fill_missing_with_value/2"},{"type":"callback","title":"Explorer.Backend.Series.first/1","doc":"","ref":"Explorer.Backend.Series.html#c:first/1"},{"type":"callback","title":"Explorer.Backend.Series.floor/1","doc":"","ref":"Explorer.Backend.Series.html#c:floor/1"},{"type":"callback","title":"Explorer.Backend.Series.format/1","doc":"","ref":"Explorer.Backend.Series.html#c:format/1"},{"type":"callback","title":"Explorer.Backend.Series.frequencies/1","doc":"","ref":"Explorer.Backend.Series.html#c:frequencies/1"},{"type":"callback","title":"Explorer.Backend.Series.from_binary/2","doc":"","ref":"Explorer.Backend.Series.html#c:from_binary/2"},{"type":"callback","title":"Explorer.Backend.Series.from_list/2","doc":"","ref":"Explorer.Backend.Series.html#c:from_list/2"},{"type":"callback","title":"Explorer.Backend.Series.greater/2","doc":"","ref":"Explorer.Backend.Series.html#c:greater/2"},{"type":"callback","title":"Explorer.Backend.Series.greater_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:greater_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.head/2","doc":"","ref":"Explorer.Backend.Series.html#c:head/2"},{"type":"callback","title":"Explorer.Backend.Series.hour/1","doc":"","ref":"Explorer.Backend.Series.html#c:hour/1"},{"type":"callback","title":"Explorer.Backend.Series.inspect/2","doc":"","ref":"Explorer.Backend.Series.html#c:inspect/2"},{"type":"function","title":"Explorer.Backend.Series.inspect/5","doc":"Default inspect implementation for backends.","ref":"Explorer.Backend.Series.html#inspect/5"},{"type":"callback","title":"Explorer.Backend.Series.iotype/1","doc":"","ref":"Explorer.Backend.Series.html#c:iotype/1"},{"type":"callback","title":"Explorer.Backend.Series.is_finite/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_finite/1"},{"type":"callback","title":"Explorer.Backend.Series.is_infinite/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_infinite/1"},{"type":"callback","title":"Explorer.Backend.Series.is_nan/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_nan/1"},{"type":"callback","title":"Explorer.Backend.Series.is_nil/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_nil/1"},{"type":"callback","title":"Explorer.Backend.Series.is_not_nil/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_not_nil/1"},{"type":"callback","title":"Explorer.Backend.Series.last/1","doc":"","ref":"Explorer.Backend.Series.html#c:last/1"},{"type":"callback","title":"Explorer.Backend.Series.less/2","doc":"","ref":"Explorer.Backend.Series.html#c:less/2"},{"type":"callback","title":"Explorer.Backend.Series.less_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:less_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.log/1","doc":"","ref":"Explorer.Backend.Series.html#c:log/1"},{"type":"callback","title":"Explorer.Backend.Series.log/2","doc":"","ref":"Explorer.Backend.Series.html#c:log/2"},{"type":"callback","title":"Explorer.Backend.Series.lstrip/2","doc":"","ref":"Explorer.Backend.Series.html#c:lstrip/2"},{"type":"callback","title":"Explorer.Backend.Series.mask/2","doc":"","ref":"Explorer.Backend.Series.html#c:mask/2"},{"type":"callback","title":"Explorer.Backend.Series.max/1","doc":"","ref":"Explorer.Backend.Series.html#c:max/1"},{"type":"callback","title":"Explorer.Backend.Series.mean/1","doc":"","ref":"Explorer.Backend.Series.html#c:mean/1"},{"type":"callback","title":"Explorer.Backend.Series.median/1","doc":"","ref":"Explorer.Backend.Series.html#c:median/1"},{"type":"callback","title":"Explorer.Backend.Series.min/1","doc":"","ref":"Explorer.Backend.Series.html#c:min/1"},{"type":"callback","title":"Explorer.Backend.Series.minute/1","doc":"","ref":"Explorer.Backend.Series.html#c:minute/1"},{"type":"callback","title":"Explorer.Backend.Series.month/1","doc":"","ref":"Explorer.Backend.Series.html#c:month/1"},{"type":"callback","title":"Explorer.Backend.Series.multiply/2","doc":"","ref":"Explorer.Backend.Series.html#c:multiply/2"},{"type":"callback","title":"Explorer.Backend.Series.n_distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:n_distinct/1"},{"type":"function","title":"Explorer.Backend.Series.new/2","doc":"Create a new `Series`.","ref":"Explorer.Backend.Series.html#new/2"},{"type":"callback","title":"Explorer.Backend.Series.nil_count/1","doc":"","ref":"Explorer.Backend.Series.html#c:nil_count/1"},{"type":"callback","title":"Explorer.Backend.Series.not_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:not_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.peaks/2","doc":"","ref":"Explorer.Backend.Series.html#c:peaks/2"},{"type":"callback","title":"Explorer.Backend.Series.pow/2","doc":"","ref":"Explorer.Backend.Series.html#c:pow/2"},{"type":"callback","title":"Explorer.Backend.Series.product/1","doc":"","ref":"Explorer.Backend.Series.html#c:product/1"},{"type":"callback","title":"Explorer.Backend.Series.qcut/5","doc":"","ref":"Explorer.Backend.Series.html#c:qcut/5"},{"type":"callback","title":"Explorer.Backend.Series.quantile/2","doc":"","ref":"Explorer.Backend.Series.html#c:quantile/2"},{"type":"callback","title":"Explorer.Backend.Series.quotient/2","doc":"","ref":"Explorer.Backend.Series.html#c:quotient/2"},{"type":"callback","title":"Explorer.Backend.Series.rank/4","doc":"","ref":"Explorer.Backend.Series.html#c:rank/4"},{"type":"callback","title":"Explorer.Backend.Series.remainder/2","doc":"","ref":"Explorer.Backend.Series.html#c:remainder/2"},{"type":"callback","title":"Explorer.Backend.Series.reverse/1","doc":"","ref":"Explorer.Backend.Series.html#c:reverse/1"},{"type":"callback","title":"Explorer.Backend.Series.round/2","doc":"","ref":"Explorer.Backend.Series.html#c:round/2"},{"type":"callback","title":"Explorer.Backend.Series.rstrip/2","doc":"","ref":"Explorer.Backend.Series.html#c:rstrip/2"},{"type":"callback","title":"Explorer.Backend.Series.sample/5","doc":"","ref":"Explorer.Backend.Series.html#c:sample/5"},{"type":"callback","title":"Explorer.Backend.Series.second/1","doc":"","ref":"Explorer.Backend.Series.html#c:second/1"},{"type":"callback","title":"Explorer.Backend.Series.select/3","doc":"","ref":"Explorer.Backend.Series.html#c:select/3"},{"type":"callback","title":"Explorer.Backend.Series.shift/3","doc":"","ref":"Explorer.Backend.Series.html#c:shift/3"},{"type":"callback","title":"Explorer.Backend.Series.sin/1","doc":"","ref":"Explorer.Backend.Series.html#c:sin/1"},{"type":"callback","title":"Explorer.Backend.Series.size/1","doc":"","ref":"Explorer.Backend.Series.html#c:size/1"},{"type":"callback","title":"Explorer.Backend.Series.skew/2","doc":"","ref":"Explorer.Backend.Series.html#c:skew/2"},{"type":"callback","title":"Explorer.Backend.Series.slice/2","doc":"","ref":"Explorer.Backend.Series.html#c:slice/2"},{"type":"callback","title":"Explorer.Backend.Series.slice/3","doc":"","ref":"Explorer.Backend.Series.html#c:slice/3"},{"type":"callback","title":"Explorer.Backend.Series.sort/3","doc":"","ref":"Explorer.Backend.Series.html#c:sort/3"},{"type":"callback","title":"Explorer.Backend.Series.standard_deviation/1","doc":"","ref":"Explorer.Backend.Series.html#c:standard_deviation/1"},{"type":"callback","title":"Explorer.Backend.Series.strftime/2","doc":"","ref":"Explorer.Backend.Series.html#c:strftime/2"},{"type":"callback","title":"Explorer.Backend.Series.strip/2","doc":"","ref":"Explorer.Backend.Series.html#c:strip/2"},{"type":"callback","title":"Explorer.Backend.Series.strptime/2","doc":"","ref":"Explorer.Backend.Series.html#c:strptime/2"},{"type":"callback","title":"Explorer.Backend.Series.substring/3","doc":"","ref":"Explorer.Backend.Series.html#c:substring/3"},{"type":"callback","title":"Explorer.Backend.Series.subtract/2","doc":"","ref":"Explorer.Backend.Series.html#c:subtract/2"},{"type":"callback","title":"Explorer.Backend.Series.sum/1","doc":"","ref":"Explorer.Backend.Series.html#c:sum/1"},{"type":"callback","title":"Explorer.Backend.Series.tail/2","doc":"","ref":"Explorer.Backend.Series.html#c:tail/2"},{"type":"callback","title":"Explorer.Backend.Series.tan/1","doc":"","ref":"Explorer.Backend.Series.html#c:tan/1"},{"type":"callback","title":"Explorer.Backend.Series.to_iovec/1","doc":"","ref":"Explorer.Backend.Series.html#c:to_iovec/1"},{"type":"callback","title":"Explorer.Backend.Series.to_list/1","doc":"","ref":"Explorer.Backend.Series.html#c:to_list/1"},{"type":"callback","title":"Explorer.Backend.Series.transform/2","doc":"","ref":"Explorer.Backend.Series.html#c:transform/2"},{"type":"callback","title":"Explorer.Backend.Series.unary_not/1","doc":"","ref":"Explorer.Backend.Series.html#c:unary_not/1"},{"type":"callback","title":"Explorer.Backend.Series.unordered_distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:unordered_distinct/1"},{"type":"callback","title":"Explorer.Backend.Series.upcase/1","doc":"","ref":"Explorer.Backend.Series.html#c:upcase/1"},{"type":"callback","title":"Explorer.Backend.Series.variance/1","doc":"","ref":"Explorer.Backend.Series.html#c:variance/1"},{"type":"callback","title":"Explorer.Backend.Series.window_max/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_max/5"},{"type":"callback","title":"Explorer.Backend.Series.window_mean/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_mean/5"},{"type":"callback","title":"Explorer.Backend.Series.window_median/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_median/5"},{"type":"callback","title":"Explorer.Backend.Series.window_min/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_min/5"},{"type":"callback","title":"Explorer.Backend.Series.window_standard_deviation/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_standard_deviation/5"},{"type":"callback","title":"Explorer.Backend.Series.window_sum/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_sum/5"},{"type":"callback","title":"Explorer.Backend.Series.year/1","doc":"","ref":"Explorer.Backend.Series.html#c:year/1"},{"type":"type","title":"Explorer.Backend.Series.df/0","doc":"","ref":"Explorer.Backend.Series.html#t:df/0"},{"type":"type","title":"Explorer.Backend.Series.dtype/0","doc":"","ref":"Explorer.Backend.Series.html#t:dtype/0"},{"type":"type","title":"Explorer.Backend.Series.lazy_s/0","doc":"","ref":"Explorer.Backend.Series.html#t:lazy_s/0"},{"type":"type","title":"Explorer.Backend.Series.non_finite/0","doc":"","ref":"Explorer.Backend.Series.html#t:non_finite/0"},{"type":"type","title":"Explorer.Backend.Series.option/1","doc":"","ref":"Explorer.Backend.Series.html#t:option/1"},{"type":"type","title":"Explorer.Backend.Series.s/0","doc":"","ref":"Explorer.Backend.Series.html#t:s/0"},{"type":"type","title":"Explorer.Backend.Series.t/0","doc":"","ref":"Explorer.Backend.Series.html#t:t/0"},{"type":"type","title":"Explorer.Backend.Series.valid_types/0","doc":"","ref":"Explorer.Backend.Series.html#t:valid_types/0"},{"type":"module","title":"Explorer.PolarsBackend","doc":"The Explorer backend for Polars.","ref":"Explorer.PolarsBackend.html"},{"type":"extras","title":"Ten Minutes to Explorer","doc":"# Ten Minutes to Explorer\n\n```elixir\nMix.install([\n {:explorer, \"~> 0.6.0\"},\n {:kino, \"~> 0.9.0\"}\n])\n```","ref":"exploring_explorer.html"},{"type":"extras","title":"Introduction - Ten Minutes to Explorer","doc":"Explorer is a dataframe library for Elixir. A dataframe is a common data structure used in data analysis. It is a two-dimensional table composed of columns and rows similar to a SQL table or a spreadsheet.\n\nExplorer's aim is to provide a simple and powerful API for manipulating dataframes. It takes influences mainly\n from the [`tidyverse`](https://www.tidyverse.org), but if you've used other dataframe libraries like `pandas` you shouldn't have too much trouble working with Explorer.\n\nThis document is meant to give you a crash course in using Explorer. More in-depth documentation can be found in the relevant sections of the docs.\n\nWe strongly recommend you run this livebook locally so you can see the outputs and play with the inputs!","ref":"exploring_explorer.html#introduction"},{"type":"extras","title":"Reading and writing data - Ten Minutes to Explorer","doc":"Data can be read from delimited files (like CSV), NDJSON, Parquet, and the Arrow IPC (feather) format. You can also load in data from a map or keyword list of columns with `Explorer.DataFrame.new/1`.\n\nFor CSV, your 'usual suspects' of options are available:\n\n* `delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n* `dtypes` - A keyword list of `[column_name: dtype]`. If a type is not specified for a column, it is imputed from the first 1000 rows. (default: `[]`)\n* `header` - Does the file have a header of column names as the first row or not? (default: `true`)\n* `max_rows` - Maximum number of lines to read. (default: `nil`)\n* `nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n* `skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n* `columns` - A list of column names to keep. If present, only these columns are read into the dataframe. (default: `nil`)\n\n`Explorer` also has multiple example datasets built in, which you can load from the `Explorer.Datasets` module like so:\n\n```elixir\ndf = Explorer.Datasets.fossil_fuels()\n```\n\nYou'll notice that the output looks slightly different than many dataframe libraries. `Explorer` takes inspiration on this front from [`glimpse`](https://pillar.r-lib.org/reference/glimpse.html) in R. A benefit to this approach is that you will rarely need to elide columns.\n\nIf you'd like to see a table with your data, we've got you covered there too.\n\n```elixir\nExplorer.DataFrame.table(df)\n```\n\nWriting files is very similar to reading them. The options are a little more limited:\n\n* `header` - Should the column names be written as the first line of the file? (default: `true`)\n* `delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\nFirst, let's add some useful aliases:\n\n```elixir\nalias Explorer.DataFrame\nalias Explorer.Series\n```\n\nAnd then write to a file of your choosing:\n\n```elixir\ninput = Kino.Input.text(\"Filename\")\n```\n\n```elixir\nfilename = Kino.Input.read(input)\nDataFrame.to_csv(df, filename)\n```","ref":"exploring_explorer.html#reading-and-writing-data"},{"type":"extras","title":"Working with Series - Ten Minutes to Explorer","doc":"`Explorer`, like `Polars`, works up from the concept of a `Series`. In many ways, you can think of a dataframe as a row-aligned map of `Series`. These are like `vectors` in R or `series` in Pandas.\n\nFor simplicity, `Explorer` uses the following `Series` `dtypes`:\n\n* `:float` - 64-bit floating point number\n* `:integer` - 64-bit signed integer\n* `:boolean` - Boolean\n* `:string` - UTF-8 encoded binary\n* `:date` - Date type that unwraps to `Elixir.Date`\n* `:datetime` - DateTime type that unwraps to `Elixir.NaiveDateTime`\n\n`Series` can be constructed from Elixir basic types. For example:\n\n```elixir\ns1 = Series.from_list([1, 2, 3])\n```\n\n```elixir\ns2 = Series.from_list([\"a\", \"b\", \"c\"])\n```\n\n```elixir\ns3 = Series.from_list([~D[2011-01-01], ~D[1965-01-21]])\n```\n\nYou'll notice that the `dtype` and size of the `Series` are at the top of the printed value. You can get those programmatically as well.\n\n```elixir\nSeries.dtype(s3)\n```\n\n```elixir\nSeries.size(s3)\n```\n\nAnd the printed values max out at 50:\n\n```elixir\n1..100 |> Enum.to_list() |> Series.from_list()\n```\n\nSeries are also nullable.\n\n```elixir\ns = Series.from_list([1.0, 2.0, nil, nil, 5.0])\n```\n\nAnd you can fill in those missing values using one of the following strategies:\n\n* `:forward` - replace nil with the previous value\n* `:backward` - replace nil with the next value\n* `:max` - replace nil with the series maximum\n* `:min` - replace nil with the series minimum\n* `:mean` - replace nil with the series mean\n\n```elixir\nSeries.fill_missing(s, :forward)\n```\n\nIn the case of mixed numeric types (i.e. integers and floats), `Series` will downcast to a float:\n\n```elixir\nSeries.from_list([1, 2.0])\n```\n\nIn all other cases, `Series` must all be of the same `dtype` or else you'll get an `ArgumentError`.\n\n```elixir\nSeries.from_list([1, 2, 3, \"a\"])\n```\n\nOne of the goals of `Explorer` is *useful error messages*. If you look at the error above, you get:\n\n> Cannot make a series from mismatched types. Type of \"a\" does not match inferred dtype integer.\n\nHopefully this makes abundantly clear what's going on.\n\n`Series` also implements the `Access` protocol. You can slice and dice in many ways:\n\n```elixir\ns = 1..10 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\ns[1]\n```\n\n```elixir\ns[-1]\n```\n\n```elixir\ns[0..4]\n```\n\n```elixir\ns[[0, 4, 4]]\n```\n\nAnd of course, you can convert back to an Elixir list.\n\n```elixir\nSeries.to_list(s)\n```\n\n`Explorer` supports comparisons.\n\n```elixir\ns = 1..11 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\ns1 = 11..1 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\nSeries.equal(s, s1)\n```\n\n```elixir\nSeries.equal(s, 5)\n```\n\n```elixir\nSeries.not_equal(s, 10)\n```\n\n```elixir\nSeries.greater_equal(s, 4)\n```\n\nAnd arithmetic.\n\n```elixir\nSeries.add(s, s1)\n```\n\n```elixir\nSeries.subtract(s, 4)\n```\n\n```elixir\nSeries.multiply(s, s1)\n```\n\nRemember those helpful errors? We've tried to add those throughout. So if you try to do arithmetic with mismatching dtypes:\n\n```elixir\ns = Series.from_list([1, 2, 3])\ns1 = Series.from_list([1.0, 2.0, 3.0])\nSeries.add(s, s1)\n```\n\nJust kidding! Integers and floats will downcast to floats. Let's try again:\n\n```elixir\ns = Series.from_list([1, 2, 3])\ns1 = Series.from_list([\"a\", \"b\", \"c\"])\nSeries.add(s, s1)\n```\n\nYou can flip them around.\n\n```elixir\ns = Series.from_list([1, 2, 3, 4])\nSeries.reverse(s)\n```\n\nAnd sort.\n\n```elixir\n1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list() |> Series.sort()\n```\n\nOr argsort.\n\n```elixir\ns = 1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list()\nids = Series.argsort(s) |> Series.to_list()\n```\n\nWhich you can pass to `Explorer.Series.slice/2` if you want the sorted values.\n\n```elixir\nSeries.slice(s, ids)\n```\n\nYou can calculate cumulative values.\n\n```elixir\ns = 1..100 |> Enum.to_list() |> Series.from_list()\nSeries.cumulative_sum(s)\n```\n\nOr rolling ones.\n\n```elixir\nSeries.window_sum(s, 4)\n```\n\nYou can count and list unique values.\n\n```elixir\ns = Series.from_list([\"a\", \"b\", \"b\", \"c\", \"c\", \"c\"])\nSeries.distinct(s)\n```\n\n```elixir\nSeries.n_distinct(s)\n```\n\nAnd you can even get a dataframe showing the frequencies for each distinct value.\n\n```elixir\nSeries.frequencies(s)\n```","ref":"exploring_explorer.html#working-with-series"},{"type":"extras","title":"Working with DataFrames - Ten Minutes to Explorer","doc":"A `DataFrame` is really just a collection of `Series` of the same size. Which is why you can create a `DataFrame` from a `Keyword` list.\n\n```elixir\nDataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n```\n\nSimilarly to `Series`, the `Inspect` implementation prints some info at the top and to the left. At the top we see the shape of the dataframe (rows and columns) and then for each column we see the name, dtype, and first five values. We can see a bit more from that built-in dataset we loaded in earlier.\n\n```elixir\ndf\n```\n\nYou will also see grouping information there, but we'll get to that later. You can get the info yourself directly:\n\n```elixir\nDataFrame.names(df)\n```\n\n```elixir\nDataFrame.dtypes(df)\n```\n\n```elixir\nDataFrame.shape(df)\n```\n\n```elixir\n{DataFrame.n_rows(df), DataFrame.n_columns(df)}\n```\n\nWe can grab the head.\n\n```elixir\nDataFrame.head(df)\n```\n\nOr the tail. Let's get a few more values from the tail.\n\n```elixir\nDataFrame.tail(df, 10)\n```\n\n#","ref":"exploring_explorer.html#working-with-dataframes"},{"type":"extras","title":"Verbs and macros - Ten Minutes to Explorer","doc":"In `Explorer`, like in `dplyr`, we have five main verbs to work with dataframes:\n\n* select\n* filter\n* mutate\n* arrange\n* summarise\n\nWe are going to explore then in this notebook, but first we need to \"require\"\nthe `Explorer.DataFrame` module in order to load the macros needed for these verbs.\n\nI want to take the opportunity to create a shorter alias for the `DataFrame` module,\ncalled `DF`:\n\n```elixir\nrequire DataFrame, as: DF\n```\n\nFrom now on we are using the shorter version, `DF`, to refer to the required `Explorer.DataFrame`\nmodule.\n\n#","ref":"exploring_explorer.html#verbs-and-macros"},{"type":"extras","title":"Select - Ten Minutes to Explorer","doc":"Let's jump right into it. We can select columns pretty simply.\n\n```elixir\nDF.select(df, [\"year\", \"country\"])\n```\n\nBut Elixir gives us some superpowers. In R there's [`tidy-select`](https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html). I don't think we need that in Elixir. Anywhere in `Explorer` where you need to pass a list of column names, you can also execute a filtering callback on the column names. It's just an anonymous function passed to `df |> DataFrame.names() |> Enum.filter(callback_here)`.\n\n```elixir\nDF.select(df, &String.ends_with?(&1, \"fuel\"))\n```\n\nWant all but some columns? `discard/2` performs the opposite of `select/2`.\n\n```elixir\nDF.discard(df, &String.ends_with?(&1, \"fuel\"))\n```\n\n#","ref":"exploring_explorer.html#select"},{"type":"extras","title":"Filter - Ten Minutes to Explorer","doc":"The next verb we'll look at is `filter`.\n\nThis is implemented using a macro, so it's possible to use expressions\nlike you would if comparing variables in Elixir:\n\n```elixir\nDF.filter(df, country == \"BRAZIL\")\n```\n\nUsing complex filters is also possible:\n\n```elixir\nDF.filter(df, country == \"ALGERIA\" and year > 2012)\n```\n\nYou can also write the same filter without the macro, by using the callback version function which is `filter_with/2`:\n\n```elixir\nDF.filter_with(df, fn ldf ->\n ldf[\"country\"]\n |> Series.equal(\"ALGERIA\")\n |> Series.and(Series.greater(ldf[\"year\"], 2012))\nend)\n```\n\nBy the way, all the `Explorer.DataFrame` macros have a correspondent function that accepts a callback.\nIn fact, our macros are implemented using those functions.\n\nThe `filter_with/2` function is going to use a virtual representation of the dataframe\nthat we call a \"lazy frame\". With lazy frames you canĀ“t access the\nseries contents, but every operation will be optimized and run only once.\n\nRemember those helpful error messages?\n\n```elixir\nDF.filter(df, cuontry == \"BRAZIL\")\n```\n\n#","ref":"exploring_explorer.html#filter"},{"type":"extras","title":"Mutate - Ten Minutes to Explorer","doc":"A common task in data analysis is to add columns or change existing ones. Mutate is a handy verb.\n\n```elixir\nDF.mutate(df, new_column: solid_fuel + cement)\n```\n\nDid you catch that? You can pass in new columns as keyword arguments. It also works to transform existing columns.\n\n```elixir\nDF.mutate(df,\n gas_fuel: Series.cast(gas_fuel, :float),\n gas_and_liquid_fuel: gas_fuel + liquid_fuel\n)\n```\n\n`DataFrame.mutate/2` is flexible though. You may not always want to use keyword arguments. Given that column names are `String.t()`, it may make more sense to use a map.\n\n```elixir\nDF.mutate(df, %{\"gas_fuel\" => gas_fuel - 10})\n```\n\n`DF.transmute/2`, which is `DF.mutate/2` that only retains the specified columns, is forthcoming.\n\n#","ref":"exploring_explorer.html#mutate"},{"type":"extras","title":"Arrange - Ten Minutes to Explorer","doc":"Sorting the dataframe is pretty straightforward.\n\n```elixir\nDF.arrange(df, year)\n```\n\nBut it comes with some tricks up its sleeve.\n\n```elixir\nDF.arrange(df, asc: total, desc: year)\n```\n\nAs the examples show, `arrange/2` is a macro, and therefore you can use some functions to arrange your dataframe:\n\n```elixir\nDF.arrange(df, asc: Series.window_sum(total, 2))\n```\n\nSort operations happen left to right. And keyword list args permit specifying the direction.\n\n#","ref":"exploring_explorer.html#arrange"},{"type":"extras","title":"Distinct - Ten Minutes to Explorer","doc":"Okay, as expected here too. Very straightforward.\n\n```elixir\nDF.distinct(df, [\"year\", \"country\"])\n```\n\nYou can specify whether to keep the other columns as well, so the first row of each distinct value is kept:\n\n```elixir\nDF.distinct(df, [\"country\"], keep_all: true)\n```\n\n#","ref":"exploring_explorer.html#distinct"},{"type":"extras","title":"Rename - Ten Minutes to Explorer","doc":"Rename can take either a list of new names or a callback that is passed to `Enum.map/2` against the names. You can also use a map or keyword args to rename specific columns.\n\n```elixir\nDF.rename(df, year: \"year_test\")\n```\n\n```elixir\nDF.rename_with(df, &(&1 \"_test\"))\n```\n\n#","ref":"exploring_explorer.html#rename"},{"type":"extras","title":"Dummies - Ten Minutes to Explorer","doc":"This is fun! We can get dummy variables for unique values.\n\n```elixir\nDF.dummies(df, [\"year\"])\n```\n\n```elixir\nDF.dummies(df, [\"country\"])\n```\n\n#","ref":"exploring_explorer.html#dummies"},{"type":"extras","title":"Sampling - Ten Minutes to Explorer","doc":"Random samples can give us a percent or a specific number of samples, with or without replacement, and the function is seedable.\n\n```elixir\nDF.sample(df, 10)\n```\n\n```elixir\nDF.sample(df, 0.4)\n```\n\nTrying for those helpful error messages again.\n\n```elixir\nDF.sample(df, 10000)\n```\n\n```elixir\nDF.sample(df, 10000, replacement: true)\n```\n\n#","ref":"exploring_explorer.html#sampling"},{"type":"extras","title":"Pull and slice - Ten Minutes to Explorer","doc":"Slicing and dicing can be done with the `Access` protocol or with explicit pull/slice/take functions.\n\n```elixir\ndf[\"year\"]\n```\n\n```elixir\nDF.pull(df, \"year\")\n```\n\n```elixir\ndf[[\"year\", \"country\"]]\n```\n\n```elixir\nDF.slice(df, [1, 20, 50])\n```\n\nNegative offsets work for slice!\n\n```elixir\nDF.slice(df, -10, 5)\n```\n\n```elixir\nDF.slice(df, 10, 5)\n```\n\nSlice also works with ranges:\n\n```elixir\nDF.slice(df, 12..42)\n```\n\n#","ref":"exploring_explorer.html#pull-and-slice"},{"type":"extras","title":"Pivot - Ten Minutes to Explorer","doc":"We can `pivot_longer/3` and `pivot_wider/4`. These are inspired by [tidyr](https://tidyr.tidyverse.org/articles/pivot.html).\n\nThere are some shortcomings in `pivot_wider/4` related to `polars`. The `select` option must select only columns of numeric type.\n\n```elixir\nDF.pivot_longer(df, [\"year\", \"country\"], select: &String.ends_with?(&1, \"fuel\"))\n```\n\n```elixir\nDF.pivot_wider(df, \"country\", \"total\", id_columns: [\"year\"])\n```\n\nLet's make those names look nicer!\n\n```elixir\ntidy_names = fn name ->\n name\n |> String.downcase()\n |> String.replace(~r/\\s/, \" \")\n |> String.replace(~r/[^A-Za-z\\s]/, \"\")\n |> String.replace(\" \", \"_\")\nend\n\ndf\n|> DF.pivot_wider(\"country\", \"total\", id_columns: [\"year\"])\n|> DF.rename_with(tidy_names)\n```\n\n#","ref":"exploring_explorer.html#pivot"},{"type":"extras","title":"Joins - Ten Minutes to Explorer","doc":"Joining is *fast* and easy. You can specify the columns to join on and how to join. Polars even supports cartesian (cross) joins, so `Explorer` does too.\n\n```elixir\ndf1 = DF.select(df, [\"year\", \"country\", \"total\"])\ndf2 = DF.select(df, [\"year\", \"country\", \"cement\"])\n\nDF.join(df1, df2)\n```\n\n```elixir\ndf3 = df |> DF.select([\"year\", \"cement\"]) |> DF.slice(0, 500)\n\nDF.join(df1, df3, how: :left)\n```\n\n#","ref":"exploring_explorer.html#joins"},{"type":"extras","title":"Grouping - Ten Minutes to Explorer","doc":"`Explorer` supports *groupby* operations. They're limited based on what's possible in Polars, but they do most of what you need to do.\n\n```elixir\ngrouped = DF.group_by(df, [\"country\"])\n```\n\nNotice that the `Inspect` call now shows `groups` as well as `rows` and `columns`. You can, of course, get them explicitly.\n\n```elixir\nDF.groups(grouped)\n```\n\nAnd you can ungroup explicitly.\n\n```elixir\nDF.ungroup(grouped)\n```\n\nBut what we care about the most is aggregating! Let's see which country has the max `per_capita` value.\n\n```elixir\ngrouped\n|> DF.summarise(max_per_capita: max(per_capita))\n|> DF.arrange(desc: max_per_capita)\n```\n\nQatar it is.\n\nYou may noticed that we are using `max/1` inside the `summarise` macro. This is possible because we expose all functions from the `Series` module. You can use the following aggregations inside summarise:\n\n* `min/1` - Take the minimum value within the group. See `Explorer.Series.min/1`.\n* `max/1` - Take the maximum value within the group. See `Explorer.Series.max/1`.\n* `sum/1` - Take the sum of the series within the group. See `Explorer.Series.sum/1`.\n* `mean/1` - Take the mean of the series within the group. See `Explorer.Series.mean/1`.\n* `median/1` - Take the median of the series within the group. See `Explorer.Series.median/1`.\n* `first/1` - Take the first value within the group. See `Explorer.Series.first/1`.\n* `last/1` - Take the last value within the group. See `Explorer.Series.last/1`.\n* `count/1` - Count the number of rows per group.\n* `n_unique/1` - Count the number of unique rows per group.\n\nThe API is similar to `mutate`: you can use keyword args or a map and specify aggregations to use.\n\n```elixir\nDF.summarise(grouped, min_per_capita: min(per_capita), min_total: min(total))\n```\n\nSpeaking of `mutate`, it's 'group-aware'. As are `arrange`, `distinct`, and `n_rows`.\n\n```elixir\nDF.mutate(grouped, total_window_sum: window_sum(total, 3), rows_in_group: count(country))\n```\n\nIt's also possible to use aggregations inside other functions:\n\n```elixir\ngrouped\n|> DF.summarise(greater_than_9: greater(max(per_capita), 9.0), per_capita_max: max(per_capita))\n|> DataFrame.arrange(desc: per_capita_max)\n```\n\n#","ref":"exploring_explorer.html#grouping"},{"type":"extras","title":"That's it! - Ten Minutes to Explorer","doc":"And not. This is certainly not exhaustive, but I hope it gives you a good idea of what can be done and what the 'flavour' of the API is like. I'd love contributions and issues raised where you find them!","ref":"exploring_explorer.html#that-s-it"},{"type":"extras","title":"Changelog","doc":"# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [v0.6.1] - 2023-07-06\n\n#","ref":"changelog.html"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix summarise without groups for lazy frames.\n\n## [v0.6.0] - 2023-07-05\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add support for OTP 26 and Elixir 1.15.\n\n- Allow `Explorer.DataFrame.summarise/2` to work without groups.\n The aggregations can work considering the entire dataframe.\n\n- Add the following series functions: `product/1`, `cummulative_product/1`, `abs/1`,\n `skew/2`, `window_standard_deviation/3`, `rank/2`, `year/1`, `mounth/1`, `day/1`,\n `hour/1`, `minute/1`, `second/1`, `strptime/2`, `strftime/2`, `argmin/1`, `argmax/1`,\n `cut/3`, `qcut/3`, `correlation/3`, `covariance/2` and `clip/3`.\n\n They cover a lot in terms of functionality, so please check the `Explorer.Series`\n docs for further details.\n\n- Add `Explorer.DataFrame.nil_count/1` that counts the number of nil elements in each\n column.\n\n- Add `Explorer.DataFrame.frequencies/2` that creates a new dataframe with unique rows\n and the frequencies of each.\n\n- Add `Explorer.DataFrame.relocate/3` that enables changing order of columns from a df.\n\n- Add precompiled NIFs for FreeBSD.\n\n- Support scalar values in the `on_true` and `on_false` arguments of `Explore.Series.select/3`.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `Series.day_of_week/1` and `Series.round/2` for operations using a lazy frame.\n\n- Fix upcasted date to datetime for literal expressions. It allows to use scalar dates\n in expressions like this: `DF.mutate(a: ~D[2023-01-01])`. This also fixes the support\n for naive datetimes.\n\n- Improve error messages returned from the NIF to be always strings. Now we add more\n context to the string returned, instead of having `{:context, error_message}`.\n\n- Fix the `:infer_schema_length` option of `Explorer.DataFrame.from_csv/2` when passing `nil`.\n Now it's possible to take into account the entire file to infer the schema.\n\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Deprecated - Changelog","doc":"- Deprecate `Explorer.Series.to_date/1` and `Explorer.Series.to_time/1` in favor of\n using `Explorer.Series.cast(s, :date)` and `Explorer.Series.cast(s, :time)` respectively.\n\n## [v0.5.7] - 2023-05-10\n\n#","ref":"changelog.html#deprecated"},{"type":"extras","title":"Added - Changelog","doc":"- Allow `Explorer.Series.select/3` to receive series of size 1 in both sides.\n\n- Add trigonometric functions `sin/1`, `cos/1`, `tan/1`, `asin/1`, `acos/1` and\n `atan/1` to `Explorer.Series`.\n\n- Add `Explorer.DataFrame.to_rows_stream/2` function. This is useful to traverse\n dataframes with large series, but is not recommended since it can be an expensive\n operation.\n\n- Add LazyFrame version of `Explorer.DataFrame.to_ipc/3`.\n\n- Add options to control streaming when writing lazy dataframes. Now users can\n toggle streaming for the `to_ipc/3` and `to_parquet/3` functions.\n\n- Add `Explorer.DataFrame.from_ipc_stream/2` lazy, but using the eager implementation\n underneath.\n\n- Add option to control the end of line (EOF) char when reading CSV files.\n We call this new option `:eol_delimiter`, and it's available for the `from_csv/2`\n and `load_csv/2` functions in the `Explorer.DataFrame` module.\n\n- Allow `Explorer.DataFrame.pivot_wider/4` to use category fields.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `nif_not_loaded` error when `Explorer.Series.ewm_mean/2` is called from query.\n\n- Type check arguments for boolean series operations, only allowing series of\n the `boolean` dtype.\n\n- Do not use `../0` in order to keep compatible with Elixir 1.13\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Removed - Changelog","doc":"- Temporarely remove support for ARM 32 bits computers in the precompilation\n workflow.\n\n## [v0.5.6] - 2023-03-24\n\n#","ref":"changelog.html#removed"},{"type":"extras","title":"Added - Changelog","doc":"- Add the following functions to the `Explorer.Series` module: `log/1`, `log/2`\n and `exp/1`. They compute the logarithm and exponential of a series.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Allow `Explorer.Series.select/3` to receive series of size 1 for both the\n `on_true` and `on_false` arguments.\n\n- Fix the encoding of special float values that may return from some series\n functions. This is going to encode the atoms for NaN and infinity values.\n\n## [v0.5.5] - 2023-03-13\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add support for multiple value columns in pivot wider.\n The resultant dataframe that is created from this type of pivoting is going\n to have columns with the names prefixed by the original value column, followed\n by an underscore and the name of the variable.\n\n- Add `Explorer.Series.ewm_mean/2` for calculating exponentially weighted moving\n average.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Change the `Explorer.Backend.DataFrame`'s `pivot_wider` callback to work with\n multiple columns instead of only one.\n\n- Change the `Explorer.Backend.DataFrame`'s `window_*` callbacks to work with\n variables instead of keyword args. This is needed to make explicit when a backend\n is not implementing an option.\n\n- Change the `Explorer.Backend.DataFrame`'s `describe` callback and remove the\n need for an \"out df\", since we won't have a lazy version of that funcion.\n\n- This shouldn't affect the API, but we had an update in Polars.\n It is now using `v0.27.2`. For further details, see:\n [Rust Polars 0.27.0](https://github.com/pola-rs/polars/releases/tag/rs-0.27.0).\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Provide hints when converting string/binary series to tensors.\n\n- Add libatomic as a link to the generated NIF. This is needed to fix the load\n of the Explorer NIF when running on ARM 32 bits machines like the Pi 3.\n See the [original issue](https://github.com/philss/rustler_precompiled/issues/53)\n\n## [v0.5.4] - 2023-03-09\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix missing \"README.md\" file in the list of package files.\n Our readme is now required in compilation, because it contains the moduledoc for\n the main `Explorer` module.\n\n## [v0.5.3] - 2023-03-08\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add the `Explorer.Series.format/1` function that concatenates multiple series together,\n always returning a string series.\n\n- With the addition of `format/1`, we also have a new operator for string concatenation\n inside `Explorer.Query`. It is the ` ` operator, that is similar to what the `Kernel. /2`\n operator does, but instead of concatenating strings, it concatenates two series, returning\n a string series - it is using `format/1` underneath.\n\n- Add support for slicing by series in dataframes and other series.\n\n- Add support for 2D tensors in `Explorer.DataFrame.new/2`.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `Explorer.DataFrame.new/2` to respect the selected dtype when an entire series is nil.\n\n- Improve error message for mismatched dtypes in series operations.\n\n- Fix lazy series operations of binary series and binary values. This is going to wrap binary\n values in the correct dtype, in order to pass down to Polars.\n\n- Fix two bugs in `Explorer.DataFrame.pivot_wider/3`: `nil` values in the series that is\n used for new column names is now correctly creating a `nil` column. We also fixed the problem\n of a duplicated column created after pivoting, and possibly conflicting with an existing\n ID column. We add a suffix for these columns.\n\n## [v0.5.2] - 2023-02-28\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `across` and comprehensions to `Explorer.Query`. These features allow a\n more flexible and elegant way to work with multiple columns at once. Example:\n\n ```elixir\n iris = Explorer.Datasets.iris()\n Explorer.DataFrame.mutate(iris,\n for col <- across([\"sepal_width\", \"sepal_length\", \"petal_length\", \"petal_width\"]) do\n {col.name, (col - mean(col)) / variance(col)}\n end\n )\n ```\n\n See the `Explorer.Query` documentation for further details.\n\n- Add support for regexes to select columns of a dataframe. Example:\n\n ```elixir\n df = Explorer.Datasets.wine()\n df[~r/(class|hue)/]\n ```\n\n- Add the `:max_rows` and `:columns` options to `Explorer.DataFrame.from_parquet/2`. This mirrors\n the `from_csv/2` function.\n\n- Allow `Explorer.Series` functions that accept floats to work with `:nan`, `:infinity`\n and `:neg_infinity` values.\n\n- Add `Explorer.DataFrame.shuffle/2` and `Explorer.Series.shuffle/2`.\n\n- Add support for a list of filters in `Explorer.DataFrame.filter/2`. These filters are\n joined as `and` expressions.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Add `is_integer/1` guard to `Explorer.Series.shift/2`.\n- Raise if series sizes do not match for binary operations.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Changed - Changelog","doc":"- Rename the option `:replacement` to `:replace` for `Explorer.DataFrame.sample/3` and\n `Explorer.Series.sample/3`.\n\n- Change the default behaviour of sampling to not shuffle by default. A new option\n named `:shuffle` was added to control that.\n\n## [v0.5.1] - 2023-02-17\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Added - Changelog","doc":"- Add boolean dtype to `Series.in/2`.\n- Add binary dtype to `Series.in/2`.\n- Add `Series.day_of_week/1`.\n\n- Allow `Series.fill_missing/2` to:\n - receive `:infinity` and `:neg_infinity` values.\n - receive date and datetime values.\n - receive binary values.\n\n- Add support for `time` dtype.\n- Add version of `Series.pow/2` that accepts series on both sides.\n- Allow `Series.from_list/2` to receive `:nan`, `:infinity` and `:neg_infinity` atoms.\n- Add `Series.to_date/1` and `Series.to_time/1` for datetime series.\n- Allow casting of string series to category.\n- Accept tensors when creating a new dataframe.\n- Add compatibility with Nx v0.5.\n- Add support for Nx's serialize and deserialize.\n\n- Add the following function implementations for the Polars' Lazy dataframe backend:\n - `arrange_with`\n - `concat_columns`\n - `concat_rows`\n - `distinct`\n - `drop_nil`\n - `filter_with`\n - `join`\n - `mutate_with`\n - `pivot_longer`\n - `rename`\n - `summarise_with`\n - `to_parquet`\n\n Only `summarise_with` supports groups for this version.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Require version of Rustler to be `~> 0.27.0`, which mirrors the NIF requirement.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Casting to an unknown dtype returns a better error message.\n\n## [v0.5.0] - 2023-01-12\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `DataFrame.describe/2` to gather some statistics from a dataframe.\n- Add `Series.nil_count/1` to count nil values.\n- Add `Series.in/2` to check if a given value is inside a series.\n- Add `Series` float predicates: `is_finite/1`, `is_infinite/1` and `is_nan/1`.\n- Add `Series` string functions: `contains/2`, `trim/1`, `trim_leading/1`, `trim_trailing/1`,\n `upcase/1` and `downcase/1`.\n\n- Enable slicing of lazy frames (`LazyFrame`).\n- Add IO operations \"from/load\" to the lazy frame implementation.\n- Add support for the `:lazy` option in the `DataFrame.new/2` function.\n- Add `Series` float rounding methods: `round/2`, `floor/1` and `ceil/1`.\n- Add support for precompiling to Linux running on RISCV CPUs.\n- Add support for precompiling to Linux - with musl - running on AARCH64 computers.\n- Allow `DataFrame.new/1` to receive the `:dtypes` option.\n- Accept `:nan` as an option for `Series.fill_missing/2` with float series.\n- Add basic support for the categorical dtype - the `:category` dtype.\n- Add `Series.categories/1` to return categories from a categorical series.\n- Add `Series.categorise/2` to categorise a series of integers using predefined categories.\n- Add `Series.replace/2` to replace the contents of a series.\n- Support selecting columns with unusual names (like with spaces) inside `Explorer.Query`\n with `col/1`.\n\n The usage is like this:\n\n ```elixir\n Explorer.DataFrame.filter(df, col(\"my col\") > 42)\n ```\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `DataFrame.mutate/2` using a boolean scalar value.\n- Stop leaking `UInt32` series to Elixir.\n- Cast numeric columns to our supported dtypes after IO read.\n This fix is only applied for the eager implementation for now.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Changed - Changelog","doc":"- Rename `Series.bintype/1` to `Series.iotype/1`.\n\n## [v0.4.0] - 2022-11-29\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `Series.quotient/2` and `Series.remainder/2` to work with integer division.\n- Add `Series.iotype/1` to return the underlying representation type.\n- Allow series on both sides of binary operations, like: `add(series, 1)`\n and `add(1, series)`.\n\n- Allow comparison, concat and coalesce operations on \"(series, lazy series)\".\n- Add lazy version of `Series.sample/3` and `Series.size/1`.\n- Add support for Arrow IPC Stream files.\n- Add `Explorer.Query` and the macros that allow a simplified query API.\n This is a huge improvement to some of the main functions, and allow refering to\n columns as they were variables.\n\n Before this change we would need to write a filter like this:\n\n ```elixir\n Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1[\"col1\"], 42))\n ```\n\n But now it's also possible to write this operation like this:\n\n ```elixir\n Explorer.DataFrame.filter(df, col1 > 42)\n ```\n\n This operation is going to use `filter_with/2` underneath, which means that\n is going to use lazy series and compute the results at once.\n Notice that is mandatory to \"require\" the DataFrame module, since these operations\n are implemented as macros.\n\n The following new macros were added:\n - `filter/2`\n - `mutate/2`\n - `summarise/2`\n - `arrange/2`\n\n They substitute older versions that did not accept the new query syntax.\n\n- Add `DataFrame.put/3` to enable adding or replacing columns in a eager manner.\n This works similar to the previous version of `mutate/2`.\n\n- Add `Series.select/3` operation that enables selecting a value\n from two series based on a predicate.\n\n- Add \"dump\" and \"load\" functions to IO operations. They are useful to load\n or dump dataframes from/to memory.\n\n- Add `Series.to_iovec/2` and `Series.to_binary/1`. They return the underlying\n representation of series as binary. The first one returns a list of binaries,\n possibly with one element if the series is contiguous in memory. The second one\n returns a single binary representing the series.\n\n- Add `Series.shift/2` that shifts the series by an offset with nil values.\n- Rename `Series.fetch!/2` and `Series.take_every/2` to `Series.at/2`\n and `Series.at_every/2`.\n\n- Add `DataFrame.discard/2` to drop columns. This is the opposite of `select/2`.\n\n- Implement `Nx.LazyContainer` for `Explorer.DataFrame` and `Explorer.Series`\n so data can be passed into Nx.\n\n- Add `Series.not/1` that negates values in a boolean series.\n- Add the `:binary` dtype for Series. This enables the usage of arbitrary binaries.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Change DataFrame's `to_*` functions to return only `:ok`.\n- Change series inspect to resamble the dataframe inspect with the backend name.\n- Rename `Series.var/1` to `Series.variance/1`\n- Rename `Series.std/1` to `Series.standard_deviation/1`\n- Rename `Series.count/2` to `Series.frequencies/1` and add a new `Series.count/1`\n that returns the size of an \"eager\" series, or the count of members in a group\n for a lazy series.\n In case there is no groups, it calculates the size of the dataframe.\n- Change the option to control direction in `Series.sort/2` and `Series.argsort/2`.\n Instead of a boolean, now we have a new option called `:direction` that accepts\n `:asc` or `:desc`.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix the following DataFrame functions to work with groups:\n - `filter_with/2`\n - `head/2`\n - `tail/2`\n - `slice/2`\n - `slice/3`\n - `pivot_longer/3`\n - `pivot_wider/4`\n - `concat_rows/1`\n - `concat_columns/1`\n- Improve the documentation of functions that behave differently with groups.\n- Fix `arrange_with/2` to use \"group by\" stable, making results more predictable.\n- Add `nil` as a possible return value of aggregations.\n- Fix the behaviour of `Series.sort/2` and `Series.argsort/2` to add nils at the\n front when direction is descending, or at the back when the direction is ascending.\n This also adds an option to control this behaviour.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Removed - Changelog","doc":"- Remove support for `NDJSON` read and write for ARM 32 bits targets.\n This is due to a limitation of a dependency of Polars.\n\n## [v0.3.1] - 2022-09-09\n\n#","ref":"changelog.html#removed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Define `multiply` inside `*_with` operations.\n- Fix column types in several operations, such as `n_distinct`.\n\n## [v0.3.0] - 2022-09-01\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `DataFrame.concat_columns/1` and `DataFrame.concat_columns/2` for horizontally stacking\n dataframes.\n- Add compression as an option to write parquet files.\n- Add count metadata to `DataFrame` table reader.\n- Add `DataFrame.filter_with/2`, `DataFrame.summarise_with/2`, `DataFrame.mutate_with/2` and\n`DataFrame.arrange_with/2`. They all accept a `DataFrame` and a function, and they all work with\n a new concept called \"lazy series\".\n\n Lazy Series is an opaque representation of a series that can be\n used to perform complex operations without pulling data from the series. This is faster than\n using masks. There is no big difference from the API perspective compared to the functions that were\n accepting callbacks before (eg. `filter/2` and the new `filter_with/2`), with the exception being\n `DataFrame.summarise_with/2` that now accepts a lot more operations.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Bump version requirement of the `table` dependency to `~> 0.1.2`, and raise for non-tabular values.\n- Normalize how columns are handled. This changes some functions to accept one column or\na list of columns, ranges, indexes and callbacks selecting columns.\n- Rename `DataFrame.filter/2` to `DataFrame.mask/2`.\n- Rename `Series.filter/2` to `Series.mask/2`.\n- Rename `take/2` from both `Series` and `DataFrame` to `slice/2`. `slice/2` now they accept ranges as well.\n- Raise an error if `DataFrame.pivot_wider/4` has float columns as IDs. This is because we canĀ“t\nproperly compare floats.\n- Change `DataFrame.distinct/2` to accept columns as argument instead of receiving it as option.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Ensure that we can compare boolean series in functions like `Series.equal/2`.\n- Fix rename of columns after summarise.\n- Fix inspect of float series containing `NaN` or `Infinity` values. They are represented as atoms.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Deprecated - Changelog","doc":"- Deprecate `DataFrame.filter/2` with a callback in favor of `DataFrame.filter_with/2`.\n\n## [v0.2.0] - 2022-06-22\n\n#","ref":"changelog.html#deprecated"},{"type":"extras","title":"Added - Changelog","doc":"- Consistently support ranges throughout the columns API\n- Support negative indexes throughout the columns API\n- Integrate with the `table` package\n- Add `Series.to_enum/1` for lazily traversing the series\n- Add `Series.coalesce/1` and `Series.coalesce/2` for finding the first non-null value in a list of series\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- `Series.length/1` is now `Series.size/1` in keeping with Elixir idioms\n- `Nx` is now an optional dependency\n- Minimum Elixir version is now 1.13\n- `DataFrame.to_map/2` is now `DataFrame.to_columns/2` and `DataFrame.to_series/2`\n- `Rustler` is now an optional dependency\n- `read_` and `write_` IO functions are now `from_` and `to_`\n- `to_binary` is now `dump_csv`\n- Now uses `polars`'s \"simd\" feature\n- Now uses `polars`'s \"performant\" feature\n- `Explorer.default_backend/0` is now `Explorer.Backend.get/0`\n- `Explorer.default_backend/1` is now `Explorer.Backend.put/1`\n- `Series.cum_*` functions are now `Series.cumulative_*` to mirror `Nx`\n- `Series.rolling_*` functions are now `Series.window_*` to mirror `Nx`\n- `reverse?` is now an option instead of an argument in `Series.cumulative_*` functions\n- `DataFrame.from_columns/2` and `DataFrame.from_rows/2` is now `DataFrame.new/2`\n- Rename \"col\" to \"column\" throughout the API\n- Remove \"with\\_\" prefix in options throughout the API\n- `DataFrame.table/2` accepts options with `:limit` instead of single integer\n- `rename/2` no longer accepts a function, use `rename_with/2` instead\n- `rename_with/3` now expects the function as the last argument\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Explorer now works on Linux with musl\n\n## [v0.1.1] - 2022-04-27\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Security - Changelog","doc":"- Updated Rust dependencies to address Dependabot security alerts: [1](https://github.com/elixir-nx/explorer/security/dependabot/1), [2](https://github.com/elixir-nx/explorer/security/dependabot/3), [3](https://github.com/elixir-nx/explorer/security/dependabot/4)\n\n## [v0.1.0] - 2022-04-26\n\nFirst release.\n\n[Unreleased]: https://github.com/elixir-nx/explorer/compare/v0.6.1...HEAD\n[v0.6.1]: https://github.com/elixir-nx/explorer/compare/v0.6.0...v0.6.1\n[v0.6.0]: https://github.com/elixir-nx/explorer/compare/v0.5.7...v0.6.0\n[v0.5.7]: https://github.com/elixir-nx/explorer/compare/v0.5.6...v0.5.7\n[v0.5.6]: https://github.com/elixir-nx/explorer/compare/v0.5.5...v0.5.6\n[v0.5.5]: https://github.com/elixir-nx/explorer/compare/v0.5.4...v0.5.5\n[v0.5.4]: https://github.com/elixir-nx/explorer/compare/v0.5.3...v0.5.4\n[v0.5.3]: https://github.com/elixir-nx/explorer/compare/v0.5.2...v0.5.3\n[v0.5.2]: https://github.com/elixir-nx/explorer/compare/v0.5.1...v0.5.2\n[v0.5.1]: https://github.com/elixir-nx/explorer/compare/v0.5.0...v0.5.1\n[v0.5.0]: https://github.com/elixir-nx/explorer/compare/v0.4.0...v0.5.0\n[v0.4.0]: https://github.com/elixir-nx/explorer/compare/v0.3.1...v0.4.0\n[v0.3.1]: https://github.com/elixir-nx/explorer/compare/v0.3.0...v0.3.1\n[v0.3.0]: https://github.com/elixir-nx/explorer/compare/v0.2.0...v0.3.0\n[v0.2.0]: https://github.com/elixir-nx/explorer/compare/v0.1.1...v0.2.0\n[v0.1.1]: https://github.com/elixir-nx/explorer/compare/v0.1.0...v0.1.1\n[v0.1.0]: https://github.com/elixir-nx/explorer/releases/tag/v0.1.0","ref":"changelog.html#security"}],"content_type":"text/markdown"} \ No newline at end of file +searchData={"items":[{"type":"module","title":"Explorer","doc":"Explorer brings series (one-dimensional) and dataframes (two-dimensional) for fast\ndata exploration to Elixir.","ref":"Explorer.html"},{"type":"module","title":"Getting started - Explorer","doc":"Inside an Elixir script or [Livebook](https://livebook.dev):\n\n```elixir\nMix.install([\n {:explorer, \"~> 0.6.0\"}\n])\n```\n\nOr in the `mix.exs` file of your application:\n\n```elixir\ndef deps do\n [\n {:explorer, \"~> 0.6.0\"}\n ]\nend\n```","ref":"Explorer.html#module-getting-started"},{"type":"module","title":"A glimpse of the API - Explorer","doc":"We have two ways to represent data with Explorer:\n\n- using a series, that is similar to a list, but is guaranteed to contain items\n of one data type only - or one *dtype* for short. Notice that nil values are\n permitted in series of any dtype.\n\n- using a dataframe, that is just a way to represent one or more series together,\n and work with them as a whole. The only restriction is that all the series shares\n the same size.\n\nA series can be created from a list:\n\n```elixir\nfruits = Explorer.Series.from_list([\"apple\", \"mango\", \"banana\", \"orange\"])\n```\n\nYour newly created series is going to look like:\n\n```\n#Explorer.Series \n```\n\nAnd you can, for example, sort that series:\n\n```elixir\nExplorer.Series.sort(fruits)\n```\n\nResulting in the following:\n\n```\n#Explorer.Series \n```\n\n#","ref":"Explorer.html#module-a-glimpse-of-the-api"},{"type":"module","title":"Dataframes - Explorer","doc":"Dataframes can be created in two ways:\n\n- by reading from files or memory using the\n [IO functions](https://hexdocs.pm/explorer/Explorer.DataFrame.html#module-io-operations).\n This is by far the most common way to load dataframes in Explorer.\n We accept Parquet, IPC, CSV, and NDJSON files.\n\n- by using the `Explorer.DataFrame.new/2` function, that is neat for small experiments.\n We are going to use this function here.\n\nYou can pass either series or lists to it:\n\n```elixir\nmountains = Explorer.DataFrame.new(name: [\"Everest\", \"K2\", \"Aconcagua\"], elevation: [8848, 8611, 6962])\n```\n\nYour dataframe is going to look like this:\n\n```\n#Explorer.DataFrame \n```\n\nIt's also possible to see a dataframe like a table, using the `Explorer.DataFrame.table/2`\nfunction:\n\n```elixir\nExplorer.DataFrame.table(mountains)\n```\n\nPrints:\n\n```\n+-------------------------------------------+\n| Explorer DataFrame: [rows: 3, columns: 2] |\n+---------------------+---------------------+\n| name | elevation |\n| | |\n+=====================+=====================+\n| Everest | 8848 |\n+---------------------+---------------------+\n| K2 | 8611 |\n+---------------------+---------------------+\n| Aconcagua | 6962 |\n+---------------------+---------------------+\n```\n\nAnd now I want to show you how to filter our dataframe. But first, let's require\nthe `Explorer.DataFrame` module and give a short name to it:\n\n```elixir\nrequire Explorer.DataFrame, as: DF\n```\n\nThe \"require\" is needed to load the macro features of that module.\nWe give it a shorter name to simplify our examples.\n\nNow let's go to the filter. I want to filter the mountains that are above\nthe mean elevation in our dataframe:\n\n```elixir\nDF.filter(mountains, elevation > mean(elevation))\n```\n\nYou can see that we can refer to the columns using their names, and use functions\nwithout define them. This is possible due the powerful `Explorer.Query` features,\nand it's the main reason we need to \"require\" the `Explorer.DataFrame` module.\n\nThe result is going to look like this:\n\n```\n#Explorer.DataFrame \n```\n\nThere is an extensive guide that you can play with Livebook:\n[Ten Minutes to Explorer](https://hexdocs.pm/explorer/exploring_explorer.html)\n\nYou can also check the `Explorer.DataFrame` and `Explorer.Series` docs for further\ndetails.","ref":"Explorer.html#module-dataframes"},{"type":"module","title":"Features and design - Explorer","doc":"Explorer high-level features are:\n\n- Simply typed series: `:binary`, `:boolean`, `:category`, `:date`, `:datetime`, `:float`, `:integer`, `:string`, and `:time`.\n\n- A powerful but constrained and opinionated API, so you spend less time looking\n for the right function and more time doing data manipulation.\n\n- Pluggable backends, providing a uniform API whether you're working in-memory\n or (forthcoming) on remote databases or even Spark dataframes.\n\n- The first (and default) backend is based on NIF bindings to the blazing-fast\n [polars](https://docs.rs/polars) library.\n\nThe API is heavily influenced by [Tidy Data](https://vita.had.co.nz/papers/tidy-data.pdf)\nand borrows much of its design from [dplyr](https://dplyr.tidyverse.org). The philosophy\nis heavily influenced by this passage from `dplyr`'s documentation:\n\n> - By constraining your options, it helps you think about your data manipulation\n> challenges.\n>\n> - It provides simple ā€œverbsā€, functions that correspond to the most common data\n> manipulation tasks, to help you translate your thoughts into code.\n>\n> - It uses efficient backends, so you spend less time waiting for the computer.\n\nThe aim here isn't to have the fastest dataframe library around (though it certainly\nhelps that [we're building on Polars, one of the fastest](https://h2oai.github.io/db-benchmark/)).\nInstead, we're aiming to bridge the best of many worlds:\n\n- the elegance of `dplyr`\n- the speed of `polars`\n- the joy of Elixir\n\nThat means you can expect the guiding principles to be 'Elixir-ish'. For example,\nyou won't see the underlying data mutated, even if that's the most efficient implementation.\nExplorer functions will always return a new dataframe or series.","ref":"Explorer.html#module-features-and-design"},{"type":"module","title":"Explorer.DataFrame","doc":"The DataFrame struct and API.\n\nDataframes are two-dimensional tabular data structures similar to a spreadsheet.\nFor example, the Iris dataset:\n\n iex> Explorer.Datasets.iris()\n #Explorer.DataFrame \n\nThis dataframe has 150 rows and five columns. Each column is an `Explorer.Series`\nof the same size (150):\n\n iex> df = Explorer.Datasets.iris()\n iex> df[\"sepal_length\"]\n #Explorer.Series","ref":"Explorer.DataFrame.html"},{"type":"module","title":"Creating dataframes - Explorer.DataFrame","doc":"Dataframes can be created from normal Elixir terms. The main way you might do this is\nwith the `new/1` function. For example:\n\n iex> Explorer.DataFrame.new(a: [\"a\", \"b\"], b: [1, 2])\n #Explorer.DataFrame \n\nOr with a list of maps:\n\n iex> Explorer.DataFrame.new([%{\"col1\" => \"a\", \"col2\" => 1}, %{\"col1\" => \"b\", \"col2\" => 2}])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#module-creating-dataframes"},{"type":"module","title":"Verbs - Explorer.DataFrame","doc":"Explorer uses the idea of a consistent set of SQL-like `verbs` like\n[`dplyr`](https://dplyr.tidyverse.org) which can help solve common\ndata manipulation challenges. These are split into single table verbs,\nmultiple table verbs, and row-based verbs:\n\n#","ref":"Explorer.DataFrame.html#module-verbs"},{"type":"module","title":"Single table verbs - Explorer.DataFrame","doc":"Single table verbs are (unsurprisingly) used for manipulating a single dataframe.\nThose operations typically driven by column names. These are:\n\n- `select/2` for picking columns and `discard/2` to discard them\n- `filter/2` for picking rows based on predicates\n- `mutate/2` for adding or replacing columns that are functions of existing columns\n- `arrange/2` for changing the ordering of rows\n- `distinct/2` for picking unique rows\n- `summarise/2` for reducing multiple rows down to a single summary\n- `pivot_longer/3` and `pivot_wider/4` for massaging dataframes into longer or\n wider forms, respectively\n\nEach of these combine with `Explorer.DataFrame.group_by/2` for operating by group.\n\n#","ref":"Explorer.DataFrame.html#module-single-table-verbs"},{"type":"module","title":"Multiple table verbs - Explorer.DataFrame","doc":"Multiple table verbs are used for combining tables. These are:\n\n- `join/3` for performing SQL-like joins\n- `concat_columns/1` for horizontally \"stacking\" dataframes\n- `concat_rows/1` for vertically \"stacking\" dataframes\n\n#","ref":"Explorer.DataFrame.html#module-multiple-table-verbs"},{"type":"module","title":"Row-based verbs - Explorer.DataFrame","doc":"Those operations are driven by the row index. These are:\n\n- `head/2` for picking the first rows\n- `tail/2` for picking the last rows\n- `slice/2` for slicing the dataframe by row indexes or a range\n- `slice/3` for slicing a section by an offset\n- `sample/2` for sampling the data-frame by row","ref":"Explorer.DataFrame.html#module-row-based-verbs"},{"type":"module","title":"IO operations - Explorer.DataFrame","doc":"Explorer supports reading and writing of:\n\n- delimited files (such as CSV or TSV)\n- [Parquet](https://databricks.com/glossary/what-is-parquet)\n- [Arrow IPC](https://arrow.apache.org/docs/format/Columnar.html#ipc-file-format)\n- [Arrow Streaming IPC](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format)\n- [Newline Delimited JSON](http://ndjson.org)\n- Databases via `Adbc` in `from_query/3`\n\nThe convention Explorer uses is to have `from_*` and `to_*` functions to read and write\nto files in the formats above. `load_*` and `dump_*` versions are also available to read\nand write those formats directly in memory.\n\nFiles can be fetched from local or remote file system, such as S3, using the following formats:\n\n # path to a file in disk\n Explorer.DataFrame.from_parquet(\"/path/to/file.parquet\")\n\n # path to a URL schema (with optional configuration)\n Explorer.DataFrame.from_parquet(\"s3://bucket/file.parquet\", config: FSS.S3.config_from_system_env())\n\n # it's possible to configure using keyword lists\n Explorer.DataFrame.from_parquet(\"s3://bucket/file.parquet\", config: [access_key_id: \"my-key\", secret_access_key: \"my-secret\"])\n\n # a FSS entry (it already includes its config)\n Explorer.DataFrame.from_parquet(FSS.S3.parse(\"s3://bucket/file.parquet\"))\n\nThe `:config` option of `from_*` functions is only required if the filename is a path\nto a remote resource. In case it's a FSS entry, the requirement is that the config is passed\ninside the entry struct.","ref":"Explorer.DataFrame.html#module-io-operations"},{"type":"module","title":"Selecting columns and access - Explorer.DataFrame","doc":"Several functions in this module, such as `select/2`, `discard/2`, `drop_nil/2`, and so\nforth accept a single or multiple columns as arguments. The columns can be specified in\na variety of formats, which we describe below.\n\n`Explorer.DataFrame` also implements the `Access` behaviour (also known as the brackets\nsyntax). This should be familiar for users coming from other language with dataframes\nsuch as R or Python. For example:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[\"class\"]\n #Explorer.Series \n\nAccessing the dataframe with a column name either as a string or an atom, will return\nthe column. You can also pass an integer representing the column order:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[0]\n #Explorer.Series \n\nYou can also pass a list, a range, or a regex to return a dataframe matching\nthe given data type. For example, by passing a list:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[[\"class\", \"hue\"]]\n #Explorer.DataFrame \n\nOr a range for the given positions:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[0..2]\n #Explorer.DataFrame \n\nOr a regex to keep only columns matching a given pattern:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[~r/(class|hue)/]\n #Explorer.DataFrame \n\nGiven you can also access a series using its index, you can use\nmultiple accesses to select a column and row at the same time:\n\n iex> df = Explorer.Datasets.wine()\n iex> df[\"class\"][3]\n 1","ref":"Explorer.DataFrame.html#module-selecting-columns-and-access"},{"type":"macro","title":"Explorer.DataFrame.arrange/2","doc":"Arranges/sorts rows by columns using `Explorer.Query`.\n\n> ##","ref":"Explorer.DataFrame.html#arrange/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.arrange/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nSee `arrange_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#arrange/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.arrange/2","doc":"A single column name will sort ascending by that column:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange(df, a)\n #Explorer.DataFrame \n\nYou can also sort descending:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange(df, desc: a)\n #Explorer.DataFrame \n\nSorting by more than one column sorts them in the order they are entered:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.arrange(df, asc: total, desc: country)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.arrange/2","doc":"When used in a grouped dataframe, arrange is going to sort each group individually and\nthen return the entire dataframe with the existing groups. If one of the arrange columns\nis also a group, the sorting for that column is not going to work. It is necessary to\nfirst summarise the desired column and then arrange it.\n\nHere is an example using the Iris dataset. We group by species and then we try to sort\nthe dataframe by species and petal length, but only \"petal length\" is taken into account\nbecause \"species\" is a group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.arrange(grouped, desc: species, asc: sepal_width)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.arrange_with/2","doc":"Arranges/sorts rows by columns using a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe does\nhold any values, instead it stores all operations in order to\nexecute all sorting performantly.\n\nThis is a callback version of `arrange/2`.\n\nSorting is stable by default.","ref":"Explorer.DataFrame.html#arrange_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.arrange_with/2","doc":"A single column name will sort ascending by that column:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange_with(df, &(&1[\"a\"]))\n #Explorer.DataFrame \n\nYou can also sort descending:\n\n iex> df = Explorer.DataFrame.new(a: [\"b\", \"c\", \"a\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.arrange_with(df, &[desc: &1[\"a\"]])\n #Explorer.DataFrame \n\nSorting by more than one column sorts them in the order they are entered:\n\n iex> df = Explorer.DataFrame.new(a: [3, 1, 3], b: [2, 1, 3])\n iex> Explorer.DataFrame.arrange_with(df, &[desc: &1[\"a\"], asc: &1[\"b\"]])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.arrange_with/2","doc":"iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.arrange_with(grouped, &[desc: &1[\"species\"], asc: &1[\"sepal_width\"]])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#arrange_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.collect/1","doc":"This collects the lazy data frame into an eager one, computing the query.\n\nIf already eager, this is a noop.\n\nCollecting a grouped dataframe should return a grouped dataframe.","ref":"Explorer.DataFrame.html#collect/1"},{"type":"function","title":"Explorer.DataFrame.concat_columns/1","doc":"Combine two or more dataframes column-wise.\n\nThis function expects the dataframes to have the same number of rows,\notherwise rows may be silently discarded. Eager backends may check\nwhenever this happens and raise instead of silently fail. But this may not\nbe possible for lazy dataframes as the number of rows is not known upfront.\n\nWhen working with grouped dataframes, be aware that only groups from the first\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_columns/1"},{"type":"function","title":"Examples - Explorer.DataFrame.concat_columns/1","doc":"iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(z: [4, 5, 6], a: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_columns([df1, df2])\n #Explorer.DataFrame \n\nConflicting names are suffixed with the index of the dataframe in the array:\n\n iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], a: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_columns([df1, df2])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#concat_columns/1-examples"},{"type":"function","title":"Explorer.DataFrame.concat_columns/2","doc":"Combine two dataframes column-wise.\n\nWhen working with grouped dataframes, be aware that only groups from the left-hand side\ndataframe are kept in the resultant dataframe.\n\n`concat_columns(df1, df2)` is equivalent to `concat_columns([df1, df2])`.","ref":"Explorer.DataFrame.html#concat_columns/2"},{"type":"function","title":"Explorer.DataFrame.concat_rows/1","doc":"Combine two or more dataframes row-wise (stack).\n\nColumn names and dtypes must match. The only exception is for numeric\ncolumns that can be mixed together, and casted automatically to float columns.\n\nWhen working with grouped dataframes, be aware that only groups from the first\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_rows/1"},{"type":"function","title":"Examples - Explorer.DataFrame.concat_rows/1","doc":"iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4, 5, 6], y: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_rows([df1, df2])\n #Explorer.DataFrame \n\n iex> df1 = Explorer.DataFrame.new(x: [1, 2, 3], y: [\"a\", \"b\", \"c\"])\n iex> df2 = Explorer.DataFrame.new(x: [4.2, 5.3, 6.4], y: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.concat_rows([df1, df2])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#concat_rows/1-examples"},{"type":"function","title":"Explorer.DataFrame.concat_rows/2","doc":"Combine two dataframes row-wise.\n\n`concat_rows(df1, df2)` is equivalent to `concat_rows([df1, df2])`.\n\nWhen working with grouped dataframes, be aware that only groups from the left-hand side\ndataframe are kept in the resultant dataframe.","ref":"Explorer.DataFrame.html#concat_rows/2"},{"type":"function","title":"Explorer.DataFrame.describe/2","doc":"Describe numeric columns of a DataFrame.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#describe/2"},{"type":"function","title":"Options - Explorer.DataFrame.describe/2","doc":"* `:percentiles` - Floating point list with the percentiles to be calculated. (default: `[0.25, 0.5, 0.75]`)","ref":"Explorer.DataFrame.html#describe/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.describe/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [1, 2, 3], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.describe(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [1, 2, 3], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.describe(df, percentiles: [0.3, 0.5, 0.8])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#describe/2-examples"},{"type":"function","title":"Explorer.DataFrame.discard/2","doc":"Discards a subset of columns by name.\n\nIt's important to notice that groups are kept:\nyou can't discard grouping columns.","ref":"Explorer.DataFrame.html#discard/2"},{"type":"function","title":"Examples - Explorer.DataFrame.discard/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.discard(df, [\"b\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.discard(df, [\"a\", \"b\"])\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#discard/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.discard/2","doc":"You cannot discard grouped columns. You need to ungroup before removing them:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.discard(grouped, [\"species\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#discard/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.distinct/3","doc":"Takes distinct rows by a selection of columns.\n\nDistinct is not affected by groups, although groups are kept in the\ncolumns selection if `keep_all` option is false (the default).","ref":"Explorer.DataFrame.html#distinct/3"},{"type":"function","title":"Options - Explorer.DataFrame.distinct/3","doc":"* `:keep_all` - If set to `true`, keep all columns. Default is `false`.","ref":"Explorer.DataFrame.html#distinct/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.distinct/3","doc":"By default will return unique values of the requested columns:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.distinct(df, [\"year\", \"country\"])\n #Explorer.DataFrame \n\nIf `keep_all` is set to `true`, then the first value of each column not in the requested\ncolumns will be returned:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.distinct(df, [\"year\", \"country\"], keep_all: true)\n #Explorer.DataFrame \n\nA callback on the dataframe's names can be passed instead of a list (like `select/2`):\n\n iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: [\"a\", \"c\", \"c\"], y1: [1, 2, 3])\n iex> Explorer.DataFrame.distinct(df, &String.starts_with?(&1, \"x\"))\n #Explorer.DataFrame \n\nIf the dataframe has groups, then the columns of each group will be added to the distinct columns:\n\n iex> df = Explorer.DataFrame.new(x1: [1, 3, 3], x2: [\"a\", \"c\", \"c\"], y1: [1, 2, 3])\n iex> df = Explorer.DataFrame.group_by(df, \"x1\")\n iex> Explorer.DataFrame.distinct(df, [\"x2\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#distinct/3-examples"},{"type":"function","title":"Explorer.DataFrame.drop_nil/2","doc":"Drop nil values.\n\nOptionally accepts a subset of columns.","ref":"Explorer.DataFrame.html#drop_nil/2"},{"type":"function","title":"Examples - Explorer.DataFrame.drop_nil/2","doc":"To drop nils on all columns:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])\n iex> Explorer.DataFrame.drop_nil(df)\n #Explorer.DataFrame \n\n To drop nils on a single column:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3])\n iex> Explorer.DataFrame.drop_nil(df, :a)\n #Explorer.DataFrame \n\nTo drop some columns:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, nil], b: [1, nil, 3], c: [nil, 5, 6])\n iex> Explorer.DataFrame.drop_nil(df, [:a, :c])\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#drop_nil/2-examples"},{"type":"function","title":"Explorer.DataFrame.dtypes/1","doc":"Gets the dtypes of the dataframe columns.","ref":"Explorer.DataFrame.html#dtypes/1"},{"type":"function","title":"Examples - Explorer.DataFrame.dtypes/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])\n iex> Explorer.DataFrame.dtypes(df)\n %{\"floats\" => :float, \"ints\" => :integer}","ref":"Explorer.DataFrame.html#dtypes/1-examples"},{"type":"function","title":"Explorer.DataFrame.dummies/2","doc":"Turns a set of columns to dummy variables.\n\nIn case the dataframe is using groups, all groups will be removed.","ref":"Explorer.DataFrame.html#dummies/2"},{"type":"function","title":"Examples - Explorer.DataFrame.dummies/2","doc":"To mark a single column as dummy:\n\n iex> df = Explorer.DataFrame.new(col_x: [\"a\", \"b\", \"a\", \"c\"], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, \"col_x\")\n #Explorer.DataFrame \n\nOr multiple columns:\n\n iex> df = Explorer.DataFrame.new(col_x: [\"a\", \"b\", \"a\", \"c\"], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, [\"col_x\", \"col_y\"])\n #Explorer.DataFrame \n\nOr all string columns:\n\n iex> df = Explorer.DataFrame.new(num: [1, 2, 3, 4], col_y: [\"b\", \"a\", \"b\", \"d\"])\n iex> Explorer.DataFrame.dummies(df, fn _name, type -> type == :string end)\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#dummies/2-examples"},{"type":"function","title":"Explorer.DataFrame.dump_csv/2","doc":"Writes a dataframe to a binary representation of a delimited file.","ref":"Explorer.DataFrame.html#dump_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_csv/2","doc":"* `:header` - Should the column names be written as the first line of the file? (default: `true`)\n * `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)","ref":"Explorer.DataFrame.html#dump_csv/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.dump_csv/2","doc":"iex> df = Explorer.Datasets.fossil_fuels() |> Explorer.DataFrame.head(2)\n iex> Explorer.DataFrame.dump_csv(df)\n {:ok, \"year,country,total,solid_fuel,liquid_fuel,gas_fuel,cement,gas_flaring,per_capita,bunker_fuels\\n2010,AFGHANISTAN,2308,627,1601,74,5,0,0.08,9\\n2010,ALBANIA,1254,117,953,7,177,0,0.43,7\\n\"}","ref":"Explorer.DataFrame.html#dump_csv/2-examples"},{"type":"function","title":"Explorer.DataFrame.dump_csv!/2","doc":"Similar to `dump_csv/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_csv!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ipc/2","doc":"Writes a dataframe to a binary representation of an IPC file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_ipc/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.","ref":"Explorer.DataFrame.html#dump_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_ipc!/2","doc":"Similar to `dump_ipc/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ipc_stream/2","doc":"Writes a dataframe to a binary representation of an IPC Stream file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_ipc_stream/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.","ref":"Explorer.DataFrame.html#dump_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_ipc_stream!/2","doc":"Similar to `dump_ipc_stream/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.dump_ndjson/1","doc":"Writes a dataframe to a binary representation of a NDJSON file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_ndjson/1"},{"type":"function","title":"Examples - Explorer.DataFrame.dump_ndjson/1","doc":"iex> df = Explorer.DataFrame.new(col_a: [1, 2], col_b: [5.1, 5.2])\n iex> Explorer.DataFrame.dump_ndjson(df)\n {:ok, ~s({\"col_a\":1,\"col_b\":5.1}\\n{\"col_a\":2,\"col_b\":5.2}\\n)}","ref":"Explorer.DataFrame.html#dump_ndjson/1-examples"},{"type":"function","title":"Explorer.DataFrame.dump_ndjson!/1","doc":"Similar to `dump_ndjson!/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_ndjson!/1"},{"type":"function","title":"Explorer.DataFrame.dump_parquet/2","doc":"Writes a dataframe to a binary representation of a Parquet file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#dump_parquet/2"},{"type":"function","title":"Options - Explorer.DataFrame.dump_parquet/2","doc":"* `:compression` - The compression algorithm to use when writing files.\n Where a compression level is available, this can be passed as a tuple,\n such as `{:zstd, 3}`. Supported options are:\n\n * `nil` (uncompressed, default)\n * `:snappy`\n * `:gzip` (with levels 1-9)\n * `:brotli` (with levels 1-11)\n * `:zstd` (with levels -7-22)\n * `:lz4raw`.","ref":"Explorer.DataFrame.html#dump_parquet/2-options"},{"type":"function","title":"Explorer.DataFrame.dump_parquet!/2","doc":"Similar to `dump_parquet/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#dump_parquet!/2"},{"type":"macro","title":"Explorer.DataFrame.filter/2","doc":"Picks rows based on `Explorer.Query`.\n\nThe query is compiled and runs efficiently against the dataframe.\nThe query must return a boolean expression or a list of boolean expressions.\nWhen a list is returned, they are joined as `and` expressions.\n\n> ##","ref":"Explorer.DataFrame.html#filter/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.filter/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nBesides element-wise series operations, you can also use window functions\nand aggregations inside comparisons. In such cases, grouped dataframes\nmay have different results than ungrouped ones, because the filtering\nis computed withing groups. See examples below.\n\nSee `filter_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#filter/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.filter/2","doc":"iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col2 > 2)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col1 == \"b\")\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [5, 4, 3], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, [col1 > 3, col2 \n\nReturning a non-boolean expression errors:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, cumulative_max(col2))\n ** (ArgumentError) expecting the function to return a boolean LazySeries, but instead it returned a LazySeries of type :integer\n\nWhich can be addressed by converting it to boolean:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, cumulative_max(col2) == 1)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.filter/2","doc":"In a grouped dataframe, the aggregation is calculated within each group.\n\nIn the following example we select the flowers of the Iris dataset that have the \"petal length\"\nabove the average of each species group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.filter(grouped, petal_length > mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.filter_with/2","doc":"Picks rows based on a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe does\nnot hold any values, instead it stores all operations in order to\nexecute all filtering performantly.\n\nThis is a callback version of `filter/2`.","ref":"Explorer.DataFrame.html#filter_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.filter_with/2","doc":"iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1[\"col2\"], 2))\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.equal(df[\"col1\"], \"b\") end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.filter_with/2","doc":"In a grouped dataframe, the aggregation is calculated within each group.\n\nIn the following example we select the flowers of the Iris dataset that have the \"petal length\"\nabove the average of each species group.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.filter_with(grouped, &Explorer.Series.greater(&1[\"petal_length\"], Explorer.Series.mean(&1[\"petal_length\"])))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#filter_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.frequencies/2","doc":"Creates a new dataframe with unique rows and the frequencies of each.","ref":"Explorer.DataFrame.html#frequencies/2"},{"type":"function","title":"Examples - Explorer.DataFrame.frequencies/2","doc":"iex> df = Explorer.DataFrame.new(a: [\"a\", \"a\", \"b\"], b: [1, 1, nil])\n iex> Explorer.DataFrame.frequencies(df, [:a, :b])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#frequencies/2-examples"},{"type":"function","title":"Explorer.DataFrame.from_csv/2","doc":"Reads a delimited file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.\n\nIf the CSV is compressed, it is automatically decompressed.","ref":"Explorer.DataFrame.html#from_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_csv/2","doc":"* `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\n * `:dtypes` - A list/map of `{\"column_name\", dtype}` tuples. Any non-specified column has its type\n imputed from the first 1000 rows. (default: `[]`)\n\n * `:header` - Does the file have a header of column names as the first row or not? (default: `true`)\n\n * `:max_rows` - Maximum number of lines to read. (default: `nil`)\n\n * `:nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n\n * `:skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n\n * `:columns` - A list of column names or indexes to keep.\n If present, only these columns are read into the dataframe. (default: `nil`)\n\n * `:infer_schema_length` Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:parse_dates` - Automatically try to parse dates/ datetimes and time.\n If parsing fails, columns remain of dtype `string`\n\n * `:eol_delimiter` - A single character used to represent new lines. (default: `\"\n\"`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_csv/2-options"},{"type":"function","title":"Explorer.DataFrame.from_csv!/2","doc":"Similar to `from_csv/2` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#from_csv!/2"},{"type":"function","title":"Explorer.DataFrame.from_ipc/2","doc":"Reads an IPC file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.","ref":"Explorer.DataFrame.html#from_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ipc/2","doc":"* `:columns` - List with the name or index of columns to be selected.\n Defaults to all columns.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ipc!/2","doc":"Similar to `from_ipc/2` but raises if there is a problem reading the IPC file.","ref":"Explorer.DataFrame.html#from_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.from_ipc_stream/2","doc":"Reads an IPC Streaming file into a dataframe.\n\nIt's possible to read from an IPC Streaming file using the lazy Polars\nbackend, but the implementation is not truly lazy. We are going to read it\nfirst using the eager backend, and then convert the dataframe to lazy.","ref":"Explorer.DataFrame.html#from_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ipc_stream/2","doc":"* `:columns` - List with the name or index of columns to be selected.\n Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#from_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ipc_stream!/2","doc":"Similar to `from_ipc_stream/2` but raises if there is a problem reading the IPC Stream file.","ref":"Explorer.DataFrame.html#from_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.from_ndjson/2","doc":"Read a file of JSON objects or lists separated by new lines","ref":"Explorer.DataFrame.html#from_ndjson/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_ndjson/2","doc":"* `:batch_size` - Sets the batch size for reading rows.\n This value may have significant impact in performance,\n so adjust it for your needs (default: `1000`).\n\n * `:infer_schema_length` - Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#from_ndjson/2-options"},{"type":"function","title":"Explorer.DataFrame.from_ndjson!/2","doc":"Similar to `from_ndjson/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#from_ndjson!/2"},{"type":"function","title":"Explorer.DataFrame.from_parquet/2","doc":"Reads a parquet file into a dataframe.\n\nIt accepts a filename that can be a local file, a \"s3://\" schema, or\na `FSS` entry like `FSS.S3.Entry`.","ref":"Explorer.DataFrame.html#from_parquet/2"},{"type":"function","title":"Options - Explorer.DataFrame.from_parquet/2","doc":"* `:max_rows` - Maximum number of lines to read. (default: `nil`)\n\n * `:columns` - A list of column names or indexes to keep. If present,\n only these columns are read into the dataframe. (default: `nil`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_parquet/2-options"},{"type":"function","title":"Explorer.DataFrame.from_parquet!/2","doc":"Similar to `from_parquet/2` but raises if there is a problem reading the Parquet file.","ref":"Explorer.DataFrame.html#from_parquet!/2"},{"type":"function","title":"Explorer.DataFrame.from_query/4","doc":"Reads data from a query.\n\n`conn` must be a `Adbc.Connection` process. `sql` is a string representing\nthe sql query and `params` is the list of query parameters. See `Adbc`\nfor more information.","ref":"Explorer.DataFrame.html#from_query/4"},{"type":"function","title":"Example - Explorer.DataFrame.from_query/4","doc":"In order to read data from a database, you must list `:adbc` as a dependency,\ndownload the relevant driver, and start both database and connection processes\nin your supervision tree.\n\nFirst, add `:adbc` as a dependency in your `mix.exs`:\n\n {:adbc, \"~> 0.1\"}\n\nNow, in your config/config.exs, configure the drivers you are going to use\n(see `Adbc` module docs for more information on supported drivers):\n\n config :adbc, :drivers, [:sqlite]\n\nIf you are using a notebook or scripting, you can also use `Adbc.download_driver!/1`\nto dynamically download one.\n\nThen start the database and the relevant connection processes in your\nsupervision tree:\n\n children = [\n {Adbc.Database,\n driver: :sqlite,\n process_options: [name: MyApp.DB]},\n {Adbc.Connection,\n database: MyApp.DB,\n process_options: [name: MyApp.Conn]}\n ]\n\n Supervisor.start_link(children, strategy: :one_for_one)\n\nIn a notebook, the above would look like this:\n\n db = Kino.start_child!({Adbc.Database, driver: :sqlite})\n conn = Kino.start_child!({Adbc.Connection, database: db})\n\nAnd now you can make queries with:\n\n # For named connections\n {:ok, _} = Explorer.DataFrame.from_query(MyApp.Conn, \"SELECT 123\")\n\n # When using the conn PID directly\n {:ok, _} = Explorer.DataFrame.from_query(conn, \"SELECT 123\")","ref":"Explorer.DataFrame.html#from_query/4-example"},{"type":"function","title":"Options - Explorer.DataFrame.from_query/4","doc":"* `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#from_query/4-options"},{"type":"function","title":"Explorer.DataFrame.from_query!/4","doc":"Similar to `from_query/4` but raises if there is an error.","ref":"Explorer.DataFrame.html#from_query!/4"},{"type":"function","title":"Explorer.DataFrame.group_by/2","doc":"Group the dataframe by one or more variables.\n\nWhen the dataframe has grouping variables, operations are performed per group.\n`Explorer.DataFrame.ungroup/2` removes grouping.","ref":"Explorer.DataFrame.html#group_by/2"},{"type":"function","title":"Examples - Explorer.DataFrame.group_by/2","doc":"You can group by a single variable:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, \"country\")\n #Explorer.DataFrame \n\nOr you can group by multiple columns in a given list:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n #Explorer.DataFrame \n\nOr by a range:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.group_by(df, 0..1)\n #Explorer.DataFrame \n\nRegexes and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#group_by/2-examples"},{"type":"function","title":"Explorer.DataFrame.groups/1","doc":"Returns the groups of a dataframe.","ref":"Explorer.DataFrame.html#groups/1"},{"type":"function","title":"Examples - Explorer.DataFrame.groups/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, \"country\")\n iex> Explorer.DataFrame.groups(df)\n [\"country\"]\n\n iex> df = Explorer.Datasets.iris()\n iex> Explorer.DataFrame.groups(df)\n []","ref":"Explorer.DataFrame.html#groups/1-examples"},{"type":"function","title":"Explorer.DataFrame.head/2","doc":"Returns the first *n* rows of the dataframe.\n\nBy default it returns the first 5 rows.\n\nIf the dataframe is using groups, then the first *n* rows of each group is\nreturned.","ref":"Explorer.DataFrame.html#head/2"},{"type":"function","title":"Examples - Explorer.DataFrame.head/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.head(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.head(df, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#head/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.head/2","doc":"Using grouped dataframes makes `head/2` return *n* rows from each group.\nHere is an example using the Iris dataset, and returning two rows from each group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.head(grouped, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#head/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.join/3","doc":"Join two tables.","ref":"Explorer.DataFrame.html#join/3"},{"type":"function","title":"Join types - Explorer.DataFrame.join/3","doc":"* `:inner` - Returns all rows from `left` where there are matching values in `right`, and all columns from `left` and `right`.\n * `:left` - Returns all rows from `left` and all columns from `left` and `right`. Rows in `left` with no match in `right` will have `nil` values in the new columns.\n * `:right` - Returns all rows from `right` and all columns from `left` and `right`. Rows in `right` with no match in `left` will have `nil` values in the new columns.\n * `:outer` - Returns all rows and all columns from both `left` and `right`. Where there are not matching values, returns `nil` for the one missing.\n * `:cross` - Also known as a cartesian join. Returns all combinations of `left` and `right`. Can be very computationally expensive.","ref":"Explorer.DataFrame.html#join/3-join-types"},{"type":"function","title":"Options - Explorer.DataFrame.join/3","doc":"* `:on` - The columns to join on. Defaults to overlapping columns. Does not apply to cross join.\n * `:how` - One of the join types (as an atom) described above. Defaults to `:inner`.","ref":"Explorer.DataFrame.html#join/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.join/3","doc":"Inner join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right)\n #Explorer.DataFrame \n\nLeft join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :left)\n #Explorer.DataFrame \n\nRight join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :right)\n #Explorer.DataFrame \n\nOuter join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :outer)\n #Explorer.DataFrame \n\nCross join:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, how: :cross)\n #Explorer.DataFrame \n\nInner join with different names:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(d: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> Explorer.DataFrame.join(left, right, on: [{\"a\", \"d\"}])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#join/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.join/3","doc":"When doing a join operation with grouped dataframes, the joined dataframe\nmay keep the groups from only one side.\n\nAn inner join operation will keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right)\n #Explorer.DataFrame \n\nA left join operation will keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 2], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :left)\n #Explorer.DataFrame \n\nA right join operation will keep the groups from the right-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :right)\n #Explorer.DataFrame \n\nAn outer join operation is going to keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :outer)\n #Explorer.DataFrame \n\nA cross join operation is going to keep the groups from the left-hand side dataframe:\n\n iex> left = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> right = Explorer.DataFrame.new(a: [1, 2, 4], c: [\"d\", \"e\", \"f\"])\n iex> grouped_left = Explorer.DataFrame.group_by(left, \"b\")\n iex> grouped_right = Explorer.DataFrame.group_by(right, \"c\")\n iex> Explorer.DataFrame.join(grouped_left, grouped_right, how: :cross)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#join/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.load_csv/2","doc":"Reads a representation of a CSV file into a dataframe.\n\nIf the CSV is compressed, it is automatically decompressed.","ref":"Explorer.DataFrame.html#load_csv/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_csv/2","doc":"* `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n * `:dtypes` - A list/map of `{\"column_name\", dtype}` tuples. Any non-specified column has its type\n imputed from the first 1000 rows. (default: `[]`)\n * `:header` - Does the file have a header of column names as the first row or not? (default: `true`)\n * `:max_rows` - Maximum number of lines to read. (default: `nil`)\n * `:nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n * `:skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n * `:columns` - A list of column names or indexes to keep. If present, only these columns are read into the dataframe. (default: `nil`)\n * `:infer_schema_length` Maximum number of rows read for schema inference. Setting this to nil will do a full table scan and will be slow (default: `1000`).\n * `:parse_dates` - Automatically try to parse dates/ datetimes and time. If parsing fails, columns remain of dtype `string`\n * `:eol_delimiter` - A single character used to represent new lines. (default: `\"\n\"`)\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_csv/2-options"},{"type":"function","title":"Explorer.DataFrame.load_csv!/2","doc":"Similar to `load_csv/2` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#load_csv!/2"},{"type":"function","title":"Explorer.DataFrame.load_ipc/2","doc":"Reads a binary representing an IPC file into a dataframe.","ref":"Explorer.DataFrame.html#load_ipc/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ipc/2","doc":"* `:columns` - List with the name or index of columns to be selected. Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ipc/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ipc!/2","doc":"Similar to `load_ipc/2` but raises if there is a problem reading the IPC file.","ref":"Explorer.DataFrame.html#load_ipc!/2"},{"type":"function","title":"Explorer.DataFrame.load_ipc_stream/2","doc":"Reads a binary representing an IPC Stream file into a dataframe.","ref":"Explorer.DataFrame.html#load_ipc_stream/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ipc_stream/2","doc":"* `:columns` - List with the name or index of columns to be selected. Defaults to all columns.\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ipc_stream/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ipc_stream!/2","doc":"Similar to `load_ipc_stream/2` but raises if there is a problem.","ref":"Explorer.DataFrame.html#load_ipc_stream!/2"},{"type":"function","title":"Explorer.DataFrame.load_ndjson/2","doc":"Reads a representation of a NDJSON file into a dataframe.","ref":"Explorer.DataFrame.html#load_ndjson/2"},{"type":"function","title":"Options - Explorer.DataFrame.load_ndjson/2","doc":"* `:batch_size` - Sets the batch size for reading rows.\n This value may have significant impact in performance,\n so adjust it for your needs (default: `1000`).\n\n * `:infer_schema_length` - Maximum number of rows read for schema inference.\n Setting this to nil will do a full table scan and will be slow (default: `1000`).\n\n * `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n\n * `:lazy` - force the results into the lazy version of the current backend.","ref":"Explorer.DataFrame.html#load_ndjson/2-options"},{"type":"function","title":"Explorer.DataFrame.load_ndjson!/2","doc":"Similar to `load_ndjson/2`, but raises in case of error.","ref":"Explorer.DataFrame.html#load_ndjson!/2"},{"type":"function","title":"Examples - Explorer.DataFrame.load_ndjson!/2","doc":"iex> contents = ~s({\"col_a\":1,\"col_b\":5.1}\\n{\"col_a\":2,\"col_b\":5.2}\\n)\n iex> Explorer.DataFrame.load_ndjson!(contents)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#load_ndjson!/2-examples"},{"type":"function","title":"Explorer.DataFrame.load_parquet/2","doc":"Reads a binary representation of a parquet file into a dataframe.","ref":"Explorer.DataFrame.html#load_parquet/2"},{"type":"function","title":"Explorer.DataFrame.load_parquet!/2","doc":"Similar to `load_parquet/2` but raises if there is a problem reading the Parquet file.","ref":"Explorer.DataFrame.html#load_parquet!/2"},{"type":"function","title":"Explorer.DataFrame.mask/2","doc":"Picks rows based on a list or series of values.","ref":"Explorer.DataFrame.html#mask/2"},{"type":"function","title":"Examples - Explorer.DataFrame.mask/2","doc":"This function must only be used when you need to select rows based\non external values that are not available to the dataframe. For example,\nyou can pass a list:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.mask(df, [false, true, false])\n #Explorer.DataFrame \n\nYou must avoid using masks when the masks themselves are computed from\nother columns. For example, DO NOT do this:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.mask(df, Explorer.Series.greater(df[\"col2\"], 1))\n #Explorer.DataFrame \n\nInstead, do this:\n\n iex> df = Explorer.DataFrame.new(col1: [\"a\", \"b\", \"c\"], col2: [1, 2, 3])\n iex> Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df[\"col2\"], 1) end)\n #Explorer.DataFrame \n\nThe `filter_with/2` version is much more efficient because it doesn't need\nto create intermediate series representations to apply the mask.","ref":"Explorer.DataFrame.html#mask/2-examples"},{"type":"macro","title":"Explorer.DataFrame.mutate/2","doc":"Creates or modifies columns based on `Explorer.Query`.\n\nThe query is compiled and runs efficiently against the dataframe.\nNew variables overwrite existing variables of the same name.\nColumn names are coerced from atoms to strings.\n\n> ##","ref":"Explorer.DataFrame.html#mutate/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.mutate/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nBesides element-wise series operations, you can also use window functions\nand aggregations inside mutations. In such cases, grouped dataframes\nmay have different results than ungrouped ones, because the mutation\nis computed withing groups. See examples below.\n\nSee `mutate_with/2` for a callback version of this function without\n`Explorer.Query`. If your mutation cannot be expressed with queries,\nyou may compute the values using the `Explorer.Series` API directly\nand then add it to the dataframe using `put/3`.","ref":"Explorer.DataFrame.html#mutate/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.mutate/2","doc":"Mutations are useful to add or modify columns in your dataframe:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, c: b + 1)\n #Explorer.DataFrame \n\nIt's also possible to overwrite existing columns:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, a: b * 2)\n #Explorer.DataFrame \n\nScalar values are repeated to fill the series:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, a: 4)\n #Explorer.DataFrame \n\nIt's also possible to use functions from the Series module, like `Explorer.Series.window_sum/3`:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, b: window_sum(a, 2))\n #Explorer.DataFrame \n\nAlternatively, all of the above works with a map instead of a keyword list:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate(df, %{\"c\" => cast(b, :float)})\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate/2-examples"},{"type":"macro","title":"Grouped examples - Explorer.DataFrame.mutate/2","doc":"Mutations in grouped dataframes takes the context of the group.\nThis enables some aggregations to be made considering each group. It's almost like `summarise/2`,\nbut repeating the results for each member in the group.\nFor example, if we want to count how many elements of a given group, we can add a new\ncolumn with that aggregation:\n\n iex> df = Explorer.DataFrame.new(id: [\"a\", \"a\", \"b\"], b: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, :id)\n iex> Explorer.DataFrame.mutate(grouped, count: count(b))\n #Explorer.DataFrame \n\nIn case we want to get the average size of the petal length from the Iris dataset, we can:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.mutate(grouped, petal_length_avg: mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.mutate_with/2","doc":"Creates or modifies columns using a callback function.\n\nThe callback receives a lazy dataframe. A lazy dataframe doesn't\nhold any values, instead it stores all operations in order to\nexecute all mutations performantly.\n\nThis is a callback version of `mutate/2`. If your mutation\ncannot be expressed with lazy dataframes, you may compute the\nvalues using the `Explorer.Series` API directly and then add\nit to the dataframe using `put/3`.","ref":"Explorer.DataFrame.html#mutate_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.mutate_with/2","doc":"Here is an example of a new column that sums the value of two other columns:\n\n iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, &[c: Explorer.Series.add(&1[\"a\"], &1[\"b\"])])\n #Explorer.DataFrame \n\nYou can overwrite existing columns as well:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, &[b: Explorer.Series.pow(&1[\"b\"], 2)])\n #Explorer.DataFrame \n\nIt's possible to \"reuse\" a variable for different computations:\n\n iex> df = Explorer.DataFrame.new(a: [4, 5, 6], b: [1, 2, 3])\n iex> Explorer.DataFrame.mutate_with(df, fn ldf ->\n iex> c = Explorer.Series.add(ldf[\"a\"], ldf[\"b\"])\n iex> [c: c, d: Explorer.Series.window_sum(c, 2)]\n iex> end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate_with/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.mutate_with/2","doc":"Mutations in grouped dataframes takes the context of the group.\nFor example, if we want to count how many elements of a given group,\nwe can add a new column with that aggregation:\n\n iex> df = Explorer.DataFrame.new(id: [\"a\", \"a\", \"b\"], b: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, :id)\n iex> Explorer.DataFrame.mutate_with(grouped, &[count: Explorer.Series.count(&1[\"b\"])])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#mutate_with/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.n_columns/1","doc":"Returns the number of columns in the dataframe.\n\nThis function works the same way for grouped dataframes.","ref":"Explorer.DataFrame.html#n_columns/1"},{"type":"function","title":"Examples - Explorer.DataFrame.n_columns/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.n_columns(df)\n 10","ref":"Explorer.DataFrame.html#n_columns/1-examples"},{"type":"function","title":"Explorer.DataFrame.n_rows/1","doc":"Returns the number of rows in the dataframe.\n\nThis function works the same way for grouped dataframes, considering the entire\ndataframe in the counting of rows.","ref":"Explorer.DataFrame.html#n_rows/1"},{"type":"function","title":"Examples - Explorer.DataFrame.n_rows/1","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.n_rows(df)\n 1094","ref":"Explorer.DataFrame.html#n_rows/1-examples"},{"type":"function","title":"Explorer.DataFrame.names/1","doc":"Gets the names of the dataframe columns.","ref":"Explorer.DataFrame.html#names/1"},{"type":"function","title":"Examples - Explorer.DataFrame.names/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, 2])\n iex> Explorer.DataFrame.names(df)\n [\"floats\", \"ints\"]","ref":"Explorer.DataFrame.html#names/1-examples"},{"type":"function","title":"Explorer.DataFrame.new/2","doc":"Creates a new dataframe.\n\nIt accepts any of:\n\n * a map or keyword list of string/atom keys and series as values\n * a map or keyword list of string/atom keys and tensors as values\n * any data structure adhering to the `Table.Reader` protocol","ref":"Explorer.DataFrame.html#new/2"},{"type":"function","title":"Options - Explorer.DataFrame.new/2","doc":"* `:backend` - The Explorer backend to use. Defaults to the value returned by `Explorer.Backend.get/0`.\n * `:dtypes` - A list/map of `{column_name, dtype}` pairs. (default: `[]`)","ref":"Explorer.DataFrame.html#new/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.new/2","doc":"#","ref":"Explorer.DataFrame.html#new/2-examples"},{"type":"function","title":"From series - Explorer.DataFrame.new/2","doc":"Series can be given either as keyword lists or maps\nwhere the keys are the name and the values are series:\n\n iex> Explorer.DataFrame.new(%{\n ...> floats: Explorer.Series.from_list([1.0, 2.0]),\n ...> ints: Explorer.Series.from_list([1, nil])\n ...> })\n #Explorer.DataFrame \n\n#","ref":"Explorer.DataFrame.html#new/2-from-series"},{"type":"function","title":"From tensors - Explorer.DataFrame.new/2","doc":"To create dataframe from tensors, you can pass a matrix as argument.\nEach matrix column becomes a dataframe column with names x1, x2, x3,\netc:\n\n iex> Explorer.DataFrame.new(Nx.tensor([\n ...> [1, 2, 3],\n ...> [4, 5, 6]\n ...> ]))\n #Explorer.DataFrame \n\nExplorer expects tensors to have certain types, so you may need to cast\nthe data accordingly. See `Explorer.Series.from_tensor/2` for more info.\n\nYou can also pass a keyword list or maps of vectors (rank 1 tensors):\n\n iex> Explorer.DataFrame.new(%{\n ...> floats: Nx.tensor([1.0, 2.0], type: :f64),\n ...> ints: Nx.tensor([3, 4])\n ...> })\n #Explorer.DataFrame \n\nUse dtypes to force a particular representation:\n\n iex> Explorer.DataFrame.new([\n ...> floats: Nx.tensor([1.0, 2.0], type: :f64),\n ...> times: Nx.tensor([3_000, 4_000])\n ...> ], dtypes: [times: :time])\n #Explorer.DataFrame \n\n#","ref":"Explorer.DataFrame.html#new/2-from-tensors"},{"type":"function","title":"From tabular - Explorer.DataFrame.new/2","doc":"Tabular data can be either columnar or row-based.\nLet's start with column data:\n\n iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, nil]})\n #Explorer.DataFrame \n\n iex> Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n #Explorer.DataFrame \n\n iex> Explorer.DataFrame.new([floats: [1.0, 2.0], ints: [1, nil], binaries: [ >, nil]], dtypes: [{:binaries, :binary}])\n #Explorer.DataFrame >, nil]\n >\n\n iex> Explorer.DataFrame.new(%{floats: [1.0, 2.0], ints: [1, \"wrong\"]})\n ** (ArgumentError) cannot create series \"ints\": the value \"wrong\" does not match the inferred series dtype :integer\n\nFrom row data:\n\n iex> rows = [%{id: 1, name: \"JosĆ©\"}, %{id: 2, name: \"Christopher\"}, %{id: 3, name: \"Cristine\"}]\n iex> Explorer.DataFrame.new(rows)\n #Explorer.DataFrame \n\n iex> rows = [[id: 1, name: \"JosĆ©\"], [id: 2, name: \"Christopher\"], [id: 3, name: \"Cristine\"]]\n iex> Explorer.DataFrame.new(rows)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#new/2-from-tabular"},{"type":"function","title":"Explorer.DataFrame.nil_count/1","doc":"Counts the number of null elements in each column.","ref":"Explorer.DataFrame.html#nil_count/1"},{"type":"function","title":"Examples - Explorer.DataFrame.nil_count/1","doc":"iex> df = Explorer.DataFrame.new(a: [\"d\", nil, \"f\"], b: [nil, 2, nil], c: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.nil_count(df)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#nil_count/1-examples"},{"type":"function","title":"Explorer.DataFrame.pivot_longer/3","doc":"Pivot data from wide to long.\n\n`pivot_longer/3` \"lengthens\" data, increasing the number of rows and\ndecreasing the number of columns. The inverse transformation is `pivot_wider/4`.\n\nThe second argument, `columns_to_pivot`, can be either list of column names to pivot.\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.\nThe selected columns must always have the same data type.\n\nIn case the dataframe is using groups, the groups that are also in the list of columns\nto pivot will be removed from the resultant dataframe. See the examples below.","ref":"Explorer.DataFrame.html#pivot_longer/3"},{"type":"function","title":"Options - Explorer.DataFrame.pivot_longer/3","doc":"* `:select` - Columns that are not in the list of pivot and should be kept in the dataframe.\n Ranges, regexes, and functions are also accepted in column names, as in `select/2`.\n Defaults to all columns except the ones to pivot.\n\n * `:discard` - Columns that are not in the list of pivot and should be dropped from the dataframe.\n Ranges, regexes, and functions are also accepted in column names, as in `select/2`.\n This list of columns is going to be subtracted from the list of `select`.\n Defaults to an empty list.\n\n * `:names_to` - A string specifying the name of the column to create from the data stored\n in the column names of the dataframe. Defaults to `\"variable\"`.\n\n * `:values_to` - A string specifying the name of the column to create from the data stored\n in series element values. Defaults to `\"value\"`.","ref":"Explorer.DataFrame.html#pivot_longer/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.pivot_longer/3","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, \"fuel\"))\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, &String.ends_with?(&1, \"fuel\"), select: [\"year\", \"country\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, [\"total\"], select: [\"year\", \"country\"], discard: [\"country\"])\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pivot_longer(df, [\"total\"], select: [], names_to: \"my_var\", values_to: \"my_value\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_longer/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.pivot_longer/3","doc":"In the following example we want to take the Iris dataset and increase the number of rows by\npivoting the \"sepal_length\" column. This dataset is grouped by \"species\", so the resultant\ndataframe is going to keep the \"species\" group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.pivot_longer(grouped, [\"sepal_length\"])\n #Explorer.DataFrame \n\nNow we want to do something different: we want to pivot the \"species\" column that is also a group.\nThis is going to remove the group in the resultant dataframe:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.pivot_longer(grouped, [\"species\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_longer/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.pivot_wider/4","doc":"Pivot data from long to wide.\n\n`pivot_wider/4` \"widens\" data, increasing the number of columns and decreasing the number of rows.\nThe inverse transformation is `pivot_longer/3`.\n\nDue to a restriction upstream, `values_from` must be a numeric type.\n\nIn case the dataframe is using groups, the groups that are also in the list of columns\nto pivot will be removed from the resultant dataframe. See the examples below.","ref":"Explorer.DataFrame.html#pivot_wider/4"},{"type":"function","title":"Options - Explorer.DataFrame.pivot_wider/4","doc":"* `:id_columns` - A set of columns that uniquely identifies each observation.\n\n Defaults to all columns in data except for the columns specified in `names_from` and `values_from`,\n and columns that are of the `:float` dtype.\n\n Typically used when you have redundant variables, i.e. variables whose values are perfectly correlated\n with existing variables. May accept a filter callback, a list or a range of column names.\n Default value is `0..-1//1`. If an empty list is passed, or a range that results in a empty list of\n column names, it raises an error.\n\n ID columns cannot be of the float type and any columns of this dtype is discarded.\n If you need to use float columns as IDs, you must carefully consider rounding\n or truncating the column and converting it to integer, as long as doing so\n preserves the properties of the column.\n\n* `:names_prefix` - String added to the start of every variable name.\n This is particularly useful if `names_from` is a numeric vector and you want to create syntactic variable names.","ref":"Explorer.DataFrame.html#pivot_wider/4-options"},{"type":"function","title":"Examples - Explorer.DataFrame.pivot_wider/4","doc":"Suppose we have a basketball court and multiple teams that want to train in that court. They need\nto share a schedule with the hours each team is going to use it. Here is a dataframe representing\nthat schedule:\n\n iex> Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n\nThis dataframe is going to look like this - using `table/2`:\n\n +----------------------------------------------+\n | Explorer DataFrame: [rows: 10, columns: 3] |\n +---------------+--------------+---------------+\n | weekday | team | hour |\n | | | |\n +===============+==============+===============+\n | Monday | A | 10 |\n +---------------+--------------+---------------+\n | Tuesday | B | 9 |\n +---------------+--------------+---------------+\n | Wednesday | C | 10 |\n +---------------+--------------+---------------+\n | Thursday | A | 10 |\n +---------------+--------------+---------------+\n | Friday | B | 11 |\n +---------------+--------------+---------------+\n | Monday | C | 15 |\n +---------------+--------------+---------------+\n | Tuesday | A | 14 |\n +---------------+--------------+---------------+\n | Wednesday | B | 16 |\n +---------------+--------------+---------------+\n | Thursday | C | 14 |\n +---------------+--------------+---------------+\n | Friday | A | 16 |\n +---------------+--------------+---------------+\n\nYou can see that the \"weekday\" repeats, and it's not clear how free the agenda is.\nWe can solve that by pivoting the \"weekday\" column in multiple columns, making each weekday\na new column in the resultant dataframe.\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"weekday\", \"hour\")\n #Explorer.DataFrame \n\nNow if we print that same dataframe with `table/2`, we get a better picture of the schedule:\n\n +----------------------------------------------------------------------+\n | Explorer DataFrame: [rows: 3, columns: 6] |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | team | Monday | Tuesday | Wednesday | Thursday | Friday |\n | | | | | | |\n +==========+===========+===========+===========+===========+===========+\n | A | 10 | 14 | | 10 | 16 |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | B | | 9 | 16 | | 11 |\n +----------+-----------+-----------+-----------+-----------+-----------+\n | C | 15 | | 10 | 14 | |\n +----------+-----------+-----------+-----------+-----------+-----------+\n\nPivot wider can create unpredictable column names, and sometimes they can conflict with ID columns.\nIn that scenario, we add a number as suffix to duplicated column names. Here is an example:\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", \"property_value\")\n #Explorer.DataFrame \n\nBut if the option `:names_prefix` is used, that suffix is not added:\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", \"property_value\", names_prefix: \"col_\")\n #Explorer.DataFrame \n\nMultiple columns are accepted for the `values_from` parameter, but the behaviour is slightly\ndifferent for the naming of new columns in the resultant dataframe. The new columns are going\nto be prefixed by the name of the original value column, followed by an underscore and the\noriginal column name, followed by the name of the variable.\n\n iex> df = Explorer.DataFrame.new(\n iex> product_id: [1, 1, 1, 1, 2, 2, 2, 2],\n iex> property: [\"product_id\", \"width_cm\", \"height_cm\", \"length_cm\", \"product_id\", \"width_cm\", \"height_cm\", \"length_cm\"],\n iex> property_value: [1, 42, 40, 64, 2, 35, 20, 40],\n iex> another_value: [1, 43, 41, 65, 2, 36, 21, 42]\n iex> )\n iex> Explorer.DataFrame.pivot_wider(df, \"property\", [\"property_value\", \"another_value\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_wider/4-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.pivot_wider/4","doc":"Now using the same idea, we can see that there is not much difference for grouped dataframes.\nThe only detail is that groups that are not ID columns are discarded.\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> grouped = Explorer.DataFrame.group_by(df, \"team\")\n iex> Explorer.DataFrame.pivot_wider(grouped, \"weekday\", \"hour\")\n #Explorer.DataFrame \n\nIn the following example the group \"weekday\" is going to be removed, because the column is going\nto be pivoted in multiple columns:\n\n iex> df = Explorer.DataFrame.new(\n iex> weekday: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n iex> team: [\"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\", \"B\", \"C\", \"A\"],\n iex> hour: [10, 9, 10, 10, 11, 15, 14, 16, 14, 16]\n iex> )\n iex> grouped = Explorer.DataFrame.group_by(df, \"weekday\")\n iex> Explorer.DataFrame.pivot_wider(grouped, \"weekday\", \"hour\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#pivot_wider/4-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.pull/2","doc":"Extracts a single column as a series.\n\nThis is equivalent to `df[field]` for retrieving a single field.\nThe returned series will have its `:name` field set to the column name.","ref":"Explorer.DataFrame.html#pull/2"},{"type":"function","title":"Examples - Explorer.DataFrame.pull/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pull(df, \"total\")\n #Explorer.Series \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.pull(df, 2)\n #Explorer.Series","ref":"Explorer.DataFrame.html#pull/2-examples"},{"type":"function","title":"Explorer.DataFrame.put/4","doc":"Creates or modifies a single column.\n\nThis is a simplified way to add or modify one column,\naccepting a series, tensor, or a list.\n\nIf you are computing a series, it is preferrable to use\n`mutate/2` or `mutate_with/2` to compute the series and\nmodify it in a single step, as it is more powerful and\nit handles both expressions and scalar values accordingly.\n\nIf you are passing tensors or lists, they will be automatically\nconverted to a series. By default, the new series will have the\nsame dtype as the existing series, unless the `:dtype` option\nis given. If there is no existing series, one is inferred from\nthe tensor/list.","ref":"Explorer.DataFrame.html#put/4"},{"type":"function","title":"Examples - Explorer.DataFrame.put/4","doc":"iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :b, Explorer.Series.transform(df[:a], fn n -> n * 2 end))\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :b, Explorer.Series.from_list([4, 5, 6]))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.put/4","doc":"If the dataframe is grouped, `put/3` is going to ignore the groups.\nSo the series must be of the same size of the entire dataframe.\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> grouped = Explorer.DataFrame.group_by(df, \"a\")\n iex> series = Explorer.Series.from_list([9, 8, 7])\n iex> Explorer.DataFrame.put(grouped, :b, series)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-grouped-examples"},{"type":"function","title":"Tensor examples - Explorer.DataFrame.put/4","doc":"You can also put tensors into the dataframe:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]))\n #Explorer.DataFrame \n\nYou can specify which dtype the tensor represents.\nFor example, a tensor of s64 represents integers\nby default, but it may also represent timestamps\nin microseconds from the Unix epoch:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([1, 2, 3]), dtype: {:datetime, :microsecond})\n #Explorer.DataFrame \n\nIf there is already a column where we want to place the tensor,\nthe column dtype will be automatically used, this means that\nupdating dataframes in place while preserving their types is\nstraight-forward:\n\n iex> df = Explorer.DataFrame.new(a: [~N[1970-01-01 00:00:00]])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(529550625987654))\n #Explorer.DataFrame \n\nThis is particularly useful for categorical columns:\n\n iex> cat = Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"], dtype: :category)\n iex> df = Explorer.DataFrame.new(a: cat)\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor([2, 1, 0]))\n #Explorer.DataFrame \n\nOn the other hand, if you try to put a floating tensor on\nan integer column, an error will be raised unless a dtype\nor `dtype: :infer` is given:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64))\n ** (ArgumentError) dtype integer expects a tensor of type {:s, 64} but got type {:f, 64}\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :float)\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3])\n iex> Explorer.DataFrame.put(df, :a, Nx.tensor(1.0, type: :f64), dtype: :infer)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#put/4-tensor-examples"},{"type":"function","title":"List examples - Explorer.DataFrame.put/4","doc":"Similar to tensors, we can also put lists in the dataframe:\n\n iex> df = Explorer.DataFrame.new([])\n iex> Explorer.DataFrame.put(df, :a, [1, 2, 3])\n #Explorer.DataFrame \n\nThe same considerations as above apply.","ref":"Explorer.DataFrame.html#put/4-list-examples"},{"type":"function","title":"Explorer.DataFrame.relocate/3","doc":"Relocates columns.\n\nChange column order within a DataFrame. The `before` and `after` options are mutually exclusive.\nProviding no options will relocate the columns to beginning of the DataFrame.","ref":"Explorer.DataFrame.html#relocate/3"},{"type":"function","title":"Options - Explorer.DataFrame.relocate/3","doc":"* `:before` - Specifies to relocate before the given column.\n It can be an index or a column name.\n\n * `:after` - Specifies to relocate after the given column.\n It can be an index or a column name.","ref":"Explorer.DataFrame.html#relocate/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.relocate/3","doc":"Relocate a single column\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1], c: [nil, 5, 6])\n iex> Explorer.DataFrame.relocate(df, \"a\", after: \"c\")\n #Explorer.DataFrame \n\nRelocate (and reorder) multiple columns to the beginning\n\n iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: [\"yes\", \"no\"])\n iex> Explorer.DataFrame.relocate(df, [\"d\", 1], before: 0)\n #Explorer.DataFrame \n\nRelocate before another column\n\n iex> df = Explorer.DataFrame.new(a: [1, 2], b: [5.1, 5.2], c: [4, 5], d: [\"yes\", \"no\"])\n iex> Explorer.DataFrame.relocate(df, [\"a\", \"c\"], before: \"b\")\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#relocate/3-examples"},{"type":"function","title":"Explorer.DataFrame.rename/2","doc":"Renames columns.\n\nRenaming a column that is also a group is going to rename the group as well.\nTo apply a function to a subset of columns, see `rename_with/3`.","ref":"Explorer.DataFrame.html#rename/2"},{"type":"function","title":"Examples - Explorer.DataFrame.rename/2","doc":"You can pass in a list of new names:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, [\"c\", \"d\"])\n #Explorer.DataFrame \n\nOr you can rename individual columns using keyword args:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, a: \"first\")\n #Explorer.DataFrame \n\nOr you can rename individual columns using a map:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"a\"], b: [1, 3, 1])\n iex> Explorer.DataFrame.rename(df, %{\"a\" => \"first\"})\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#rename/2-examples"},{"type":"function","title":"Explorer.DataFrame.rename_with/3","doc":"Renames columns with a function.\n\nRenaming a column that is also a group is going to rename the group as well.","ref":"Explorer.DataFrame.html#rename_with/3"},{"type":"function","title":"Examples - Explorer.DataFrame.rename_with/3","doc":"If no columns are specified, it will apply the function to all column names:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, &String.upcase/1)\n #Explorer.DataFrame \n\nA callback can be used to filter the column names that will be renamed, similarly to `select/2`:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, &String.ends_with?(&1, \"_fuel\"), &String.trim_trailing(&1, \"_fuel\"))\n #Explorer.DataFrame \n\nOr you can just pass in the list of column names you'd like to apply the function to:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.rename_with(df, [\"total\", \"cement\"], &String.upcase/1)\n #Explorer.DataFrame \n\nRanges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#rename_with/3-examples"},{"type":"function","title":"Explorer.DataFrame.sample/3","doc":"Sample rows from a dataframe.\n\nIf given an integer as the second argument, it will return N samples. If given a float, it will\nreturn that proportion of the series.\n\nCan sample with or without replacement.\n\nFor grouped dataframes, sample will take into account the rows of each group, meaning that\nif you try to get N samples and you have G groups, you will get N * G rows. See the examples\nbelow.","ref":"Explorer.DataFrame.html#sample/3"},{"type":"function","title":"Options - Explorer.DataFrame.sample/3","doc":"* `:replace` - If set to `true`, each sample will be independent and therefore\n values may repeat. Required to be `true` for `n` greater then the number of rows\n in the dataframe or `frac` > 1.0. (default: `false`)\n\n * `:seed` - An integer to be used as a random seed. If nil, a random value between 0\n and 2^64 - 1 will be used. (default: `nil`)\n\n * `:shuffle` - If set to `true`, the resultant dataframe is going to be shuffle\n if the sample is equal to the size of the dataframe. (default: `false`)","ref":"Explorer.DataFrame.html#sample/3-options"},{"type":"function","title":"Examples - Explorer.DataFrame.sample/3","doc":"You can sample N rows:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.sample(df, 3, seed: 100)\n #Explorer.DataFrame \n\nOr you can sample a proportion of rows:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.sample(df, 0.03, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#sample/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.sample/3","doc":"In the following example we have the Iris dataset grouped by species, and we want\nto take a sample of two plants from each group. Since we have three species, the\nresultant dataframe is going to have six rows (2 * 3).\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.sample(grouped, 2, seed: 100)\n #Explorer.DataFrame \n\nThe behaviour is similar when you want to take a fraction of the rows from each group. The main\ndifference is that each group can have more or less rows, depending on its size.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.sample(grouped, 0.1, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#sample/3-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.select/2","doc":"Selects a subset of columns by name.\n\nIt's important to notice that groups are kept:\nyou can't select off grouping columns.","ref":"Explorer.DataFrame.html#select/2"},{"type":"function","title":"Examples - Explorer.DataFrame.select/2","doc":"You can select a single column:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, \"a\")\n #Explorer.DataFrame \n\nOr a list of names:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, [\"a\"])\n #Explorer.DataFrame \n\nYou can also use a range or a list of integers:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.select(df, [0, 1])\n #Explorer.DataFrame \n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3], c: [4, 5, 6])\n iex> Explorer.DataFrame.select(df, 0..1)\n #Explorer.DataFrame \n\nOr you can use a callback function that takes the dataframe's names as its first argument:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, &String.starts_with?(&1, \"b\"))\n #Explorer.DataFrame \n\nOr, if you prefer, a regex:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, ~r/^b$/)\n #Explorer.DataFrame \n\nOr a callback function that takes names and types:\n\n iex> df = Explorer.DataFrame.new(a: [\"a\", \"b\", \"c\"], b: [1, 2, 3])\n iex> Explorer.DataFrame.select(df, fn _name, type -> type == :integer end)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#select/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.select/2","doc":"Columns that are also groups cannot be removed,\nyou need to ungroup before removing these columns.\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.select(grouped, [\"sepal_width\"])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#select/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.shape/1","doc":"Gets the shape of the dataframe as a `{height, width}` tuple.\n\nThis function works the same way for grouped dataframes, considering the entire\ndataframe in the counting of rows.","ref":"Explorer.DataFrame.html#shape/1"},{"type":"function","title":"Examples - Explorer.DataFrame.shape/1","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0, 3.0], ints: [1, 2, 3])\n iex> Explorer.DataFrame.shape(df)\n {3, 2}","ref":"Explorer.DataFrame.html#shape/1-examples"},{"type":"function","title":"Explorer.DataFrame.shuffle/2","doc":"Change the order of the rows of a dataframe randomly.\n\nThis function is going to ignore groups.","ref":"Explorer.DataFrame.html#shuffle/2"},{"type":"function","title":"Options - Explorer.DataFrame.shuffle/2","doc":"* `:seed` - An integer to be used as a random seed. If nil, a random value between 0\n and 2^64 - 1 will be used. (default: `nil`)","ref":"Explorer.DataFrame.html#shuffle/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.shuffle/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.shuffle(df, seed: 100)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#shuffle/2-examples"},{"type":"function","title":"Explorer.DataFrame.slice/2","doc":"Slices rows at the given indices as a new dataframe.\n\nThe indices may be a list or series of indices, or a range.\nA list of indices does not support negative numbers.\nRanges may be negative on either end, which are then\nnormalized. Note ranges in Elixir are inclusive.\n\nSlice works differently when a dataframe is grouped.\nIt is going to consider the indices of each group\ninstead of the entire dataframe. See the examples below.\n\nIf your intention is to grab a portion of each group,\nprefer to use `sample/3` instead.","ref":"Explorer.DataFrame.html#slice/2"},{"type":"function","title":"Examples - Explorer.DataFrame.slice/2","doc":"iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, [0, 2])\n #Explorer.DataFrame \n\nWith a series\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, Explorer.Series.from_list([0, 2]))\n #Explorer.DataFrame \n\nWith a range:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, 1..2)\n #Explorer.DataFrame \n\nWith a range with negative first and last:\n\n iex> df = Explorer.DataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n iex> Explorer.DataFrame.slice(df, -2..-1)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.slice/2","doc":"We are going to once again use the Iris dataset.\nIn this example we want to take elements at indexes\n0 and 2:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, [0, 2])\n #Explorer.DataFrame \n\nNow we want to take the first 3 rows of each group.\nThis is going to work with the range `0..2`:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, 0..2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.slice/3","doc":"Subset a continuous set of rows.","ref":"Explorer.DataFrame.html#slice/3"},{"type":"function","title":"Examples - Explorer.DataFrame.slice/3","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, 1, 2)\n #Explorer.DataFrame \n\nNegative offsets count from the end of the series:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, -10, 2)\n #Explorer.DataFrame \n\nIf the length would run past the end of the dataframe, the result may be shorter than the length:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.slice(df, -10, 20)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/3-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.slice/3","doc":"We want to take the first 3 rows of each group. We need the offset 0 and the length 3:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, 0, 3)\n #Explorer.DataFrame \n\nWe can also pass a negative offset:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.slice(grouped, -6, 3)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#slice/3-grouped-examples"},{"type":"macro","title":"Explorer.DataFrame.summarise/2","doc":"Summarise each group to a single row using `Explorer.Query`.\n\nTo summarise, you must perform aggregation, defined in `Explorer.Series`,\non the desired columns. The query is compiled and runs efficiently\nagainst the dataframe. This function performs aggregations based on groups,\nand the query must contain at least one aggregation.\nIt implicitly ungroups the resultant dataframe.\n\n> ##","ref":"Explorer.DataFrame.html#summarise/2"},{"type":"macro","title":"Notice {: .notice} - Explorer.DataFrame.summarise/2","doc":">\n> This is a macro. You must `require Explorer.DataFrame` before using it.\n\nSee `summarise_with/2` for a callback version of this function without\n`Explorer.Query`.","ref":"Explorer.DataFrame.html#summarise/2-notice-notice"},{"type":"macro","title":"Examples - Explorer.DataFrame.summarise/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> grouped_df = Explorer.DataFrame.group_by(df, \"year\")\n iex> Explorer.DataFrame.summarise(grouped_df, total_max: max(total), total_min: min(total))\n #Explorer.DataFrame \n\nSuppose you want to get the mean petal length of each Iris species. You could do something\nlike this:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped_df = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.summarise(grouped_df, mean_petal_length: mean(petal_length))\n #Explorer.DataFrame \n\nIn case aggregations for all the dataframe is what you want, you can use ungrouped\ndataframes:\n\n iex> df = Explorer.Datasets.iris()\n iex> Explorer.DataFrame.summarise(df, mean_petal_length: mean(petal_length))\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#summarise/2-examples"},{"type":"function","title":"Explorer.DataFrame.summarise_with/2","doc":"Summarise each group to a single row using a callback function.\n\nIn case no group is set, the entire dataframe will be considered.\nThe callback receives a lazy dataframe. A lazy dataframe does not\nhold any values, instead it stores all operations in order to\nexecute all summarizations performantly.\n\nThis is a callback version of `summarise/2`.","ref":"Explorer.DataFrame.html#summarise_with/2"},{"type":"function","title":"Examples - Explorer.DataFrame.summarise_with/2","doc":"iex> alias Explorer.{DataFrame, Series}\n iex> df = Explorer.Datasets.fossil_fuels() |> DataFrame.group_by(\"year\")\n iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1[\"total\"]), countries: Series.n_distinct(&1[\"country\"])])\n #Explorer.DataFrame \n\n iex> alias Explorer.{DataFrame, Series}\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> DataFrame.summarise_with(df, &[total_max: Series.max(&1[\"total\"]), countries: Series.n_distinct(&1[\"country\"])])\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#summarise_with/2-examples"},{"type":"function","title":"Explorer.DataFrame.tail/2","doc":"Returns the last *n* rows of the dataframe.\n\nBy default it returns the last 5 rows.\n\nIf the dataframe is using groups, then the last *n* rows of each group is\nreturned.","ref":"Explorer.DataFrame.html#tail/2"},{"type":"function","title":"Examples - Explorer.DataFrame.tail/2","doc":"iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.tail(df)\n #Explorer.DataFrame \n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> Explorer.DataFrame.tail(df, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#tail/2-examples"},{"type":"function","title":"Grouped examples - Explorer.DataFrame.tail/2","doc":"Using grouped dataframes makes `tail/2` return **n rows** from each group.\nHere is an example using the Iris dataset, and returning two rows from each group:\n\n iex> df = Explorer.Datasets.iris()\n iex> grouped = Explorer.DataFrame.group_by(df, \"species\")\n iex> Explorer.DataFrame.tail(grouped, 2)\n #Explorer.DataFrame","ref":"Explorer.DataFrame.html#tail/2-grouped-examples"},{"type":"function","title":"Explorer.DataFrame.to_columns/2","doc":"Converts a dataframe to a list of columns with lists as values.\n\nSee `to_series/2` if you want a list of columns with series as values.\nNote that this function does not take into account groups.\n\n> ##","ref":"Explorer.DataFrame.html#to_columns/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_columns/2","doc":">\n> This is an expensive operation since it converts series to lists and doing\n> so will copy the whole dataframe. Prefer to use the operations in this and\n> the `Explorer.Series` module rather than the ones in `Enum` whenever possible,\n> as Explorer is optimized for large series.","ref":"Explorer.DataFrame.html#to_columns/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_columns/2","doc":"* `:atom_keys` - Configure if the resultant map should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_columns/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_columns/2","doc":"iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])\n iex> Explorer.DataFrame.to_columns(df)\n %{\"floats\" => [1.0, 2.0], \"ints\" => [1, nil]}\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_columns(df, atom_keys: true)\n %{floats: [1.0, 2.0], ints: [1, nil]}","ref":"Explorer.DataFrame.html#to_columns/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_csv/3","doc":"Writes a dataframe to a delimited file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_csv/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_csv/3","doc":"* `:header` - Should the column names be written as the first line of the file? (default: `true`)\n\n * `:delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_csv/3-options"},{"type":"function","title":"Explorer.DataFrame.to_csv!/3","doc":"Similar to `to_csv/3` but raises if there is a problem reading the CSV.","ref":"Explorer.DataFrame.html#to_csv!/3"},{"type":"function","title":"Explorer.DataFrame.to_ipc/3","doc":"Writes a dataframe to an IPC file.\n\nApache IPC is a language-agnostic columnar data structure that can be used to store dataframes.\nIt excels as a format for quickly exchange data between different programming languages.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_ipc/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ipc/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.\n\n * `:streaming` - Tells the backend if it should use streaming, which means\n that the dataframe is not loaded to the memory at once, and instead it is\n written in chunks from a lazy dataframe.\n\n This option has no effect on eager - the default - dataframes.\n It defaults to `true`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ipc/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ipc!/3","doc":"Similar to `to_ipc/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ipc!/3"},{"type":"function","title":"Explorer.DataFrame.to_ipc_stream/3","doc":"Writes a dataframe to an IPC Stream file.\n\nArrow IPC Streams provide a streaming protocol or ā€œformat\" for sending an arbitrary\nlength sequence of record batches.\nThe format must be processed from start to end, and does not support random access.","ref":"Explorer.DataFrame.html#to_ipc_stream/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ipc_stream/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Supported options are:\n\n * `nil` (uncompressed, default)\n * `:zstd`\n * `:lz4`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ipc_stream/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ipc_stream!/3","doc":"Similar to `to_ipc_stream/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ipc_stream!/3"},{"type":"function","title":"Explorer.DataFrame.to_lazy/1","doc":"Converts the dataframe to the lazy version of the current backend.\n\nIf already lazy, this is a noop.\n\nConverting a grouped dataframe should return a lazy dataframe with groups.","ref":"Explorer.DataFrame.html#to_lazy/1"},{"type":"function","title":"Explorer.DataFrame.to_ndjson/3","doc":"Writes a dataframe to a ndjson file.\n\nGroups are ignored if the dataframe is using any.\n\nNDJSON are files that contains JSON files separated by new lines.\nThey are often used as structured logs.","ref":"Explorer.DataFrame.html#to_ndjson/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_ndjson/3","doc":"* `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_ndjson/3-options"},{"type":"function","title":"Explorer.DataFrame.to_ndjson!/3","doc":"Similar to `to_ndjson/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_ndjson!/3"},{"type":"function","title":"Explorer.DataFrame.to_parquet/3","doc":"Writes a dataframe to a parquet file.\n\nGroups are ignored if the dataframe is using any.","ref":"Explorer.DataFrame.html#to_parquet/3"},{"type":"function","title":"Options - Explorer.DataFrame.to_parquet/3","doc":"* `:compression` - The compression algorithm to use when writing files.\n Where a compression level is available, this can be passed as a tuple,\n such as `{:zstd, 3}`. Supported options are:\n\n * `nil` (uncompressed, default)\n * `:snappy`\n * `:gzip` (with levels 1-9)\n * `:brotli` (with levels 1-11)\n * `:zstd` (with levels -7-22)\n * `:lz4raw`.\n\n * `:streaming` - Tells the backend if it should use streaming, which means\n that the dataframe is not loaded to the memory at once, and instead it is\n written in chunks from a lazy dataframe.\n\n This option has no effect on eager - the default - dataframes.\n It defaults to `true`.\n\n * `:config` - An optional struct, keyword list or map, normally associated with remote\n file systems. See [IO section](#module-io-operations) for more details. (default: `nil`)","ref":"Explorer.DataFrame.html#to_parquet/3-options"},{"type":"function","title":"Explorer.DataFrame.to_parquet!/3","doc":"Similar to `to_parquet/3`, but raises in case of error.","ref":"Explorer.DataFrame.html#to_parquet!/3"},{"type":"function","title":"Explorer.DataFrame.to_rows/2","doc":"Converts a dataframe to a list of maps (rows).\n\n> ##","ref":"Explorer.DataFrame.html#to_rows/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_rows/2","doc":">\n> This is an expensive operation since data is stored in a columnar format.\n> You must avoid converting a dataframe to rows, as that will transform and\n> copy the whole dataframe in memory. Prefer to use the operations in this\n> module rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.DataFrame.html#to_rows/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_rows/2","doc":"* `:atom_keys` - Configure if the resultant maps should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_rows/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_rows/2","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows(df)\n [%{\"floats\" => 1.0, \"ints\" => 1}, %{\"floats\" => 2.0 ,\"ints\" => nil}]\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows(df, atom_keys: true)\n [%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]","ref":"Explorer.DataFrame.html#to_rows/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_rows_stream/2","doc":"Converts a dataframe to a stream of maps (rows).\n\n> ##","ref":"Explorer.DataFrame.html#to_rows_stream/2"},{"type":"function","title":"Warning {: .warning} - Explorer.DataFrame.to_rows_stream/2","doc":">\n> This is an expensive operation since data is stored in a columnar format.\n> Prefer to use the operations in this module rather than the ones in `Enum`\n> whenever possible, as this module is optimized for large series.","ref":"Explorer.DataFrame.html#to_rows_stream/2-warning-warning"},{"type":"function","title":"Options - Explorer.DataFrame.to_rows_stream/2","doc":"* `:atom_keys` - Configure if the resultant maps should have atom keys. (default: `false`)\n * `:chunk_size` - Number of rows passed to `to_rows/2` while streaming over the data. (default: `1000`)","ref":"Explorer.DataFrame.html#to_rows_stream/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_rows_stream/2","doc":"iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows_stream(df) |> Enum.map(& &1)\n [%{\"floats\" => 1.0, \"ints\" => 1}, %{\"floats\" => 2.0 ,\"ints\" => nil}]\n\n iex> df = Explorer.DataFrame.new(floats: [1.0, 2.0], ints: [1, nil])\n iex> Explorer.DataFrame.to_rows_stream(df, atom_keys: true) |> Enum.map(& &1)\n [%{floats: 1.0, ints: 1}, %{floats: 2.0, ints: nil}]","ref":"Explorer.DataFrame.html#to_rows_stream/2-examples"},{"type":"function","title":"Explorer.DataFrame.to_series/2","doc":"Converts a dataframe to a list of columns with series as values.\n\nSee `to_columns/2` if you want a list of columns with lists as values.\nNote that this function does not take into account groups.","ref":"Explorer.DataFrame.html#to_series/2"},{"type":"function","title":"Options - Explorer.DataFrame.to_series/2","doc":"* `:atom_keys` - Configure if the resultant map should have atom keys. (default: `false`)","ref":"Explorer.DataFrame.html#to_series/2-options"},{"type":"function","title":"Examples - Explorer.DataFrame.to_series/2","doc":"iex> df = Explorer.DataFrame.new(ints: [1, nil], floats: [1.0, 2.0])\n iex> map = Explorer.DataFrame.to_series(df)\n iex> Explorer.Series.to_list(map[\"floats\"])\n [1.0, 2.0]\n iex> Explorer.Series.to_list(map[\"ints\"])\n [1, nil]","ref":"Explorer.DataFrame.html#to_series/2-examples"},{"type":"function","title":"Explorer.DataFrame.ungroup/2","doc":"Removes grouping variables.\n\nAccepts a list of group names. If groups is not specified, then all groups are\nremoved.","ref":"Explorer.DataFrame.html#ungroup/2"},{"type":"function","title":"Examples - Explorer.DataFrame.ungroup/2","doc":"Ungroups all by default:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n iex> Explorer.DataFrame.ungroup(df)\n #Explorer.DataFrame \n\nUngrouping a single column:\n\n iex> df = Explorer.Datasets.fossil_fuels()\n iex> df = Explorer.DataFrame.group_by(df, [\"country\", \"year\"])\n iex> Explorer.DataFrame.ungroup(df, \"country\")\n #Explorer.DataFrame \n\nLists, ranges, regexes, and functions are also accepted in column names, as in `select/2`.","ref":"Explorer.DataFrame.html#ungroup/2-examples"},{"type":"type","title":"Explorer.DataFrame.column/0","doc":"Represents a column name or its index.","ref":"Explorer.DataFrame.html#t:column/0"},{"type":"type","title":"Explorer.DataFrame.column_name/0","doc":"Represents a column name as atom or string.","ref":"Explorer.DataFrame.html#t:column_name/0"},{"type":"type","title":"Explorer.DataFrame.column_names/0","doc":"Represents multiple column names as atoms or strings.","ref":"Explorer.DataFrame.html#t:column_names/0"},{"type":"type","title":"Explorer.DataFrame.column_pairs/1","doc":"Represents a column pair where the value is a column name or\na column index, and the value is of type `value`.","ref":"Explorer.DataFrame.html#t:column_pairs/1"},{"type":"type","title":"Explorer.DataFrame.columns/0","doc":"Represents multiple columns.\n\nThe columns may be specified as one of:\n\n * a list of columns indexes or names as atoms and strings\n\n * a range\n\n * a regex that keeps only the names matching the regex\n\n * a one-arity function that receives column names and returns\n true for column names to keep\n\n * a two-arity function that receives column names and types and\n returns true for column names to keep","ref":"Explorer.DataFrame.html#t:columns/0"},{"type":"type","title":"Explorer.DataFrame.fs_entry/0","doc":"Represents a filesystem entry, that can be local or S3.","ref":"Explorer.DataFrame.html#t:fs_entry/0"},{"type":"type","title":"Explorer.DataFrame.t/0","doc":"Represents a dataframe.","ref":"Explorer.DataFrame.html#t:t/0"},{"type":"module","title":"Explorer.Datasets","doc":"Datasets used in examples and exploration.\n\nNote those datasets are not available inside Elixir releases\n(see `mix release`), which is the usual way to deploy Elixir\nin production. Therefore, if you need one of those datasets\nin production, you must download the source files to your\nown application `priv` directory and load them yourself.\nFor example:\n\n Explorer.DataFrame.from_csv!(Application.app_dir(:my_app, \"priv/iris.csv\"))","ref":"Explorer.Datasets.html"},{"type":"function","title":"Explorer.Datasets.fossil_fuels/0","doc":"CO2 emissions from fossil fuels since 2010, by country","ref":"Explorer.Datasets.html#fossil_fuels/0"},{"type":"function","title":"Citation - Explorer.Datasets.fossil_fuels/0","doc":"Boden, T.A., G. Marland, and R.J. Andres. 2013. Global, Regional, and National Fossil-Fuel CO2\n Emissions. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S.\n Department of Energy, Oak Ridge, Tenn., U.S.A. doi 10.3334/CDIAC/00001_V2013","ref":"Explorer.Datasets.html#fossil_fuels/0-citation"},{"type":"function","title":"Explorer.Datasets.iris/0","doc":"Iris Dataset.\n\nThis classic dataset was collected by Edgar Anderson in 1936\nand made famous by R. A. Fisher's 1936 paper. It consists of\nseveral measurements of three species of Iris (Iris setosa,\nIris virginica and Iris versicolor).\n\nDownloaded and modified from: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data","ref":"Explorer.Datasets.html#iris/0"},{"type":"function","title":"Citation - Explorer.Datasets.iris/0","doc":"Fisher,R. A.. (1988). Iris. UCI Machine Learning Repository. https://doi.org/10.24432/C56C76.","ref":"Explorer.Datasets.html#iris/0-citation"},{"type":"function","title":"Explorer.Datasets.wine/0","doc":"Wine Dataset.\n\nThe data is the result of a chemical analysis of wines grown in the same\nregion in Italy but derived from three different cultivars. The analysis\ndetermined the quantities of 13 constituents found in each of the three\ntypes of wines.\n\nDownloaded and modified from: https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data","ref":"Explorer.Datasets.html#wine/0"},{"type":"function","title":"Citation - Explorer.Datasets.wine/0","doc":"Aeberhard,Stefan and Forina,M.. (1991). Wine. UCI Machine Learning Repository. https://doi.org/10.24432/C5PC7J.","ref":"Explorer.Datasets.html#wine/0-citation"},{"type":"module","title":"Explorer.Query","doc":"High-level query for Explorer.\n\n> ##","ref":"Explorer.Query.html"},{"type":"module","title":"Explorer.DataFrame vs DF {: .tip} - Explorer.Query","doc":">\n> All examples below assume you have defined aliased\n> `Explorer.DataFrame` to `DF` as shown below:\n>\n> alias Explorer.DataFrame, as: DF\n>\n\nQueries convert regular Elixir code which compile to efficient\ndataframes operations. Inside a query, only the limited set of\nSeries operations are available and identifiers, such as `strs`\nand `nums`, represent dataframe column names:\n\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums > 2)\n #Explorer.DataFrame \n\nIf a column has unusual format, you can either rename it before-hand,\nor use `col/1` inside queries:\n\n iex> df = DF.new(\"unusual nums\": [1, 2, 3])\n iex> DF.filter(df, col(\"unusual nums\") > 2)\n #Explorer.DataFrame \n\nAll operations from `Explorer.Series` are imported inside queries.\nThis module also provides operators to use in queries, which are\nalso imported into queries.","ref":"Explorer.Query.html#module-explorer-dataframe-vs-df-tip"},{"type":"module","title":"Supported operations - Explorer.Query","doc":"Queries are supported in the following operations:\n\n * `Explorer.DataFrame.arrange/2`\n * `Explorer.DataFrame.filter/2`\n * `Explorer.DataFrame.mutate/2`\n * `Explorer.DataFrame.summarise/2`","ref":"Explorer.Query.html#module-supported-operations"},{"type":"module","title":"Interpolation - Explorer.Query","doc":"If you want to access variables defined outside of the query\nor get access to all Elixir constructs, you must use `^`:\n\n iex> min = 2\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums > ^min)\n #Explorer.DataFrame \n\n iex> min = 2\n iex> df = DF.new(strs: [\"a\", \"b\", \"c\"], nums: [1, 2, 3])\n iex> DF.filter(df, nums 0, do: 10, else: -10))\n #Explorer.DataFrame \n\n`^` can be used with `col` to access columns dynamically:\n\n iex> df = DF.new(\"unusual nums\": [1, 2, 3])\n iex> name = \"unusual nums\"\n iex> DF.filter(df, col(^name) > 2)\n #Explorer.DataFrame","ref":"Explorer.Query.html#module-interpolation"},{"type":"module","title":"Across and comprehensions - Explorer.Query","doc":"`Explorer.Query` leverages the power behind Elixir for-comprehensions\nto provide a powerful syntax for traversing several columns in a dataframe\nat once. For example, imagine you want to standardization the data on the\niris dataset, you could write this:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> sepal_width: (sepal_width - mean(sepal_width)) / variance(sepal_width),\n ...> sepal_length: (sepal_length - mean(sepal_length)) / variance(sepal_length),\n ...> petal_length: (petal_length - mean(petal_length)) / variance(petal_length),\n ...> petal_width: (petal_width - mean(petal_width)) / variance(petal_width)\n ...> )\n #Explorer.DataFrame \n\nWhile the code above does its job, it is quite repetitive. With across and for-comprehensions,\nwe could instead write:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> for col {col.name, (col - mean(col)) / variance(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\nWhich achieves the same result in a more concise and maintainable way.\n`across/1` may receive any of the following input as arguments:\n\n * a list of columns indexes or names as atoms and strings\n\n * a range\n\n * a regex that keeps only the names matching the regex\n\nFor example, since we know the width and length columns are the first four,\nwe could also have written (remember ranges in Elixir are inclusive):\n\n DF.mutate(iris,\n for col iris = Explorer.Datasets.iris()\n iex> DF.mutate(iris,\n ...> for col {col.name, (col - mean(col)) / variance(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\nFor-comprehensions works with all dataframe verbs. As we have seen\nabove, for mutations we must return tuples as pair with the mutation\nname and its value. `summarise` works similarly. Note in both cases\nthe name could also be generated dynamically. For example, to compute\nthe mean per species, you could write:\n\n iex> Explorer.Datasets.iris()\n ...> |> DF.group_by(\"species\")\n ...> |> DF.summarise(\n ...> for col {\"#{col.name}_mean\", mean(col)}\n ...> end\n ...> )\n #Explorer.DataFrame \n\n`arrange` expects a list of columns to sort by, while for-comprehensions\nin `filter` generate a list of conditions, which are joined using `and`.\nFor example, to filter all entries have both sepal and petal length above\naverage, using a filter on the column name, one could write:\n\n iex> iris = Explorer.Datasets.iris()\n iex> DF.filter(iris,\n ...> for col col > mean(col)\n ...> end\n ...> )\n #Explorer.DataFrame \n\n> ##","ref":"Explorer.Query.html#module-across-and-comprehensions"},{"type":"module","title":"Do not mix comprehension and queries {: .warning} - Explorer.Query","doc":">\n> The filter inside a for-comprehension works at the meta level:\n> it can only filter columns based on their names and dtypes, but\n> not on their values. For example, this code does not make any\n> sense and it will fail to compile:\n>\n> |> DF.filter(\n> for col mean(col) do\n> col\n> end\n> end)\n>\n> Another way to think about it, the comprehensions traverse on the\n> columns themselves, the contents inside the comprehension do-block\n> traverse on the values inside the columns.","ref":"Explorer.Query.html#module-do-not-mix-comprehension-and-queries-warning"},{"type":"module","title":"Implementation details - Explorer.Query","doc":"Queries simply become lazy dataframe operations at runtime.\nFor example, the following query\n\n Explorer.DataFrame.filter(df, nums > 2)\n\nis equivalent to\n\n Explorer.DataFrame.filter_with(df, fn df -> Explorer.Series.greater(df[\"nums\"], 2) end)\n\nThis means that, whenever you want to generate queries programatically,\nyou can fallback to the regular `_with` APIs.","ref":"Explorer.Query.html#module-implementation-details"},{"type":"function","title":"Explorer.Query.**/2","doc":"Delegate to `Explorer.Series.pow/2`.","ref":"Explorer.Query.html#**/2"},{"type":"function","title":"Explorer.Query.*/2","doc":"Delegate to `Explorer.Series.multiply/2`.","ref":"Explorer.Query.html#*/2"},{"type":"function","title":"Explorer.Query.+/1","doc":"Unary plus operator.\n\nWorks with numbers and series.","ref":"Explorer.Query.html#+/1"},{"type":"function","title":"Explorer.Query.+/2","doc":"Delegate to `Explorer.Series.add/2`.","ref":"Explorer.Query.html#+/2"},{"type":"function","title":"Explorer.Query.-/1","doc":"Unary minus operator.\n\nWorks with numbers and series.","ref":"Explorer.Query.html#-/1"},{"type":"function","title":"Explorer.Query.-/2","doc":"Delegate to `Explorer.Series.subtract/2`.","ref":"Explorer.Query.html#-/2"},{"type":"function","title":"Explorer.Query.//2","doc":"Delegate to `Explorer.Series.divide/2`.","ref":"Explorer.Query.html#//2"},{"type":"function","title":"Explorer.Query.!=/2","doc":"Delegate to `Explorer.Series.not_equal/2`.","ref":"Explorer.Query.html#!=/2"},{"type":"function","title":"Explorer.Query./2","doc":"String concatenation operator.\n\nWorks with strings and series of strings.","ref":"Explorer.Query.html#%3C%3E/2"},{"type":"macro","title":"Examples - Explorer.Query.<>/2","doc":"DF.mutate(df, name: first_name \" \" last_name)\n\nIf you want to convert concatenate non-string\nseries, you can explicitly cast them to string\nbefore:\n\n DF.mutate(df, name: cast(year, :string) \"-\" cast(month, :string))\n\nOr use format:\n\n DF.mutate(df, name: format([year, \"-\", month]))","ref":"Explorer.Query.html#%3C%3E/2-examples"},{"type":"function","title":"Explorer.Query.==/2","doc":"Delegate to `Explorer.Series.equal/2`.","ref":"Explorer.Query.html#==/2"},{"type":"function","title":"Explorer.Query.>/2","doc":"Delegate to `Explorer.Series.greater/2`.","ref":"Explorer.Query.html#%3E/2"},{"type":"function","title":"Explorer.Query.>=/2","doc":"Delegate to `Explorer.Series.greater_equal/2`.","ref":"Explorer.Query.html#%3E=/2"},{"type":"macro","title":"Explorer.Query.across/0","doc":"Accesses all columns in the dataframe.\n\nThis is the equivalent to `across(0..-1//1)`.\n\nSee the module docs for more information.","ref":"Explorer.Query.html#across/0"},{"type":"macro","title":"Explorer.Query.across/1","doc":"Accesses the columns given by `selector` in the dataframe.\n\n`across/1` is used as the generator inside for-comprehensions.\n\nSee the module docs for more information.","ref":"Explorer.Query.html#across/1"},{"type":"macro","title":"Explorer.Query.col/1","doc":"Accesses a column by name.\n\nIf your column name contains whitespace or start with\nuppercase letters, you can still access its name by\nusing this macro:\n\n iex> df = Explorer.DataFrame.new(\"unusual nums\": [1, 2, 3])\n iex> Explorer.DataFrame.filter(df, col(\"unusual nums\") > 2)\n #Explorer.DataFrame \n\n`name` must be an atom, a string, or an integer.\nIt is equivalent to `df[name]` but inside a query.\n\nThis can also be used if you want to access a column\nprogramatically, for example:\n\n iex> df = Explorer.DataFrame.new(nums: [1, 2, 3])\n iex> name = :nums\n iex> Explorer.DataFrame.filter(df, col(^name) > 2)\n #Explorer.DataFrame \n\nFor traversing multiple columns programatically,\nsee `across/0` and `across/1`.","ref":"Explorer.Query.html#col/1"},{"type":"macro","title":"Explorer.Query.query/1","doc":"Builds an anonymous function from a query.\n\nThis is the entry point used by `Explorer.DataFrame.filter/2`\nand friends to convert queries into anonymous functions.\nSee the moduledoc for more information.","ref":"Explorer.Query.html#query/1"},{"type":"module","title":"Explorer.Series","doc":"The Series struct and API.\n\nA series can be of the following data types:\n\n * `:binary` - Binary\n * `:boolean` - Boolean\n * `:category` - UTF-8 encoded binary but represented internally as integers\n * `:date` - Date type that unwraps to `Elixir.Date`\n * `{:datetime, :millisecond}` - DateTime type with milli-second precision that unwraps to `Elixir.NaiveDateTime`\n * `{:datetime, :microsecond}` - DateTime type with micro-second precision that unwraps to `Elixir.NaiveDateTime`\n * `{:datetime, :nanosecond}` - DateTime type with nano-second precision that unwraps to `Elixir.NaiveDateTime`\n * `:float` - 64-bit floating point number\n * `:integer` - 64-bit signed integer\n * `:string` - UTF-8 encoded binary\n * `:time` - Time type that unwraps to `Elixir.Time`\n\nA series must consist of a single data type only. Series may have `nil` values in them.\nThe series `dtype` can be retrieved via the `dtype/1` function or directly accessed as\n`series.dtype`. A `series.name` field is also available, but it is always `nil` unless\nthe series is retrieved from a dataframe.\n\nMany functions only apply to certain dtypes. These functions may appear on distinct\ncategories on the sidebar. Other functions may work on several datatypes, such as\ncomparison functions. In such cases, a \"Supported dtypes\" section will be available\nin the function documentation.","ref":"Explorer.Series.html"},{"type":"module","title":"Creating series - Explorer.Series","doc":"Series can be created using `from_list/2`, `from_binary/3`, and friends:\n\nSeries can be made of numbers:\n\n iex> Explorer.Series.from_list([1, 2, 3])\n #Explorer.Series \n\nSeries are nullable, so you may also include nils:\n\n iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])\n #Explorer.Series \n\nAny of the dtypes above are supported, such as strings:\n\n iex> Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"])\n #Explorer.Series","ref":"Explorer.Series.html#module-creating-series"},{"type":"function","title":"Explorer.Series.abs/1","doc":"Gets the series absolute values.","ref":"Explorer.Series.html#abs/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.abs/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#abs/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.abs/1","doc":"iex> s = Explorer.Series.from_list([1, 2, -1, -3])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, -1.0, -3.0])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, -3.0])\n iex> Explorer.Series.abs(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.abs(s)\n ** (ArgumentError) Explorer.Series.abs/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#abs/1-examples"},{"type":"function","title":"Explorer.Series.acos/1","doc":"Computes the the arccosine of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between 0 and pi.","ref":"Explorer.Series.html#acos/1"},{"type":"function","title":"Supported dtype - Explorer.Series.acos/1","doc":"* `:float`","ref":"Explorer.Series.html#acos/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.acos/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.acos(s)\n #Explorer.Series","ref":"Explorer.Series.html#acos/1-examples"},{"type":"function","title":"Explorer.Series.add/2","doc":"Adds right to left, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#add/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.add/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#add/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.add/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.add(s1, s2)\n #Explorer.Series \n\nYou can also use scalar values on both sides:\n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.add(s1, 2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.add(2, s1)\n #Explorer.Series","ref":"Explorer.Series.html#add/2-examples"},{"type":"function","title":"Explorer.Series.all_equal/2","doc":"Checks equality between two entire series.","ref":"Explorer.Series.html#all_equal/2"},{"type":"function","title":"Examples - Explorer.Series.all_equal/2","doc":"iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> Explorer.Series.all_equal(s1, s2)\n true\n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([\"a\", \"c\"])\n iex> Explorer.Series.all_equal(s1, s2)\n false\n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\"])\n iex> s2 = Explorer.Series.from_list([1, 2])\n iex> Explorer.Series.all_equal(s1, s2)\n false","ref":"Explorer.Series.html#all_equal/2-examples"},{"type":"function","title":"Explorer.Series.and/2","doc":"Returns a boolean mask of `left and right`, element-wise.\n\nBoth sizes must be series, the series must have the same\nsize or at last one of them must have size of 1.","ref":"Explorer.Series.html#and/2"},{"type":"function","title":"Examples - Explorer.Series.and/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> mask1 = Explorer.Series.greater(s1, 1)\n iex> mask2 = Explorer.Series.less(s1, 3)\n iex> Explorer.Series.and(mask1, mask2)\n #Explorer.Series","ref":"Explorer.Series.html#and/2-examples"},{"type":"function","title":"Explorer.Series.argmax/1","doc":"Gets the index of the maximum value of the series.","ref":"Explorer.Series.html#argmax/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.argmax/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#argmax/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.argmax/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.argmax(s)\n 3\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.argmax(s)\n 3\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.argmax(s)\n 0\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.argmax(s)\n 0\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.argmax(s)\n 1\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.argmax(s)\n ** (ArgumentError) Explorer.Series.argmax/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#argmax/1-examples"},{"type":"function","title":"Explorer.Series.argmin/1","doc":"Gets the index of the minimum value of the series.\n\nNote that `nil` is treated as a minimum value.","ref":"Explorer.Series.html#argmin/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.argmin/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#argmin/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.argmin/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.argmin(s)\n 2\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.argmin(s)\n 2\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.argmin(s)\n 1\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.argmin(s)\n 1\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.argmin(s)\n 0\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.argmin(s)\n ** (ArgumentError) Explorer.Series.argmin/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#argmin/1-examples"},{"type":"function","title":"Explorer.Series.argsort/2","doc":"Returns the indices that would sort the series.","ref":"Explorer.Series.html#argsort/2"},{"type":"function","title":"Options - Explorer.Series.argsort/2","doc":"* `:direction` - `:asc` or `:desc`, meaning \"ascending\" or \"descending\", respectively.\n By default it sorts in ascending order.\n\n * `:nils` - `:first` or `:last`. By default it is `:last` if direction is `:asc`, and\n `:first` otherwise.","ref":"Explorer.Series.html#argsort/2-options"},{"type":"function","title":"Examples - Explorer.Series.argsort/2","doc":"iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.argsort(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.argsort(s, direction: :desc)\n #Explorer.Series","ref":"Explorer.Series.html#argsort/2-examples"},{"type":"function","title":"Explorer.Series.asin/1","doc":"Computes the the arcsine of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between -pi/2 and pi/2.","ref":"Explorer.Series.html#asin/1"},{"type":"function","title":"Supported dtype - Explorer.Series.asin/1","doc":"* `:float`","ref":"Explorer.Series.html#asin/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.asin/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.asin(s)\n #Explorer.Series","ref":"Explorer.Series.html#asin/1-examples"},{"type":"function","title":"Explorer.Series.at/2","doc":"Returns the value of the series at the given index.\n\nThis function will raise an error in case the index\nis out of bounds.","ref":"Explorer.Series.html#at/2"},{"type":"function","title":"Examples - Explorer.Series.at/2","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.at(s, 2)\n \"c\"\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.at(s, 4)\n ** (ArgumentError) index 4 out of bounds for series of size 3","ref":"Explorer.Series.html#at/2-examples"},{"type":"function","title":"Explorer.Series.at_every/2","doc":"Takes every *n*th value in this series, returned as a new series.","ref":"Explorer.Series.html#at_every/2"},{"type":"function","title":"Examples - Explorer.Series.at_every/2","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.at_every(s, 2)\n #Explorer.Series \n\nIf *n* is bigger than the size of the series, the result is a new series with only the first value of the supplied series.\n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.at_every(s, 20)\n #Explorer.Series","ref":"Explorer.Series.html#at_every/2-examples"},{"type":"function","title":"Explorer.Series.atan/1","doc":"Computes the the arctangent of a number.\nThe resultant series is going to be of dtype `:float`, in radians, with values between -pi/2 and pi/2.","ref":"Explorer.Series.html#atan/1"},{"type":"function","title":"Supported dtype - Explorer.Series.atan/1","doc":"* `:float`","ref":"Explorer.Series.html#atan/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.atan/1","doc":"iex> s = [1.0, 0.0, -1.0, -0.7071067811865475, 0.7071067811865475] |> Explorer.Series.from_list()\n iex> Explorer.Series.atan(s)\n #Explorer.Series","ref":"Explorer.Series.html#atan/1-examples"},{"type":"function","title":"Explorer.Series.cast/2","doc":"Cast the series to another type.","ref":"Explorer.Series.html#cast/2"},{"type":"function","title":"Examples - Explorer.Series.cast/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :string)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :float)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :date)\n #Explorer.Series \n\nNote that `time` is represented as an integer of nanoseconds since midnight.\nIn Elixir we can't represent nanoseconds, only microseconds. So be aware that\ninformation can be lost if a conversion is needed (e.g. calling `to_list/1`).\n\n iex> s = Explorer.Series.from_list([1_000, 2_000, 3_000])\n iex> Explorer.Series.cast(s, :time)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([86399 * 1_000 * 1_000 * 1_000])\n iex> Explorer.Series.cast(s, :time)\n #Explorer.Series \n\nNote that `datetime` is represented as an integer of microseconds since Unix Epoch (1970-01-01 00:00:00).\n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, {:datetime, :microsecond})\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1649883642 * 1_000 * 1_000])\n iex> Explorer.Series.cast(s, {:datetime, :microsecond})\n #Explorer.Series \n\nYou can also use `cast/2` to categorise a string:\n\n iex> s = Explorer.Series.from_list([\"apple\", \"banana\", \"apple\", \"lemon\"])\n iex> Explorer.Series.cast(s, :category)\n #Explorer.Series \n\n`cast/2` will return the series as a no-op if you try to cast to the same dtype.\n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.cast(s, :integer)\n #Explorer.Series","ref":"Explorer.Series.html#cast/2-examples"},{"type":"function","title":"Explorer.Series.categories/1","doc":"Return a series with the category names of a categorical series.\n\nEach category has the index equal to its position.\nNo order for the categories is guaranteed.","ref":"Explorer.Series.html#categories/1"},{"type":"function","title":"Examples - Explorer.Series.categories/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\", nil, \"a\", \"c\"], dtype: :category)\n iex> Explorer.Series.categories(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"c\", \"a\", \"b\"], dtype: :category)\n iex> Explorer.Series.categories(s)\n #Explorer.Series","ref":"Explorer.Series.html#categories/1-examples"},{"type":"function","title":"Explorer.Series.categorise/2","doc":"Categorise a series of integers according to `categories`.\n\nThis function receives a series of integers and convert them into the\ncategories specified by the second argument. The second argument can\nbe one of:\n\n * a series with dtype `:category`. The integers will be indexes into\n the categories of the given series (returned by `categories/1`)\n\n * a series with dtype `:string`. The integers will be indexes into\n the series itself\n\n * a list of strings. The integers will be indexes into the list\n\nIf you have a series of strings and you want to convert them into categories,\ninvoke `cast(series, :category)` instead.","ref":"Explorer.Series.html#categorise/2"},{"type":"function","title":"Examples - Explorer.Series.categorise/2","doc":"If a categorical series is given as second argument, we will extract its\ncategories and map the integers into it:\n\n iex> categories = Explorer.Series.from_list([\"a\", \"b\", \"c\", nil, \"a\"], dtype: :category)\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, categories)\n #Explorer.Series \n\nOtherwise, if a list of strings or a series of strings is given, they are\nconsidered to be the categories series itself:\n\n iex> categories = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, categories)\n #Explorer.Series \n\n iex> indexes = Explorer.Series.from_list([0, 2, 1, 0, 2])\n iex> Explorer.Series.categorise(indexes, [\"a\", \"b\", \"c\"])\n #Explorer.Series \n\nElements that are not mapped to a category will become `nil`:\n\n iex> indexes = Explorer.Series.from_list([0, 2, nil, 0, 2, 7])\n iex> Explorer.Series.categorise(indexes, [\"a\", \"b\", \"c\"])\n #Explorer.Series","ref":"Explorer.Series.html#categorise/2-examples"},{"type":"function","title":"Explorer.Series.ceil/1","doc":"Ceil floating point series to highest integers smaller or equal to the float value.","ref":"Explorer.Series.html#ceil/1"},{"type":"function","title":"Examples - Explorer.Series.ceil/1","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.ceil(s)\n #Explorer.Series","ref":"Explorer.Series.html#ceil/1-examples"},{"type":"function","title":"Explorer.Series.clip/3","doc":"Clip (or clamp) the values in a series.\n\nValues that fall outside of the interval defined by the `min` and `max`\nbounds are clipped to the bounds.","ref":"Explorer.Series.html#clip/3"},{"type":"function","title":"Supported dtypes - Explorer.Series.clip/3","doc":"* `:integer`\n * `:float`\n\nClipping other dtypes are possible using `select/3`.","ref":"Explorer.Series.html#clip/3-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.clip/3","doc":"iex> s = Explorer.Series.from_list([-50, 5, nil, 50])\n iex> Explorer.Series.clip(s, 1, 10)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([-50, 5, nil, 50])\n iex> Explorer.Series.clip(s, 1.5, 10.5)\n #Explorer.Series","ref":"Explorer.Series.html#clip/3-examples"},{"type":"function","title":"Explorer.Series.coalesce/1","doc":"Finds the first non-missing element at each position.","ref":"Explorer.Series.html#coalesce/1"},{"type":"function","title":"Examples - Explorer.Series.coalesce/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, nil, nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> s3 = Explorer.Series.from_list([nil, nil, 3, 4])\n iex> Explorer.Series.coalesce([s1, s2, s3])\n #Explorer.Series","ref":"Explorer.Series.html#coalesce/1-examples"},{"type":"function","title":"Explorer.Series.coalesce/2","doc":"Finds the first non-missing element at each position.\n\n`coalesce(s1, s2)` is equivalent to `coalesce([s1, s2])`.","ref":"Explorer.Series.html#coalesce/2"},{"type":"function","title":"Examples - Explorer.Series.coalesce/2","doc":"iex> s1 = Explorer.Series.from_list([1, nil, 3, nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.coalesce(s1, s2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([\"foo\", nil, \"bar\", nil])\n iex> s2 = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.coalesce(s1, s2)\n ** (ArgumentError) cannot invoke Explorer.Series.coalesce/2 with mismatched dtypes: :string and :integer","ref":"Explorer.Series.html#coalesce/2-examples"},{"type":"function","title":"Explorer.Series.concat/1","doc":"Concatenate one or more series.\n\nThe dtypes must match unless all are numeric, in which case all series will be downcast to float.","ref":"Explorer.Series.html#concat/1"},{"type":"function","title":"Examples - Explorer.Series.concat/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.concat([s1, s2])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4.0, 5.0, 6.4])\n iex> Explorer.Series.concat([s1, s2])\n #Explorer.Series","ref":"Explorer.Series.html#concat/1-examples"},{"type":"function","title":"Explorer.Series.concat/2","doc":"Concatenate two series.\n\n`concat(s1, s2)` is equivalent to `concat([s1, s2])`.","ref":"Explorer.Series.html#concat/2"},{"type":"function","title":"Explorer.Series.contains/2","doc":"Detects whether a string contains a substring.","ref":"Explorer.Series.html#contains/2"},{"type":"function","title":"Examples - Explorer.Series.contains/2","doc":"iex> s = Explorer.Series.from_list([\"abc\", \"def\", \"bcd\"])\n iex> Explorer.Series.contains(s, \"bc\")\n #Explorer.Series","ref":"Explorer.Series.html#contains/2-examples"},{"type":"function","title":"Explorer.Series.correlation/3","doc":"Compute the Pearson's correlation between two series.\n\nThe parameter `ddof` refers to the 'delta degrees of freedom' - the divisor\nused in the correlation calculation. Defaults to 1.","ref":"Explorer.Series.html#correlation/3"},{"type":"function","title":"Supported dtypes - Explorer.Series.correlation/3","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#correlation/3-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.correlation/3","doc":"iex> s1 = Series.from_list([1, 8, 3])\n iex> s2 = Series.from_list([4, 5, 2])\n iex> Series.correlation(s1, s2)\n 0.5447047794019223","ref":"Explorer.Series.html#correlation/3-examples"},{"type":"function","title":"Explorer.Series.cos/1","doc":"Computes the the cosine of a number (in radians).\nThe resultant series is going to be of dtype `:float`, with values between 1 and -1.","ref":"Explorer.Series.html#cos/1"},{"type":"function","title":"Supported dtype - Explorer.Series.cos/1","doc":"* `:float`","ref":"Explorer.Series.html#cos/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.cos/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.cos(s)\n #Explorer.Series","ref":"Explorer.Series.html#cos/1-examples"},{"type":"function","title":"Explorer.Series.count/1","doc":"Counts the number of elements in a series.\n\nIn the context of lazy series and `Explorer.Query`,\n`count/1` counts the elements inside the same group.\nIf no group is in use, then count is going to return\nthe size of the series.","ref":"Explorer.Series.html#count/1"},{"type":"function","title":"Examples - Explorer.Series.count/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.count(s)\n 3","ref":"Explorer.Series.html#count/1-examples"},{"type":"function","title":"Explorer.Series.covariance/2","doc":"Compute the covariance between two series.","ref":"Explorer.Series.html#covariance/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.covariance/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#covariance/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.covariance/2","doc":"iex> s1 = Series.from_list([1, 8, 3])\n iex> s2 = Series.from_list([4, 5, 2])\n iex> Series.covariance(s1, s2)\n 3.0","ref":"Explorer.Series.html#covariance/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_max/2","doc":"Calculates the cumulative maximum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_max/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_max/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#cumulative_max/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_max/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_max(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_max/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_min/2","doc":"Calculates the cumulative minimum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_min/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_min/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#cumulative_min/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_min/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[02:04:19.000000], nil, ~T[13:24:56.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_min(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_min/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_product/2","doc":"Calculates the cumulative product of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_product/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_product/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#cumulative_product/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_product/2","doc":"iex> s = [1, 2, 3, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_product(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_product(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_product/2-examples"},{"type":"function","title":"Explorer.Series.cumulative_sum/2","doc":"Calculates the cumulative sum of the series.\n\nOptionally, can accumulate in reverse.\n\nDoes not fill nil values. See `fill_missing/2`.","ref":"Explorer.Series.html#cumulative_sum/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.cumulative_sum/2","doc":"* `:integer`\n * `:float`\n * `:boolean`","ref":"Explorer.Series.html#cumulative_sum/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.cumulative_sum/2","doc":"iex> s = [1, 2, 3, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_sum(s)\n #Explorer.Series \n\n iex> s = [1, 2, nil, 4] |> Explorer.Series.from_list()\n iex> Explorer.Series.cumulative_sum(s)\n #Explorer.Series","ref":"Explorer.Series.html#cumulative_sum/2-examples"},{"type":"function","title":"Explorer.Series.cut/3","doc":"Bins values into discrete values.\n\nGiven a `bins` length of N, there will be N+1 categories.","ref":"Explorer.Series.html#cut/3"},{"type":"function","title":"Options - Explorer.Series.cut/3","doc":"* `:labels` - The labels assigned to the bins. Given `bins` of\n length N, `:labels` must be of length N+1. Defaults to the bin\n bounds (e.g. `(-inf -1.0]`, `(-1.0, 1.0]`, `(1.0, inf]`)\n\n * `:break_point_label` - The name given to the breakpoint column.\n Defaults to `break_point`.\n\n * `:category_label` - The name given to the category column.\n Defaults to `category`.","ref":"Explorer.Series.html#cut/3-options"},{"type":"function","title":"Examples - Explorer.Series.cut/3","doc":"iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0])\n iex> Explorer.Series.cut(s, [1.5, 2.5])\n #Explorer.DataFrame","ref":"Explorer.Series.html#cut/3-examples"},{"type":"function","title":"Explorer.Series.day_of_week/1","doc":"Returns a day-of-week number starting from Monday = 1. (ISO 8601 weekday number)","ref":"Explorer.Series.html#day_of_week/1"},{"type":"function","title":"Examples - Explorer.Series.day_of_week/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-01-16], ~D[2023-01-20], nil])\n iex> Explorer.Series.day_of_week(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-01-16 23:59:59.999999], ~N[2023-01-20 12:00:00], nil])\n iex> Explorer.Series.day_of_week(s)\n #Explorer.Series","ref":"Explorer.Series.html#day_of_week/1-examples"},{"type":"function","title":"Explorer.Series.distinct/1","doc":"Returns the unique values of the series.","ref":"Explorer.Series.html#distinct/1"},{"type":"function","title":"Examples - Explorer.Series.distinct/1","doc":"iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.distinct(s)\n #Explorer.Series","ref":"Explorer.Series.html#distinct/1-examples"},{"type":"function","title":"Explorer.Series.divide/2","doc":"Divides left by right, element-wise.\n\nThe resulting series will have the dtype as `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#divide/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.divide/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#divide/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.divide/2","doc":"iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, 2)\n #Explorer.Series \n\n iex> s1 = [10, 52 ,10] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, 2.5)\n #Explorer.Series \n\n iex> s1 = [10, 10, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 0, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.divide(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#divide/2-examples"},{"type":"function","title":"Explorer.Series.downcase/1","doc":"Converts all characters to lowercase.","ref":"Explorer.Series.html#downcase/1"},{"type":"function","title":"Examples - Explorer.Series.downcase/1","doc":"iex> s = Explorer.Series.from_list([\"ABC\", \"DEF\", \"BCD\"])\n iex> Explorer.Series.downcase(s)\n #Explorer.Series","ref":"Explorer.Series.html#downcase/1-examples"},{"type":"function","title":"Explorer.Series.dtype/1","doc":"Returns the data type of the series.\n\nA series can be of the following data types:\n\n * `:float` - 64-bit floating point number\n * `:integer` - 64-bit signed integer\n * `:boolean` - Boolean\n * `:string` - UTF-8 encoded binary\n * `:date` - Date type that unwraps to `Elixir.Date`\n * `:time` - Time type that unwraps to `Elixir.Time`\n * `:datetime` - DateTime type that unwraps to `Elixir.NaiveDateTime`","ref":"Explorer.Series.html#dtype/1"},{"type":"function","title":"Examples - Explorer.Series.dtype/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.dtype(s)\n :integer\n\n iex> s = Explorer.Series.from_list([\"a\", nil, \"b\", \"c\"])\n iex> Explorer.Series.dtype(s)\n :string","ref":"Explorer.Series.html#dtype/1-examples"},{"type":"function","title":"Explorer.Series.equal/2","doc":"Returns boolean mask of `left == right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#equal/2"},{"type":"function","title":"Examples - Explorer.Series.equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.equal(s1, s2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.equal(s, 1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([true, true, false])\n iex> Explorer.Series.equal(s, true)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.equal(s, \"a\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.equal(s, ~D[1999-12-31])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])\n iex> Explorer.Series.equal(s, ~N[2022-01-01 00:00:00])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.equal(s, false)\n ** (ArgumentError) cannot invoke Explorer.Series.equal/2 with mismatched dtypes: :string and false","ref":"Explorer.Series.html#equal/2-examples"},{"type":"function","title":"Explorer.Series.ewm_mean/2","doc":"Calculate the exponentially weighted moving average, given smoothing factor alpha.","ref":"Explorer.Series.html#ewm_mean/2"},{"type":"function","title":"Options - Explorer.Series.ewm_mean/2","doc":"* `:alpha` - Optional smoothing factor which specifies the imporance given\n to most recent observations. It is a value such that, 0 < alpha <= 1. Defaults to 0.5.\n\n * `:adjust` - If set to true, it corrects the bias introduced by smoothing process.\n Defaults to `true`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. Defaults to `1`.\n\n * `:ignore_nils` - If set to true, it ignore nulls in the calculation. Defaults to `true`.","ref":"Explorer.Series.html#ewm_mean/2-options"},{"type":"function","title":"Examples - Explorer.Series.ewm_mean/2","doc":"iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.ewm_mean(s)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.ewm_mean(s, alpha: 0.1)\n #Explorer.Series","ref":"Explorer.Series.html#ewm_mean/2-examples"},{"type":"function","title":"Explorer.Series.exp/1","doc":"Calculates the exponential of all elements.","ref":"Explorer.Series.html#exp/1"},{"type":"function","title":"Explorer.Series.fill_missing/2","doc":"Fill missing values with the given strategy. If a scalar value is provided instead of a strategy\natom, `nil` will be replaced with that value. It must be of the same `dtype` as the series.","ref":"Explorer.Series.html#fill_missing/2"},{"type":"function","title":"Strategies - Explorer.Series.fill_missing/2","doc":"* `:forward` - replace nil with the previous value\n * `:backward` - replace nil with the next value\n * `:max` - replace nil with the series maximum\n * `:min` - replace nil with the series minimum\n * `:mean` - replace nil with the series mean\n * `:nan` (float only) - replace nil with `NaN`","ref":"Explorer.Series.html#fill_missing/2-strategies"},{"type":"function","title":"Examples - Explorer.Series.fill_missing/2","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :forward)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :backward)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :max)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :min)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, :mean)\n #Explorer.Series \n\nValues that belong to the series itself can also be added as missing:\n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, 3)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", nil, \"d\"])\n iex> Explorer.Series.fill_missing(s, \"c\")\n #Explorer.Series \n\nMismatched types will raise:\n\n iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.fill_missing(s, \"foo\")\n ** (ArgumentError) cannot invoke Explorer.Series.fill_missing/2 with mismatched dtypes: :integer and \"foo\"\n\nFloats in particular accept missing values to be set to NaN, Inf, and -Inf:\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :nan)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :infinity)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 4.0])\n iex> Explorer.Series.fill_missing(s, :neg_infinity)\n #Explorer.Series","ref":"Explorer.Series.html#fill_missing/2-examples"},{"type":"function","title":"Explorer.Series.first/1","doc":"Returns the first element of the series.","ref":"Explorer.Series.html#first/1"},{"type":"function","title":"Examples - Explorer.Series.first/1","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.first(s)\n 1","ref":"Explorer.Series.html#first/1-examples"},{"type":"function","title":"Explorer.Series.floor/1","doc":"Floor floating point series to lowest integers smaller or equal to the float value.","ref":"Explorer.Series.html#floor/1"},{"type":"function","title":"Examples - Explorer.Series.floor/1","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.floor(s)\n #Explorer.Series","ref":"Explorer.Series.html#floor/1-examples"},{"type":"function","title":"Explorer.Series.format/1","doc":"Returns a string series with all values concatenated.","ref":"Explorer.Series.html#format/1"},{"type":"function","title":"Examples - Explorer.Series.format/1","doc":"iex> s1 = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> s2 = Explorer.Series.from_list([\"d\", \"e\", \"f\"])\n iex> s3 = Explorer.Series.from_list([\"g\", \"h\", \"i\"])\n iex> Explorer.Series.format([s1, s2, s3])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"d\"])\n iex> s2 = Explorer.Series.from_list([1, 2, 3, 4])\n iex> s3 = Explorer.Series.from_list([1.5, :nan, :infinity, :neg_infinity])\n iex> Explorer.Series.format([s1, \"/\", s2, \"/\", s3])\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([ >, >], dtype: :binary)\n iex> s2 = Explorer.Series.from_list([ >, >], dtype: :binary)\n iex> Explorer.Series.format([s1, s2])\n ** (RuntimeError) Polars Error: External error: invalid utf-8 sequence","ref":"Explorer.Series.html#format/1-examples"},{"type":"function","title":"Explorer.Series.frequencies/1","doc":"Creates a new dataframe with unique values and the frequencies of each.","ref":"Explorer.Series.html#frequencies/1"},{"type":"function","title":"Examples - Explorer.Series.frequencies/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"a\", \"b\", \"c\", \"c\", \"c\"])\n iex> Explorer.Series.frequencies(s)\n #Explorer.DataFrame","ref":"Explorer.Series.html#frequencies/1-examples"},{"type":"function","title":"Explorer.Series.from_binary/3","doc":"Builds a series of `dtype` from `binary`.\n\nAll binaries must be in native endianness.","ref":"Explorer.Series.html#from_binary/3"},{"type":"function","title":"Options - Explorer.Series.from_binary/3","doc":"* `:backend` - The backend to allocate the series on.","ref":"Explorer.Series.html#from_binary/3-options"},{"type":"function","title":"Examples - Explorer.Series.from_binary/3","doc":"Integers and floats follow their native encoding:\n\n iex> Explorer.Series.from_binary( >, :float)\n #Explorer.Series \n\n iex> Explorer.Series.from_binary( >, :integer)\n #Explorer.Series \n\nBooleans are unsigned integers:\n\n iex> Explorer.Series.from_binary( >, :boolean)\n #Explorer.Series \n\nDates are encoded as i32 representing days from the Unix epoch (1970-01-01):\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, :date)\n #Explorer.Series \n\nTimes are encoded as i64 representing nanoseconds from midnight:\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, :time)\n #Explorer.Series \n\nDatetimes are encoded as i64 representing microseconds from the Unix epoch (1970-01-01):\n\n iex> binary = >\n iex> Explorer.Series.from_binary(binary, {:datetime, :microsecond})\n #Explorer.Series","ref":"Explorer.Series.html#from_binary/3-examples"},{"type":"function","title":"Explorer.Series.from_list/2","doc":"Creates a new series from a list.\n\nThe list must consist of a single data type and nils. It is possible to have\na list of only nil values. In this case, the list will have the `:dtype` of float.","ref":"Explorer.Series.html#from_list/2"},{"type":"function","title":"Options - Explorer.Series.from_list/2","doc":"* `:backend` - The backend to allocate the series on.\n * `:dtype` - Cast the series to a given `:dtype`. By default this is `nil`, which means\n that Explorer will infer the type from the values in the list.","ref":"Explorer.Series.html#from_list/2-options"},{"type":"function","title":"Examples - Explorer.Series.from_list/2","doc":"Explorer will infer the type from the values in the list:\n\n iex> Explorer.Series.from_list([1, 2, 3])\n #Explorer.Series \n\nSeries are nullable, so you may also include nils:\n\n iex> Explorer.Series.from_list([1.0, nil, 2.5, 3.1])\n #Explorer.Series \n\nA mix of integers and floats will be cast to a float:\n\n iex> Explorer.Series.from_list([1, 2.0])\n #Explorer.Series \n\nFloats series can accept NaN, Inf, and -Inf values:\n\n iex> Explorer.Series.from_list([1.0, 2.0, :nan, 4.0])\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1.0, 2.0, :infinity, 4.0])\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1.0, 2.0, :neg_infinity, 4.0])\n #Explorer.Series \n\nTrying to create a \"nil\" series will, by default, result in a series of floats:\n\n iex> Explorer.Series.from_list([nil, nil])\n #Explorer.Series \n\nYou can specify the desired `dtype` for a series with the `:dtype` option.\n\n iex> Explorer.Series.from_list([nil, nil], dtype: :integer)\n #Explorer.Series \n\n iex> Explorer.Series.from_list([1, nil], dtype: :string)\n #Explorer.Series \n\nThe `dtype` option is particulary important if a `:binary` series is desired, because\nby default binary series will have the dtype of `:string`:\n\n iex> Explorer.Series.from_list([ >, >], dtype: :binary)\n #Explorer.Series >, >]\n >\n\nA series mixing UTF8 strings and binaries is possible:\n\n iex> Explorer.Series.from_list([ >, \"Elixir\"], dtype: :binary)\n #Explorer.Series >, \"Elixir\"]\n >\n\nAnother option is to create a categorical series from a list of strings:\n\n iex> Explorer.Series.from_list([\"EUA\", \"Brazil\", \"Poland\"], dtype: :category)\n #Explorer.Series \n\nIt is possible to create a series of `:datetime` from a list of microseconds since Unix Epoch.\n\n iex> Explorer.Series.from_list([1649883642 * 1_000 * 1_000], dtype: {:datetime, :microsecond})\n #Explorer.Series \n\nIt is possible to create a series of `:time` from a list of nanoseconds since midnight.\n\n iex> Explorer.Series.from_list([123 * 1_000 * 1_000 * 1_000], dtype: :time)\n #Explorer.Series \n\nMixing non-numeric data types will raise an ArgumentError:\n\n iex> Explorer.Series.from_list([1, \"a\"])\n ** (ArgumentError) the value \"a\" does not match the inferred series dtype :integer","ref":"Explorer.Series.html#from_list/2-examples"},{"type":"function","title":"Explorer.Series.from_tensor/2","doc":"Converts a `t:Nx.Tensor.t/0` to a series.\n\n> ##","ref":"Explorer.Series.html#from_tensor/2"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.from_tensor/2","doc":">\n> `Nx` is an optional dependency. You will need to ensure it's installed to use this function.","ref":"Explorer.Series.html#from_tensor/2-warning-warning"},{"type":"function","title":"Options - Explorer.Series.from_tensor/2","doc":"* `:backend` - The backend to allocate the series on.\n * `:dtype` - The dtype of the series, it must match the underlying tensor type.","ref":"Explorer.Series.html#from_tensor/2-options"},{"type":"function","title":"Examples - Explorer.Series.from_tensor/2","doc":"Integers and floats:\n\n iex> tensor = Nx.tensor([1, 2, 3])\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\n iex> tensor = Nx.tensor([1.0, 2.0, 3.0], type: :f64)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nUnsigned 8-bit tensors are assumed to be booleans:\n\n iex> tensor = Nx.tensor([1, 0, 1], type: :u8)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nSigned 32-bit tensors are assumed to be dates:\n\n iex> tensor = Nx.tensor([-719162, 0, 6129], type: :s32)\n iex> Explorer.Series.from_tensor(tensor)\n #Explorer.Series \n\nTimes are signed 64-bit representing nanoseconds from midnight and\ntherefore must have their dtype explicitly given:\n\n iex> tensor = Nx.tensor([0, 86399999999000])\n iex> Explorer.Series.from_tensor(tensor, dtype: :time)\n #Explorer.Series \n\nDatetimes are signed 64-bit and therefore must have their dtype explicitly given:\n\n iex> tensor = Nx.tensor([0, 529550625987654])\n iex> Explorer.Series.from_tensor(tensor, dtype: {:datetime, :microsecond})\n #Explorer.Series","ref":"Explorer.Series.html#from_tensor/2-examples"},{"type":"function","title":"Explorer.Series.greater/2","doc":"Returns boolean mask of `left > right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#greater/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.greater/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#greater/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.greater/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.greater(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#greater/2-examples"},{"type":"function","title":"Explorer.Series.greater_equal/2","doc":"Returns boolean mask of `left >= right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#greater_equal/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.greater_equal/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#greater_equal/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.greater_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.greater_equal(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#greater_equal/2-examples"},{"type":"function","title":"Explorer.Series.head/2","doc":"Returns the first N elements of the series.","ref":"Explorer.Series.html#head/2"},{"type":"function","title":"Examples - Explorer.Series.head/2","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.head(s)\n #Explorer.Series","ref":"Explorer.Series.html#head/2-examples"},{"type":"function","title":"Explorer.Series.hour/1","doc":"Returns the hour number from 0 to 23.","ref":"Explorer.Series.html#hour/1"},{"type":"function","title":"Examples - Explorer.Series.hour/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.hour(s)\n #Explorer.Series","ref":"Explorer.Series.html#hour/1-examples"},{"type":"function","title":"Explorer.Series.in/2","doc":"Checks if each element of the series in the left exists in the series in the right, returning a boolean mask.\n\nThe series sizes do not have to match.","ref":"Explorer.Series.html#in/2"},{"type":"function","title":"Examples - Explorer.Series.in/2","doc":"iex> left = Explorer.Series.from_list([1, 2, 3])\n iex> right = Explorer.Series.from_list([1, 2])\n iex> Series.in(left, right)\n #Explorer.Series \n\n iex> left = Explorer.Series.from_list([~D[1970-01-01], ~D[2000-01-01], ~D[2010-04-17]])\n iex> right = Explorer.Series.from_list([~D[1970-01-01], ~D[2010-04-17]])\n iex> Series.in(left, right)\n #Explorer.Series","ref":"Explorer.Series.html#in/2-examples"},{"type":"function","title":"Explorer.Series.iotype/1","doc":"Returns the type of the underlying fixed-width binary representation.\n\nIt returns something in the shape of `{atom(), bits_size}` or `:none`.\nIt is often used in conjunction with `to_iovec/1` and `to_binary/1`.\n\nThe possible iotypes are:\n\n* `:u` for unsigned integers.\n* `:s` for signed integers.\n* `:f` for floats.","ref":"Explorer.Series.html#iotype/1"},{"type":"function","title":"Examples - Explorer.Series.iotype/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4])\n iex> Explorer.Series.iotype(s)\n {:s, 64}\n\n iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])\n iex> Explorer.Series.iotype(s)\n {:s, 32}\n\n iex> s = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])\n iex> Explorer.Series.iotype(s)\n {:s, 64}\n\n iex> s = Explorer.Series.from_list([1.2, 2.3, 3.5, 4.5])\n iex> Explorer.Series.iotype(s)\n {:f, 64}\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.iotype(s)\n {:u, 8}\n\nThe operation returns `:none` for strings and binaries, as they do not\nprovide a fixed-width binary representation:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.iotype(s)\n :none\n\nHowever, if appropriate, you can convert them to categorical types,\nwhich will then return the index of each category:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"], dtype: :category)\n iex> Explorer.Series.iotype(s)\n {:u, 32}","ref":"Explorer.Series.html#iotype/1-examples"},{"type":"function","title":"Explorer.Series.is_finite/1","doc":"Returns a mask of finite values.","ref":"Explorer.Series.html#is_finite/1"},{"type":"function","title":"Examples - Explorer.Series.is_finite/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_finite(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_finite/1-examples"},{"type":"function","title":"Explorer.Series.is_infinite/1","doc":"Returns a mask of infinite values.","ref":"Explorer.Series.html#is_infinite/1"},{"type":"function","title":"Examples - Explorer.Series.is_infinite/1","doc":"iex> s1 = Explorer.Series.from_list([1, -1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_infinite(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_infinite/1-examples"},{"type":"function","title":"Explorer.Series.is_nan/1","doc":"Returns a mask of infinite values.","ref":"Explorer.Series.html#is_nan/1"},{"type":"function","title":"Examples - Explorer.Series.is_nan/1","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 0, nil])\n iex> s2 = Explorer.Series.from_list([0, 2, 0, nil])\n iex> s3 = Explorer.Series.divide(s1, s2)\n iex> Explorer.Series.is_nan(s3)\n #Explorer.Series","ref":"Explorer.Series.html#is_nan/1-examples"},{"type":"function","title":"Explorer.Series.is_nil/1","doc":"Returns a mask of nil values.","ref":"Explorer.Series.html#is_nil/1"},{"type":"function","title":"Examples - Explorer.Series.is_nil/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.is_nil(s)\n #Explorer.Series","ref":"Explorer.Series.html#is_nil/1-examples"},{"type":"function","title":"Explorer.Series.is_not_nil/1","doc":"Returns a mask of not nil values.","ref":"Explorer.Series.html#is_not_nil/1"},{"type":"function","title":"Examples - Explorer.Series.is_not_nil/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 4])\n iex> Explorer.Series.is_not_nil(s)\n #Explorer.Series","ref":"Explorer.Series.html#is_not_nil/1-examples"},{"type":"function","title":"Explorer.Series.last/1","doc":"Returns the last element of the series.","ref":"Explorer.Series.html#last/1"},{"type":"function","title":"Examples - Explorer.Series.last/1","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.last(s)\n 100","ref":"Explorer.Series.html#last/1-examples"},{"type":"function","title":"Explorer.Series.less/2","doc":"Returns boolean mask of `left < right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#less/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.less/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#less/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.less/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.less(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#less/2-examples"},{"type":"function","title":"Explorer.Series.less_equal/2","doc":"Returns boolean mask of `left <= right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#less_equal/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.less_equal/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#less_equal/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.less_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.less_equal(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#less_equal/2-examples"},{"type":"function","title":"Explorer.Series.log/1","doc":"Calculates the natural logarithm.\n\nThe resultant series is going to be of dtype `:float`.\nSee `log/2` for passing a custom base.","ref":"Explorer.Series.html#log/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.log/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#log/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.log/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, nil, 4])\n iex> Explorer.Series.log(s)\n #Explorer.Series","ref":"Explorer.Series.html#log/1-examples"},{"type":"function","title":"Explorer.Series.log/2","doc":"Calculates the logarithm on a given base.\n\nThe resultant series is going to be of dtype `:float`.","ref":"Explorer.Series.html#log/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.log/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#log/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.log/2","doc":"iex> s = Explorer.Series.from_list([8, 16, 32])\n iex> Explorer.Series.log(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#log/2-examples"},{"type":"function","title":"Explorer.Series.lstrip/1","doc":"Returns a string series where all leading Unicode whitespaces have been removed.","ref":"Explorer.Series.html#lstrip/1"},{"type":"function","title":"Examples - Explorer.Series.lstrip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd\"])\n iex> Explorer.Series.lstrip(s)\n #Explorer.Series","ref":"Explorer.Series.html#lstrip/1-examples"},{"type":"function","title":"Explorer.Series.lstrip/2","doc":"Returns a string series where all leading examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#lstrip/2"},{"type":"function","title":"Examples - Explorer.Series.lstrip/2","doc":"iex> s = Explorer.Series.from_list([\"$1\", \"$$200$$\", \"$$$3000$\"])\n iex> Explorer.Series.lstrip(s, \"$\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcda\"])\n iex> Explorer.Series.lstrip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#lstrip/2-examples"},{"type":"function","title":"Explorer.Series.mask/2","doc":"Filters a series with a mask.","ref":"Explorer.Series.html#mask/2"},{"type":"function","title":"Examples - Explorer.Series.mask/2","doc":"iex> s1 = Explorer.Series.from_list([1,2,3])\n iex> s2 = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.mask(s1, s2)\n #Explorer.Series","ref":"Explorer.Series.html#mask/2-examples"},{"type":"function","title":"Explorer.Series.max/1","doc":"Gets the maximum value of the series.","ref":"Explorer.Series.html#max/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.max/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#max/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.max/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.max(s)\n 3\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.max(s)\n 3.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.max(s)\n ~D[2021-01-01]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.max(s)\n ~N[2021-01-01 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000212], ~T[00:05:04.000456]])\n iex> Explorer.Series.max(s)\n ~T[00:05:04.000456]\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.max(s)\n ** (ArgumentError) Explorer.Series.max/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#max/1-examples"},{"type":"function","title":"Explorer.Series.mean/1","doc":"Gets the mean value of the series.","ref":"Explorer.Series.html#mean/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.mean/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#mean/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.mean/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.mean(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.mean(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.mean(s)\n ** (ArgumentError) Explorer.Series.mean/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#mean/1-examples"},{"type":"function","title":"Explorer.Series.median/1","doc":"Gets the median value of the series.","ref":"Explorer.Series.html#median/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.median/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#median/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.median/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.median(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.median(s)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.median(s)\n ** (ArgumentError) Explorer.Series.median/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#median/1-examples"},{"type":"function","title":"Explorer.Series.min/1","doc":"Gets the minimum value of the series.","ref":"Explorer.Series.html#min/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.min/1","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#min/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.min/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.min(s)\n 1\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.min(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.min(s)\n ~D[1999-12-31]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.min(s)\n ~N[1999-12-31 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[00:02:03.000451], ~T[00:05:04.000134]])\n iex> Explorer.Series.min(s)\n ~T[00:02:03.000451]\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.min(s)\n ** (ArgumentError) Explorer.Series.min/1 not implemented for dtype :string. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#min/1-examples"},{"type":"function","title":"Explorer.Series.minute/1","doc":"Returns the minute number from 0 to 59.","ref":"Explorer.Series.html#minute/1"},{"type":"function","title":"Examples - Explorer.Series.minute/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.minute(s)\n #Explorer.Series","ref":"Explorer.Series.html#minute/1-examples"},{"type":"function","title":"Explorer.Series.month/1","doc":"Returns the month number starting from 1. The return value ranges from 1 to 12.","ref":"Explorer.Series.html#month/1"},{"type":"function","title":"Examples - Explorer.Series.month/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2023-02-16], ~D[2023-03-20], nil])\n iex> Explorer.Series.month(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2023-02-16 23:59:59.999999], ~N[2023-03-20 12:00:00], nil])\n iex> Explorer.Series.month(s)\n #Explorer.Series","ref":"Explorer.Series.html#month/1-examples"},{"type":"function","title":"Explorer.Series.multiply/2","doc":"Multiplies left and right, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#multiply/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.multiply/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#multiply/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.multiply/2","doc":"iex> s1 = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> s2 = 11..20 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.multiply(s1, s2)\n #Explorer.Series \n\n iex> s1 = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.multiply(s1, 2)\n #Explorer.Series","ref":"Explorer.Series.html#multiply/2-examples"},{"type":"function","title":"Explorer.Series.n_distinct/1","doc":"Returns the number of unique values in the series.","ref":"Explorer.Series.html#n_distinct/1"},{"type":"function","title":"Examples - Explorer.Series.n_distinct/1","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"a\", \"b\"])\n iex> Explorer.Series.n_distinct(s)\n 2","ref":"Explorer.Series.html#n_distinct/1-examples"},{"type":"function","title":"Explorer.Series.nil_count/1","doc":"Counts the number of null elements in a series.","ref":"Explorer.Series.html#nil_count/1"},{"type":"function","title":"Examples - Explorer.Series.nil_count/1","doc":"iex> s = Explorer.Series.from_list([\"a\", nil, \"c\", nil, nil])\n iex> Explorer.Series.nil_count(s)\n 3","ref":"Explorer.Series.html#nil_count/1-examples"},{"type":"function","title":"Explorer.Series.not/1","doc":"Negate the elements of a boolean series.","ref":"Explorer.Series.html#not/1"},{"type":"function","title":"Examples - Explorer.Series.not/1","doc":"iex> s1 = Explorer.Series.from_list([true, false, false])\n iex> Explorer.Series.not(s1)\n #Explorer.Series","ref":"Explorer.Series.html#not/1-examples"},{"type":"function","title":"Explorer.Series.not_equal/2","doc":"Returns boolean mask of `left != right`, element-wise.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#not_equal/2"},{"type":"function","title":"Examples - Explorer.Series.not_equal/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([1, 2, 4])\n iex> Explorer.Series.not_equal(s1, s2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.not_equal(s, 1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([true, true, false])\n iex> Explorer.Series.not_equal(s, true)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.not_equal(s, \"a\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.not_equal(s, ~D[1999-12-31])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([~N[2022-01-01 00:00:00], ~N[2022-01-01 23:00:00]])\n iex> Explorer.Series.not_equal(s, ~N[2022-01-01 00:00:00])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.not_equal(s, false)\n ** (ArgumentError) cannot invoke Explorer.Series.not_equal/2 with mismatched dtypes: :string and false","ref":"Explorer.Series.html#not_equal/2-examples"},{"type":"function","title":"Explorer.Series.or/2","doc":"Returns a boolean mask of `left or right`, element-wise.\n\nBoth sizes must be series, the series must have the same\nsize or at last one of them must have size of 1.","ref":"Explorer.Series.html#or/2"},{"type":"function","title":"Examples - Explorer.Series.or/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> mask1 = Explorer.Series.less(s1, 2)\n iex> mask2 = Explorer.Series.greater(s1, 2)\n iex> Explorer.Series.or(mask1, mask2)\n #Explorer.Series","ref":"Explorer.Series.html#or/2-examples"},{"type":"function","title":"Explorer.Series.peaks/2","doc":"Returns a boolean mask with `true` where the 'peaks' (series max or min, default max) are.","ref":"Explorer.Series.html#peaks/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.peaks/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#peaks/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.peaks/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 4, 1, 4])\n iex> Explorer.Series.peaks(s)\n #Explorer.Series \n\n iex> s = [~T[03:00:02.000000], ~T[13:24:56.000000], ~T[02:04:19.000000]] |> Explorer.Series.from_list()\n iex> Explorer.Series.peaks(s)\n #Explorer.Series","ref":"Explorer.Series.html#peaks/2-examples"},{"type":"function","title":"Explorer.Series.pow/2","doc":"Raises a numeric series to the power of the exponent.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#pow/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.pow/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#pow/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.pow/2","doc":"iex> s = [8, 16, 32] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 2.0)\n #Explorer.Series \n\n iex> s = [2, 4, 6] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 3)\n #Explorer.Series \n\n iex> s = [2, 4, 6] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, -3.0)\n #Explorer.Series \n\n iex> s = [1.0, 2.0, 3.0] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 3.0)\n #Explorer.Series \n\n iex> s = [2.0, 4.0, 6.0] |> Explorer.Series.from_list()\n iex> Explorer.Series.pow(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#pow/2-examples"},{"type":"function","title":"Explorer.Series.product/1","doc":"Reduce this Series to the product value.","ref":"Explorer.Series.html#product/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.product/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#product/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.product/1","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.product(s)\n 6\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.product(s)\n ** (ArgumentError) Explorer.Series.product/1 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#product/1-examples"},{"type":"function","title":"Explorer.Series.qcut/3","doc":"Bins values into discrete values base on their quantiles.\n\nGiven a `quantiles` length of N, there will be N+1 categories. Each\nelement of `quantiles` is expected to be between 0.0 and 1.0.","ref":"Explorer.Series.html#qcut/3"},{"type":"function","title":"Options - Explorer.Series.qcut/3","doc":"* `:labels` - The labels assigned to the bins. Given `bins` of\n length N, `:labels` must be of length N+1. Defaults to the bin\n bounds (e.g. `(-inf -1.0]`, `(-1.0, 1.0]`, `(1.0, inf]`)\n\n * `:break_point_label` - The name given to the breakpoint column.\n Defaults to `break_point`.\n\n * `:category_label` - The name given to the category column.\n Defaults to `category`.","ref":"Explorer.Series.html#qcut/3-options"},{"type":"function","title":"Examples - Explorer.Series.qcut/3","doc":"iex> s = Explorer.Series.from_list([1.0, 2.0, 3.0, 4.0, 5.0])\n iex> Explorer.Series.qcut(s, [0.25, 0.75])\n #Explorer.DataFrame","ref":"Explorer.Series.html#qcut/3-examples"},{"type":"function","title":"Explorer.Series.quantile/2","doc":"Gets the given quantile of the series.","ref":"Explorer.Series.html#quantile/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.quantile/2","doc":"* `:integer`\n * `:float`\n * `:date`\n * `:time`\n * `:datetime`","ref":"Explorer.Series.html#quantile/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.quantile/2","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.quantile(s, 0.2)\n 1\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.quantile(s, 0.5)\n 2.0\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~D[2021-01-01]\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~N[2021-01-01 00:00:00.000000]\n\n iex> s = Explorer.Series.from_list([~T[01:55:00], ~T[15:35:00], ~T[23:00:00]])\n iex> Explorer.Series.quantile(s, 0.5)\n ~T[15:35:00]\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.quantile(s, 0.5)\n ** (ArgumentError) Explorer.Series.quantile/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float, :date, :time, {:datetime, :nanosecond}, {:datetime, :microsecond}, {:datetime, :millisecond}]","ref":"Explorer.Series.html#quantile/2-examples"},{"type":"function","title":"Explorer.Series.quotient/2","doc":"Element-wise integer division.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#quotient/2"},{"type":"function","title":"Supported dtype - Explorer.Series.quotient/2","doc":"* `:integer`\n\nReturns `nil` if there is a zero in the right-hand side.","ref":"Explorer.Series.html#quotient/2-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.quotient/2","doc":"iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 12, 15] |> Explorer.Series.from_list()\n iex> Explorer.Series.quotient(s1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#quotient/2-examples"},{"type":"function","title":"Explorer.Series.rank/2","doc":"Assign ranks to data with appropriate handling of tied values.","ref":"Explorer.Series.html#rank/2"},{"type":"function","title":"Options - Explorer.Series.rank/2","doc":"* `:method` - Determine how ranks are assigned to tied elements. The following methods are available:\n - `\"average\"` : Each value receives the average rank that would be assigned to all tied values. (default)\n - `\"min\"` : Tied values are assigned the minimum rank. Also known as \"competition\" ranking.\n - `\"max\"` : Tied values are assigned the maximum of their ranks.\n - `\"dense\"` : Similar to `\"min\"`, but the rank of the next highest element is assigned the rank immediately after those assigned to the tied elements.\n - `\"ordinal\"` : Each value is given a distinct rank based on its occurrence in the series.\n - `\"random\"` : Similar to `\"ordinal\"`, but the rank for ties is not dependent on the order that the values occur in the Series.\n* `:descending` - Rank in descending order.\n* `:seed` - An integer to be used as a random seed. If nil, a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)","ref":"Explorer.Series.html#rank/2-options"},{"type":"function","title":"Examples - Explorer.Series.rank/2","doc":"iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1.1, 2.4, 3.2])\n iex> Explorer.Series.rank(s, method: \"ordinal\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([ ~N[2022-07-07 17:44:13.020548], ~N[2022-07-07 17:43:08.473561], ~N[2022-07-07 17:45:00.116337] ])\n iex> Explorer.Series.rank(s, method: \"average\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"min\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"dense\")\n #Explorer.Series \n\n\n iex> s = Explorer.Series.from_list([3, 6, 1, 1, 6])\n iex> Explorer.Series.rank(s, method: \"random\", seed: 42)\n #Explorer.Series","ref":"Explorer.Series.html#rank/2-examples"},{"type":"function","title":"Explorer.Series.remainder/2","doc":"Computes the remainder of an element-wise integer division.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#remainder/2"},{"type":"function","title":"Supported dtype - Explorer.Series.remainder/2","doc":"* `:integer`\n\nReturns `nil` if there is a zero in the right-hand side.","ref":"Explorer.Series.html#remainder/2-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.remainder/2","doc":"iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 2] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 10] |> Explorer.Series.from_list()\n iex> s2 = [2, 2, 0] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, s2)\n #Explorer.Series \n\n iex> s1 = [10, 11, 9] |> Explorer.Series.from_list()\n iex> Explorer.Series.remainder(s1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#remainder/2-examples"},{"type":"function","title":"Explorer.Series.replace/2","doc":"Replaces the contents of the given series by the one given in\na tensor or list.\n\nThe new series will have the same dtype and backend as the current\nseries, but the size may not necessarily match.","ref":"Explorer.Series.html#replace/2"},{"type":"function","title":"Tensor examples - Explorer.Series.replace/2","doc":"iex> s = Explorer.Series.from_list([0, 1, 2])\n iex> Explorer.Series.replace(s, Nx.tensor([1, 2, 3]))\n #Explorer.Series \n\nThis is particularly useful for categorical columns:\n\n iex> s = Explorer.Series.from_list([\"foo\", \"bar\", \"baz\"], dtype: :category)\n iex> Explorer.Series.replace(s, Nx.tensor([2, 1, 0]))\n #Explorer.Series","ref":"Explorer.Series.html#replace/2-tensor-examples"},{"type":"function","title":"List examples - Explorer.Series.replace/2","doc":"Similar to tensors, we can also replace by lists:\n\n iex> s = Explorer.Series.from_list([0, 1, 2])\n iex> Explorer.Series.replace(s, [1, 2, 3, 4, 5])\n #Explorer.Series \n\nThe same considerations as above apply.","ref":"Explorer.Series.html#replace/2-list-examples"},{"type":"function","title":"Explorer.Series.reverse/1","doc":"Reverses the series order.","ref":"Explorer.Series.html#reverse/1"},{"type":"function","title":"Example - Explorer.Series.reverse/1","doc":"iex> s = [1, 2, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.reverse(s)\n #Explorer.Series","ref":"Explorer.Series.html#reverse/1-example"},{"type":"function","title":"Explorer.Series.round/2","doc":"Round floating point series to given decimal places.","ref":"Explorer.Series.html#round/2"},{"type":"function","title":"Examples - Explorer.Series.round/2","doc":"iex> s = Explorer.Series.from_list([1.124993, 2.555321, 3.995001])\n iex> Explorer.Series.round(s, 2)\n #Explorer.Series","ref":"Explorer.Series.html#round/2-examples"},{"type":"function","title":"Explorer.Series.rstrip/1","doc":"Returns a string series where all trailing Unicode whitespaces have been removed.","ref":"Explorer.Series.html#rstrip/1"},{"type":"function","title":"Examples - Explorer.Series.rstrip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd\"])\n iex> Explorer.Series.rstrip(s)\n #Explorer.Series","ref":"Explorer.Series.html#rstrip/1-examples"},{"type":"function","title":"Explorer.Series.rstrip/2","doc":"Returns a string series where all trailing examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#rstrip/2"},{"type":"function","title":"Examples - Explorer.Series.rstrip/2","doc":"iex> s = Explorer.Series.from_list([\"__abc__\", \"def_\", \"__bcd_\"])\n iex> Explorer.Series.rstrip(s, \"_\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcdabaaa\"])\n iex> Explorer.Series.rstrip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#rstrip/2-examples"},{"type":"function","title":"Explorer.Series.sample/3","doc":"Returns a random sample of the series.\n\nIf given an integer as the second argument, it will return N samples. If given a float, it will\nreturn that proportion of the series.\n\nCan sample with or without replace.","ref":"Explorer.Series.html#sample/3"},{"type":"function","title":"Options - Explorer.Series.sample/3","doc":"* `:replace` - If set to `true`, each sample will be independent and therefore values may repeat.\n Required to be `true` for `n` greater then the number of rows in the series or `frac` > 1.0. (default: `false`)\n * `:seed` - An integer to be used as a random seed. If nil, a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)\n * `:shuffle` - In case the sample is equal to the size of the series, shuffle tells if the resultant\n series should be shuffled or if it should return the same series. (default: `false`).","ref":"Explorer.Series.html#sample/3-options"},{"type":"function","title":"Examples - Explorer.Series.sample/3","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 10, seed: 100)\n #Explorer.Series \n\n iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 0.05, seed: 100)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 7, seed: 100, replace: true)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.2, seed: 100, replace: true)\n #Explorer.Series \n\n iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: false)\n #Explorer.Series \n\n iex> s = 0..9 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.sample(s, 1.0, seed: 100, shuffle: true)\n #Explorer.Series","ref":"Explorer.Series.html#sample/3-examples"},{"type":"function","title":"Explorer.Series.second/1","doc":"Returns the second number from 0 to 59.","ref":"Explorer.Series.html#second/1"},{"type":"function","title":"Examples - Explorer.Series.second/1","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.second(s)\n #Explorer.Series","ref":"Explorer.Series.html#second/1-examples"},{"type":"function","title":"Explorer.Series.select/3","doc":"Returns a series from two series, based on a predicate.\n\nThe resulting series is built by evaluating each element of\n`predicate` and returning either the corresponding element from\n`on_true` or `on_false`.\n\n`predicate` must be a boolean series. `on_true` and `on_false` must be\na series of the same size as `predicate` or a series of size 1.","ref":"Explorer.Series.html#select/3"},{"type":"function","title":"Explorer.Series.shift/2","doc":"Shifts `series` by `offset` with `nil` values.\n\nPositive offset shifts from first, negative offset shifts from last.","ref":"Explorer.Series.html#shift/2"},{"type":"function","title":"Examples - Explorer.Series.shift/2","doc":"iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shift(s, 2)\n #Explorer.Series \n\n iex> s = 1..5 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shift(s, -2)\n #Explorer.Series","ref":"Explorer.Series.html#shift/2-examples"},{"type":"function","title":"Explorer.Series.shuffle/2","doc":"Change the elements order randomly.","ref":"Explorer.Series.html#shuffle/2"},{"type":"function","title":"Options - Explorer.Series.shuffle/2","doc":"* `:seed` - An integer to be used as a random seed. If nil,\n a random value between 0 and 2^64 āˆ’ 1 will be used. (default: nil)","ref":"Explorer.Series.html#shuffle/2-options"},{"type":"function","title":"Examples - Explorer.Series.shuffle/2","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.shuffle(s, seed: 100)\n #Explorer.Series","ref":"Explorer.Series.html#shuffle/2-examples"},{"type":"function","title":"Explorer.Series.sin/1","doc":"Computes the the sine of a number (in radians).\nThe resultant series is going to be of dtype `:float`, with values between 1 and -1.","ref":"Explorer.Series.html#sin/1"},{"type":"function","title":"Supported dtype - Explorer.Series.sin/1","doc":"* `:float`","ref":"Explorer.Series.html#sin/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.sin/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.sin(s)\n #Explorer.Series","ref":"Explorer.Series.html#sin/1-examples"},{"type":"function","title":"Explorer.Series.size/1","doc":"Returns the size of the series.\n\nThis is not allowed inside a lazy series. Use `count/1` instead.","ref":"Explorer.Series.html#size/1"},{"type":"function","title":"Examples - Explorer.Series.size/1","doc":"iex> s = Explorer.Series.from_list([~D[1999-12-31], ~D[1989-01-01]])\n iex> Explorer.Series.size(s)\n 2","ref":"Explorer.Series.html#size/1-examples"},{"type":"function","title":"Explorer.Series.skew/2","doc":"Compute the sample skewness of a series.\n\nFor normally distributed data, the skewness should be about zero.\n\nFor unimodal continuous distributions, a skewness value greater\nthan zero means that there is more weight in the right tail of the\ndistribution.","ref":"Explorer.Series.html#skew/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.skew/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#skew/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.skew/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])\n iex> Explorer.Series.skew(s)\n 1.6727687946848508\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 23])\n iex> Explorer.Series.skew(s, bias: false)\n 2.2905330058490514\n\n iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])\n iex> Explorer.Series.skew(s, bias: false)\n 0.8545630383279712\n\n iex> s = Explorer.Series.from_list([1, 2, 3, nil, 1])\n iex> Explorer.Series.skew(s)\n 0.49338220021815865\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.skew(s, false)\n ** (ArgumentError) Explorer.Series.skew/2 not implemented for dtype :boolean. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#skew/2-examples"},{"type":"function","title":"Explorer.Series.slice/2","doc":"Slices the elements at the given indices as a new series.\n\nThe indices may be either a list of indices or a range.\nA list of indices does not support negative numbers.\nRanges may be negative on either end, which are then\nnormalized. Note ranges in Elixir are inclusive.","ref":"Explorer.Series.html#slice/2"},{"type":"function","title":"Examples - Explorer.Series.slice/2","doc":"iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, [0, 2])\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, 1..2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, -2..-1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.slice(s, 3..2//1)\n #Explorer.Series","ref":"Explorer.Series.html#slice/2-examples"},{"type":"function","title":"Explorer.Series.slice/3","doc":"Returns a slice of the series, with `size` elements starting at `offset`.","ref":"Explorer.Series.html#slice/3"},{"type":"function","title":"Examples - Explorer.Series.slice/3","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, 1, 2)\n #Explorer.Series \n\nNegative offsets count from the end of the series:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, -3, 2)\n #Explorer.Series \n\nIf the offset runs past the end of the series,\nthe series is empty:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, 10, 3)\n #Explorer.Series \n\nIf the size runs past the end of the series,\nthe result may be shorter than the size:\n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5])\n iex> Explorer.Series.slice(s, -3, 4)\n #Explorer.Series","ref":"Explorer.Series.html#slice/3-examples"},{"type":"function","title":"Explorer.Series.sort/2","doc":"Sorts the series.\n\nSorting is stable by default.","ref":"Explorer.Series.html#sort/2"},{"type":"function","title":"Options - Explorer.Series.sort/2","doc":"* `:direction` - `:asc` or `:desc`, meaning \"ascending\" or \"descending\", respectively.\n By default it sorts in ascending order.\n\n * `:nils` - `:first` or `:last`. By default it is `:last` if direction is `:asc`, and\n `:first` otherwise.","ref":"Explorer.Series.html#sort/2-options"},{"type":"function","title":"Examples - Explorer.Series.sort/2","doc":"iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.sort(s)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([9, 3, 7, 1])\n iex> Explorer.Series.sort(s, direction: :desc)\n #Explorer.Series","ref":"Explorer.Series.html#sort/2-examples"},{"type":"function","title":"Explorer.Series.standard_deviation/1","doc":"Gets the standard deviation of the series.","ref":"Explorer.Series.html#standard_deviation/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.standard_deviation/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#standard_deviation/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.standard_deviation/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.standard_deviation(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.standard_deviation(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\"])\n iex> Explorer.Series.standard_deviation(s)\n ** (ArgumentError) Explorer.Series.standard_deviation/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#standard_deviation/1-examples"},{"type":"function","title":"Explorer.Series.strftime/2","doc":"Converts a datetime series to a string series.\n\nFor the format string specification, refer to the\n[chrono crate documentation](https://docs.rs/chrono/latest/chrono/format/strftime/index.html).\n\nUse `cast(series, :string)` for the default `\"%Y-%m-%d %H:%M:%S%.6f\"` format.","ref":"Explorer.Series.html#strftime/2"},{"type":"function","title":"Examples - Explorer.Series.strftime/2","doc":"iex> s = Explorer.Series.from_list([~N[2023-01-05 12:34:56], nil])\n iex> Explorer.Series.strftime(s, \"%Y/%m/%d %H:%M:%S\")\n #Explorer.Series","ref":"Explorer.Series.html#strftime/2-examples"},{"type":"function","title":"Explorer.Series.strip/1","doc":"Returns a string series where all leading and trailing Unicode whitespaces\nhave been removed.","ref":"Explorer.Series.html#strip/1"},{"type":"function","title":"Examples - Explorer.Series.strip/1","doc":"iex> s = Explorer.Series.from_list([\" abc\", \"def \", \" bcd \"])\n iex> Explorer.Series.strip(s)\n #Explorer.Series","ref":"Explorer.Series.html#strip/1-examples"},{"type":"function","title":"Explorer.Series.strip/2","doc":"Returns a string series where all leading and trailing examples of the provided string\nhave been removed.\n\nWhere multiple characters are provided, all combinations of this set of characters will be stripped","ref":"Explorer.Series.html#strip/2"},{"type":"function","title":"Examples - Explorer.Series.strip/2","doc":"iex> s = Explorer.Series.from_list([\"Ā£123\", \"1.00Ā£\", \"Ā£1.00Ā£\"])\n iex> Explorer.Series.strip(s, \"Ā£\")\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"abc\", \"adefa\", \"bcda\"])\n iex> Explorer.Series.strip(s, \"ab\")\n #Explorer.Series","ref":"Explorer.Series.html#strip/2-examples"},{"type":"function","title":"Explorer.Series.strptime/2","doc":"Converts a string series to a datetime series with a given `format_string`.\n\nFor the format string specification, refer to the\n[chrono crate documentation](https://docs.rs/chrono/latest/chrono/format/strftime/).\n\nUse `cast(series, :datetime)` if you prefer the format to be inferred (if possible).","ref":"Explorer.Series.html#strptime/2"},{"type":"function","title":"Examples - Explorer.Series.strptime/2","doc":"iex> s = Explorer.Series.from_list([\"2023-01-05 12:34:56\", \"XYZ\", nil])\n iex> Explorer.Series.strptime(s, \"%Y-%m-%d %H:%M:%S\")\n #Explorer.Series","ref":"Explorer.Series.html#strptime/2-examples"},{"type":"function","title":"Explorer.Series.substring/2","doc":"Returns a string sliced from the offset to the end of the string, supporting\nnegative indexing","ref":"Explorer.Series.html#substring/2"},{"type":"function","title":"Examples - Explorer.Series.substring/2","doc":"iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, -3)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, 1)\n #Explorer.Series","ref":"Explorer.Series.html#substring/2-examples"},{"type":"function","title":"Explorer.Series.substring/3","doc":"Returns a string sliced from the offset to the length provided, supporting\nnegative indexing","ref":"Explorer.Series.html#substring/3"},{"type":"function","title":"Examples - Explorer.Series.substring/3","doc":"iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, -3, 2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"earth\", \"mars\", \"neptune\"])\n iex> Explorer.Series.substring(s, 1, 5)\n #Explorer.Series \n\n iex> d = Explorer.Series.from_list([\"恓悓恫恔ćÆäø–ē•Œ\", \"Ł…Ų±Ų­ŲØŁ‹Ų§\", \"ģ•ˆė…•ķ•˜ģ„øģš”\"])\n iex> Explorer.Series.substring(d, 1, 3)\n #Explorer.Series","ref":"Explorer.Series.html#substring/3-examples"},{"type":"function","title":"Explorer.Series.subtract/2","doc":"Subtracts right from left, element-wise.\n\nWhen mixing floats and integers, the resulting series will have dtype `:float`.\n\nAt least one of the arguments must be a series. If both\nsizes are series, the series must have the same size or\nat last one of them must have size of 1.","ref":"Explorer.Series.html#subtract/2"},{"type":"function","title":"Supported dtypes - Explorer.Series.subtract/2","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#subtract/2-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.subtract/2","doc":"iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> s2 = Explorer.Series.from_list([4, 5, 6])\n iex> Explorer.Series.subtract(s1, s2)\n #Explorer.Series \n\nYou can also use scalar values on both sides:\n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.subtract(s1, 2)\n #Explorer.Series \n\n iex> s1 = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.subtract(2, s1)\n #Explorer.Series","ref":"Explorer.Series.html#subtract/2-examples"},{"type":"function","title":"Explorer.Series.sum/1","doc":"Gets the sum of the series.","ref":"Explorer.Series.html#sum/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.sum/1","doc":"* `:integer`\n * `:float`\n * `:boolean`","ref":"Explorer.Series.html#sum/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.sum/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.sum(s)\n 6\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.sum(s)\n 6.0\n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.sum(s)\n 2\n\n iex> s = Explorer.Series.from_list([~D[2021-01-01], ~D[1999-12-31]])\n iex> Explorer.Series.sum(s)\n ** (ArgumentError) Explorer.Series.sum/1 not implemented for dtype :date. Valid dtypes are [:integer, :float, :boolean]","ref":"Explorer.Series.html#sum/1-examples"},{"type":"function","title":"Explorer.Series.tail/2","doc":"Returns the last N elements of the series.","ref":"Explorer.Series.html#tail/2"},{"type":"function","title":"Examples - Explorer.Series.tail/2","doc":"iex> s = 1..100 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.tail(s)\n #Explorer.Series","ref":"Explorer.Series.html#tail/2-examples"},{"type":"function","title":"Explorer.Series.tan/1","doc":"Computes the tangent of a number (in radians).\nThe resultant series is going to be of dtype `:float`.","ref":"Explorer.Series.html#tan/1"},{"type":"function","title":"Supported dtype - Explorer.Series.tan/1","doc":"* `:float`","ref":"Explorer.Series.html#tan/1-supported-dtype"},{"type":"function","title":"Examples - Explorer.Series.tan/1","doc":"iex> pi = :math.pi()\n iex> s = [-pi * 3/2, -pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi, pi * 3/2] |> Explorer.Series.from_list()\n iex> Explorer.Series.tan(s)\n #Explorer.Series","ref":"Explorer.Series.html#tan/1-examples"},{"type":"function","title":"Explorer.Series.to_binary/1","doc":"Returns a series as a fixed-width binary.\n\nThis is a shortcut around `to_iovec/1`. If possible, prefer\nto use `to_iovec/1` as that avoids copying binaries.","ref":"Explorer.Series.html#to_binary/1"},{"type":"function","title":"Examples - Explorer.Series.to_binary/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_binary(series)\n >\n\n iex> series = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_binary(series)\n >","ref":"Explorer.Series.html#to_binary/1-examples"},{"type":"function","title":"Explorer.Series.to_date/1","doc":"","ref":"Explorer.Series.html#to_date/1"},{"type":"function","title":"Explorer.Series.to_enum/1","doc":"Converts a series to an enumerable.\n\nThe enumerable will lazily traverse the series.\n\n> ##","ref":"Explorer.Series.html#to_enum/1"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_enum/1","doc":">\n> You must avoid converting a series to enum, as that will copy the whole\n> series in memory as you traverse it. Prefer to use the operations in this\n> module rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.Series.html#to_enum/1-warning-warning"},{"type":"function","title":"Examples - Explorer.Series.to_enum/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> series |> Explorer.Series.to_enum() |> Enum.to_list()\n [1, 2, 3]","ref":"Explorer.Series.html#to_enum/1-examples"},{"type":"function","title":"Explorer.Series.to_iovec/1","doc":"Returns a series as a list of fixed-width binaries.\n\nAn io vector (`iovec`) is the Erlang VM term for a flat list of binaries.\nThis is typically a reference to the in-memory representation of the series.\nIf the whole series in contiguous in memory, then the list will have a single\nelement. All binaries are in native endianness.\n\nThis operation fails if the series has `nil` values.\nUse `fill_missing/1` to handle them accordingly.\n\nTo retrieve the type of the underlying io vector, use `iotype/1`.\nTo convert an iovec to a binary, you can use `IO.iodata_to_binary/1`.","ref":"Explorer.Series.html#to_iovec/1"},{"type":"function","title":"Examples - Explorer.Series.to_iovec/1","doc":"Integers and floats follow their native encoding:\n\n iex> series = Explorer.Series.from_list([-1, 0, 1])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\n iex> series = Explorer.Series.from_list([1.0, 2.0, 3.0])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nBooleans are encoded as 0 and 1:\n\n iex> series = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nDates are encoded as i32 representing days from the Unix epoch (1970-01-01):\n\n iex> series = Explorer.Series.from_list([~D[0001-01-01], ~D[1970-01-01], ~D[1986-10-13]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nTimes are encoded as i64 representing nanoseconds from midnight:\n\n iex> series = Explorer.Series.from_list([~T[00:00:00.000000], ~T[23:59:59.999999]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nDatetimes are encoded as i64 representing their precision from the Unix epoch (1970-01-01):\n\n iex> series = Explorer.Series.from_list([~N[0001-01-01 00:00:00], ~N[1970-01-01 00:00:00], ~N[1986-10-13 01:23:45.987654]])\n iex> Explorer.Series.to_iovec(series)\n [ >]\n\nThe operation raises for binaries and strings, as they do not provide a fixed-width\nbinary representation:\n\n iex> s = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"b\"])\n iex> Explorer.Series.to_iovec(s)\n ** (ArgumentError) cannot convert series of dtype :string into iovec\n\nHowever, if appropriate, you can convert them to categorical types,\nwhich will then return the index of each category:\n\n iex> series = Explorer.Series.from_list([\"a\", \"b\", \"c\", \"b\"], dtype: :category)\n iex> Explorer.Series.to_iovec(series)\n [ >]","ref":"Explorer.Series.html#to_iovec/1-examples"},{"type":"function","title":"Explorer.Series.to_list/1","doc":"Converts a series to a list.\n\n> ##","ref":"Explorer.Series.html#to_list/1"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_list/1","doc":">\n> You must avoid converting a series to list, as that requires copying\n> the whole series in memory. Prefer to use the operations in this module\n> rather than the ones in `Enum` whenever possible, as this module is\n> optimized for large series.","ref":"Explorer.Series.html#to_list/1-warning-warning"},{"type":"function","title":"Examples - Explorer.Series.to_list/1","doc":"iex> series = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_list(series)\n [1, 2, 3]","ref":"Explorer.Series.html#to_list/1-examples"},{"type":"function","title":"Explorer.Series.to_tensor/2","doc":"Converts a series to a `t:Nx.Tensor.t/0`.\n\nNote that `Explorer.Series` are automatically converted\nto tensors when passed to numerical definitions.\nThe tensor type is given by `iotype/1`.\n\n> ##","ref":"Explorer.Series.html#to_tensor/2"},{"type":"function","title":"Warning {: .warning} - Explorer.Series.to_tensor/2","doc":">\n> `Nx` is an optional dependency. You will need to ensure it's installed to use this function.","ref":"Explorer.Series.html#to_tensor/2-warning-warning"},{"type":"function","title":"Options - Explorer.Series.to_tensor/2","doc":"* `:backend` - the Nx backend to allocate the tensor on","ref":"Explorer.Series.html#to_tensor/2-options"},{"type":"function","title":"Examples - Explorer.Series.to_tensor/2","doc":"iex> s = Explorer.Series.from_list([1, 2, 3])\n iex> Explorer.Series.to_tensor(s)\n #Nx.Tensor \n\n iex> s = Explorer.Series.from_list([true, false, true])\n iex> Explorer.Series.to_tensor(s)\n #Nx.Tensor","ref":"Explorer.Series.html#to_tensor/2-examples"},{"type":"function","title":"Explorer.Series.to_time/1","doc":"","ref":"Explorer.Series.html#to_time/1"},{"type":"function","title":"Explorer.Series.transform/2","doc":"Returns an `Explorer.Series` where each element is the result of invoking `fun` on each\ncorresponding element of `series`.\n\nThis is an expensive operation meant to enable the use of arbitrary Elixir functions against\nany backend. The implementation will vary by backend but in most (all?) cases will require\nconverting to an `Elixir.List`, applying `Enum.map/2`, and then converting back to an\n`Explorer.Series`.","ref":"Explorer.Series.html#transform/2"},{"type":"function","title":"Examples - Explorer.Series.transform/2","doc":"iex> s = Explorer.Series.from_list([\"this \", \" is\", \"great \"])\n iex> Explorer.Series.transform(s, &String.trim/1)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([\"this\", \"is\", \"great\"])\n iex> Explorer.Series.transform(s, &String.length/1)\n #Explorer.Series","ref":"Explorer.Series.html#transform/2-examples"},{"type":"function","title":"Explorer.Series.unordered_distinct/1","doc":"Returns the unique values of the series, but does not maintain order.\n\nFaster than `distinct/1`.","ref":"Explorer.Series.html#unordered_distinct/1"},{"type":"function","title":"Examples - Explorer.Series.unordered_distinct/1","doc":"iex> s = [1, 1, 2, 2, 3, 3] |> Explorer.Series.from_list()\n iex> Explorer.Series.unordered_distinct(s)","ref":"Explorer.Series.html#unordered_distinct/1-examples"},{"type":"function","title":"Explorer.Series.upcase/1","doc":"Converts all characters to uppercase.","ref":"Explorer.Series.html#upcase/1"},{"type":"function","title":"Examples - Explorer.Series.upcase/1","doc":"iex> s = Explorer.Series.from_list([\"abc\", \"def\", \"bcd\"])\n iex> Explorer.Series.upcase(s)\n #Explorer.Series","ref":"Explorer.Series.html#upcase/1-examples"},{"type":"function","title":"Explorer.Series.variance/1","doc":"Gets the variance of the series.","ref":"Explorer.Series.html#variance/1"},{"type":"function","title":"Supported dtypes - Explorer.Series.variance/1","doc":"* `:integer`\n * `:float`","ref":"Explorer.Series.html#variance/1-supported-dtypes"},{"type":"function","title":"Examples - Explorer.Series.variance/1","doc":"iex> s = Explorer.Series.from_list([1, 2, nil, 3])\n iex> Explorer.Series.variance(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([1.0, 2.0, nil, 3.0])\n iex> Explorer.Series.variance(s)\n 1.0\n\n iex> s = Explorer.Series.from_list([~N[2021-01-01 00:00:00], ~N[1999-12-31 00:00:00]])\n iex> Explorer.Series.variance(s)\n ** (ArgumentError) Explorer.Series.variance/1 not implemented for dtype {:datetime, :microsecond}. Valid dtypes are [:integer, :float]","ref":"Explorer.Series.html#variance/1-examples"},{"type":"function","title":"Explorer.Series.window_max/3","doc":"Calculate the rolling max, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_max/3"},{"type":"function","title":"Options - Explorer.Series.window_max/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_max/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_max/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_max(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_max(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_max/3-examples"},{"type":"function","title":"Explorer.Series.window_mean/3","doc":"Calculate the rolling mean, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_mean/3"},{"type":"function","title":"Options - Explorer.Series.window_mean/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_mean/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_mean/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75])\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_mean(s, 2, weights: [0.25, 0.75], min_periods: nil)\n #Explorer.Series","ref":"Explorer.Series.html#window_mean/3-examples"},{"type":"function","title":"Explorer.Series.window_median/3","doc":"Calculate the rolling median, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_median/3"},{"type":"function","title":"Options - Explorer.Series.window_median/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_median/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_median/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75])\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_median(s, 2, weights: [0.25, 0.75], min_periods: nil)\n #Explorer.Series","ref":"Explorer.Series.html#window_median/3-examples"},{"type":"function","title":"Explorer.Series.window_min/3","doc":"Calculate the rolling min, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_min/3"},{"type":"function","title":"Options - Explorer.Series.window_min/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_min/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_min/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_min(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_min(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_min/3-examples"},{"type":"function","title":"Explorer.Series.window_standard_deviation/3","doc":"Calculate the rolling standard deviation, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_standard_deviation/3"},{"type":"function","title":"Options - Explorer.Series.window_standard_deviation/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_standard_deviation/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_standard_deviation/3","doc":"iex> s = Explorer.Series.from_list([1, 2, 3, 4, 1])\n iex> Explorer.Series.window_standard_deviation(s, 2)\n #Explorer.Series \n\n iex> s = Explorer.Series.from_list([1, 2, 3, 4, 5, 6])\n iex> Explorer.Series.window_standard_deviation(s, 2, weights: [0.25, 0.75])\n #Explorer.Series","ref":"Explorer.Series.html#window_standard_deviation/3-examples"},{"type":"function","title":"Explorer.Series.window_sum/3","doc":"Calculate the rolling sum, given a window size and optional list of weights.","ref":"Explorer.Series.html#window_sum/3"},{"type":"function","title":"Options - Explorer.Series.window_sum/3","doc":"* `:weights` - An optional list of weights with the same length as the window\n that will be multiplied elementwise with the values in the window. Defaults to `nil`.\n\n * `:min_periods` - The number of values in the window that should be non-nil\n before computing a result. If `nil`, it will be set equal to window size. Defaults to `1`.\n\n * `:center` - Set the labels at the center of the window. Defaults to `false`.","ref":"Explorer.Series.html#window_sum/3-options"},{"type":"function","title":"Examples - Explorer.Series.window_sum/3","doc":"iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_sum(s, 4)\n #Explorer.Series \n\n iex> s = 1..10 |> Enum.to_list() |> Explorer.Series.from_list()\n iex> Explorer.Series.window_sum(s, 2, weights: [1.0, 2.0])\n #Explorer.Series","ref":"Explorer.Series.html#window_sum/3-examples"},{"type":"function","title":"Explorer.Series.year/1","doc":"Returns the year number in the calendar date.","ref":"Explorer.Series.html#year/1"},{"type":"function","title":"Examples - Explorer.Series.year/1","doc":"iex> s = Explorer.Series.from_list([~D[2023-01-15], ~D[2022-02-16], ~D[2021-03-20], nil])\n iex> Explorer.Series.year(s)\n #Explorer.Series \n\nIt can also be called on a datetime series.\n\n iex> s = Explorer.Series.from_list([~N[2023-01-15 00:00:00], ~N[2022-02-16 23:59:59.999999], ~N[2021-03-20 12:00:00], nil])\n iex> Explorer.Series.year(s)\n #Explorer.Series","ref":"Explorer.Series.html#year/1-examples"},{"type":"type","title":"Explorer.Series.datetime_dtype/0","doc":"","ref":"Explorer.Series.html#t:datetime_dtype/0"},{"type":"type","title":"Explorer.Series.dtype/0","doc":"","ref":"Explorer.Series.html#t:dtype/0"},{"type":"type","title":"Explorer.Series.inferable_scalar/0","doc":"","ref":"Explorer.Series.html#t:inferable_scalar/0"},{"type":"type","title":"Explorer.Series.lazy_t/0","doc":"","ref":"Explorer.Series.html#t:lazy_t/0"},{"type":"type","title":"Explorer.Series.non_finite/0","doc":"","ref":"Explorer.Series.html#t:non_finite/0"},{"type":"type","title":"Explorer.Series.t/0","doc":"","ref":"Explorer.Series.html#t:t/0"},{"type":"module","title":"Explorer.TensorFrame","doc":"TensorFrame is a representation of `Explorer.DataFrame`\nthat is designed to work inside Nx's `defn` expressions.\n\nFor example, imagine the following `defn`:\n\n defn add_columns(tf) do\n tf[:a] + tf[:b]\n end\n\nWe can now pass a DataFrame as argument:\n\n iex> add_columns(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\nPassing an `Explorer.DataFrame` to a `defn` will automatically\nconvert it to a TensorFrame. The TensorFrame will lazily\nbuild tensors out of the used dataframe fields.","ref":"Explorer.TensorFrame.html"},{"type":"module","title":"Stack and concatenating - Explorer.TensorFrame","doc":"Due to the integration with Nx, you can also pass dataframes\ninto `Nx.stack/2` and `Nx.concatenate` and they will be automatically\nconverted to tensors. This makes it easy to pass dataframes into\nneural networks and other computationally intensive algorithms:\n\n iex> Nx.concatenate(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\n iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]))\n #Nx.Tensor \n\n iex> Nx.stack(Explorer.DataFrame.new(a: [11, 12], b: [21, 22]), axis: -1)\n #Nx.Tensor","ref":"Explorer.TensorFrame.html#module-stack-and-concatenating"},{"type":"module","title":"Warning: returning TensorFrames - Explorer.TensorFrame","doc":"It is not recommended to return a TensorFrame from a `defn`,\nas that would force all columns to be sent to the CPU/GPU\nand then copied back. Return only the columns that have been\nmodified during the computation. For example, in the example\nabove we used `Nx` to add two columns, if you want to\nput the result of the computation back into a DataFrame,\nyou can use `Explorer.DataFrame.put/4`, which also accepts\ntensors:\n\n iex> df = Explorer.DataFrame.new(a: [11, 12], b: [21, 22])\n iex> Explorer.DataFrame.put(df, \"result\", add_columns(df))\n #Explorer.DataFrame \n\nOne benefit of using `Explorer.DataFrame.put/4` is that it will\npreserve the type of the column if one already exists. Alternatively,\nuse `Explorer.Series.from_tensor/1` to explicitly convert a tensor\nback to a series.","ref":"Explorer.TensorFrame.html#module-warning-returning-tensorframes"},{"type":"module","title":"Supported dtypes - Explorer.TensorFrame","doc":"The following dtypes can be converted to tensors:\n\n * `:integer`\n * `:float`\n * `:boolean`\n * `:date`\n * `{:datetime, :millisecond}`\n * `{:datetime, :microsecond}`\n * `{:datetime, :nanosecond}`\n\nSee `Explorer.Series.to_iovec/1` and `Explorer.Series.to_tensor/1`\nto learn more about their internal representation.","ref":"Explorer.TensorFrame.html#module-supported-dtypes"},{"type":"function","title":"Explorer.TensorFrame.pull/2","doc":"Pulls a tensor from the TensorFrame.\n\nThis is equivalent to using the `tf[name]` to access\na tensor.","ref":"Explorer.TensorFrame.html#pull/2"},{"type":"function","title":"Examples - Explorer.TensorFrame.pull/2","doc":"Explorer.TensorFrame.pull(tf, \"some_column\")","ref":"Explorer.TensorFrame.html#pull/2-examples"},{"type":"function","title":"Explorer.TensorFrame.put/3","doc":"Puts a tensor in the TensorFrame.\n\nThis function can be invoked from within `defn`.","ref":"Explorer.TensorFrame.html#put/3"},{"type":"function","title":"Examples - Explorer.TensorFrame.put/3","doc":"Explorer.TensorFrame.put(tf, \"result\", some_tensor)","ref":"Explorer.TensorFrame.html#put/3-examples"},{"type":"type","title":"Explorer.TensorFrame.t/0","doc":"","ref":"Explorer.TensorFrame.html#t:t/0"},{"type":"module","title":"Explorer.Backend","doc":"The behaviour for Explorer backends and associated functions.\n\nEach backend is a module with `DataFrame` and `Series` submodules that match the \nrespective behaviours for each.\n\nThe default backend is read from the application environment. Currently, the only \nbackend is an in-memory, eager one based on\n[`Polars`](https://github.com/pola-rs/polars). When alternatives are\navailable, you can use them by configuring your runtime:\n\n # config/runtime.exs\n import Config\n config :explorer, default_backend: Lib.CustomBackend","ref":"Explorer.Backend.html"},{"type":"function","title":"Explorer.Backend.get/0","doc":"Gets the default backend for the current process.","ref":"Explorer.Backend.html#get/0"},{"type":"function","title":"Explorer.Backend.put/1","doc":"Sets the current process default backend to `backend`.\n\nThe default backend is stored only in the process dictionary. This means if\nyou start a separate process, such as `Task`, the default backend must be set\non the new process too.","ref":"Explorer.Backend.html#put/1"},{"type":"function","title":"Examples - Explorer.Backend.put/1","doc":"iex> Explorer.Backend.put(Lib.CustomBackend)\n Explorer.PolarsBackend\n iex> Explorer.Backend.get()\n Lib.CustomBackend","ref":"Explorer.Backend.html#put/1-examples"},{"type":"behaviour","title":"Explorer.Backend.DataFrame","doc":"The behaviour for DataFrame backends.","ref":"Explorer.Backend.DataFrame.html"},{"type":"callback","title":"Explorer.Backend.DataFrame.arrange_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:arrange_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.collect/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:collect/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.concat_columns/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:concat_columns/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.concat_rows/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:concat_rows/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.describe/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:describe/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.distinct/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:distinct/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.drop_nil/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:drop_nil/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dummies/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dummies/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_csv/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_csv/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_ndjson/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_ndjson/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.dump_parquet/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:dump_parquet/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.filter_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:filter_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_csv/12","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_csv/12"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_ndjson/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_ndjson/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_parquet/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_parquet/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_query/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_query/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_series/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_series/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.from_tabular/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:from_tabular/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.head/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:head/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.inspect/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:inspect/2"},{"type":"function","title":"Explorer.Backend.DataFrame.inspect/5","doc":"Default inspect implementation for backends.","ref":"Explorer.Backend.DataFrame.html#inspect/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.join/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:join/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.lazy/0","doc":"","ref":"Explorer.Backend.DataFrame.html#c:lazy/0"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_csv/12","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_csv/12"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ipc/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ipc/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ipc_stream/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ipc_stream/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_ndjson/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_ndjson/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.load_parquet/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:load_parquet/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.mask/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:mask/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.mutate_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:mutate_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.n_rows/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:n_rows/1"},{"type":"function","title":"Explorer.Backend.DataFrame.new/3","doc":"Creates a new DataFrame for a given backend.","ref":"Explorer.Backend.DataFrame.html#new/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.nil_count/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:nil_count/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.pivot_longer/6","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pivot_longer/6"},{"type":"callback","title":"Explorer.Backend.DataFrame.pivot_wider/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pivot_wider/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.pull/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:pull/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.put/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:put/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.rename/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:rename/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.sample/5","doc":"","ref":"Explorer.Backend.DataFrame.html#c:sample/5"},{"type":"callback","title":"Explorer.Backend.DataFrame.select/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:select/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.slice/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:slice/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.slice/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:slice/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.summarise_with/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:summarise_with/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.tail/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:tail/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_csv/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_csv/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ipc/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ipc/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ipc_stream/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ipc_stream/3"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_lazy/1","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_lazy/1"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_ndjson/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_ndjson/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_parquet/4","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_parquet/4"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_rows/2","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_rows/2"},{"type":"callback","title":"Explorer.Backend.DataFrame.to_rows_stream/3","doc":"","ref":"Explorer.Backend.DataFrame.html#c:to_rows_stream/3"},{"type":"type","title":"Explorer.Backend.DataFrame.basic_types/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:basic_types/0"},{"type":"type","title":"Explorer.Backend.DataFrame.column_name/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:column_name/0"},{"type":"type","title":"Explorer.Backend.DataFrame.columns_for_io/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:columns_for_io/0"},{"type":"type","title":"Explorer.Backend.DataFrame.compression/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:compression/0"},{"type":"type","title":"Explorer.Backend.DataFrame.df/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:df/0"},{"type":"type","title":"Explorer.Backend.DataFrame.dtype/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:dtype/0"},{"type":"type","title":"Explorer.Backend.DataFrame.dtypes/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:dtypes/0"},{"type":"type","title":"Explorer.Backend.DataFrame.fs_entry/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:fs_entry/0"},{"type":"type","title":"Explorer.Backend.DataFrame.lazy_frame/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:lazy_frame/0"},{"type":"type","title":"Explorer.Backend.DataFrame.lazy_series/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:lazy_series/0"},{"type":"type","title":"Explorer.Backend.DataFrame.mutate_value/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:mutate_value/0"},{"type":"type","title":"Explorer.Backend.DataFrame.ok_result/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:ok_result/0"},{"type":"type","title":"Explorer.Backend.DataFrame.option/1","doc":"","ref":"Explorer.Backend.DataFrame.html#t:option/1"},{"type":"type","title":"Explorer.Backend.DataFrame.result/1","doc":"","ref":"Explorer.Backend.DataFrame.html#t:result/1"},{"type":"type","title":"Explorer.Backend.DataFrame.series/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:series/0"},{"type":"type","title":"Explorer.Backend.DataFrame.t/0","doc":"","ref":"Explorer.Backend.DataFrame.html#t:t/0"},{"type":"module","title":"Explorer.Backend.LazyFrame","doc":"Represents a lazy dataframe for building query expressions.\n\nThe LazyFrame is available inside `filter_with`, `mutate_with`, and\nsimilar. You cannot perform any operation on them except accessing\nits underlying series.","ref":"Explorer.Backend.LazyFrame.html"},{"type":"type","title":"Explorer.Backend.LazyFrame.t/0","doc":"","ref":"Explorer.Backend.LazyFrame.html#t:t/0"},{"type":"module","title":"Explorer.Backend.LazySeries","doc":"This is an opaque implementation of a Series.\n\nIt represents an operation with its arguments.","ref":"Explorer.Backend.LazySeries.html"},{"type":"type","title":"Explorer.Backend.LazySeries.t/0","doc":"","ref":"Explorer.Backend.LazySeries.html#t:t/0"},{"type":"behaviour","title":"Explorer.Backend.Series","doc":"The behaviour for series backends.","ref":"Explorer.Backend.Series.html"},{"type":"callback","title":"Explorer.Backend.Series.abs/1","doc":"","ref":"Explorer.Backend.Series.html#c:abs/1"},{"type":"callback","title":"Explorer.Backend.Series.acos/1","doc":"","ref":"Explorer.Backend.Series.html#c:acos/1"},{"type":"callback","title":"Explorer.Backend.Series.add/2","doc":"","ref":"Explorer.Backend.Series.html#c:add/2"},{"type":"callback","title":"Explorer.Backend.Series.all_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:all_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.argmax/1","doc":"","ref":"Explorer.Backend.Series.html#c:argmax/1"},{"type":"callback","title":"Explorer.Backend.Series.argmin/1","doc":"","ref":"Explorer.Backend.Series.html#c:argmin/1"},{"type":"callback","title":"Explorer.Backend.Series.argsort/3","doc":"","ref":"Explorer.Backend.Series.html#c:argsort/3"},{"type":"callback","title":"Explorer.Backend.Series.asin/1","doc":"","ref":"Explorer.Backend.Series.html#c:asin/1"},{"type":"callback","title":"Explorer.Backend.Series.at/2","doc":"","ref":"Explorer.Backend.Series.html#c:at/2"},{"type":"callback","title":"Explorer.Backend.Series.at_every/2","doc":"","ref":"Explorer.Backend.Series.html#c:at_every/2"},{"type":"callback","title":"Explorer.Backend.Series.atan/1","doc":"","ref":"Explorer.Backend.Series.html#c:atan/1"},{"type":"callback","title":"Explorer.Backend.Series.binary_and/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_and/2"},{"type":"callback","title":"Explorer.Backend.Series.binary_in/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_in/2"},{"type":"callback","title":"Explorer.Backend.Series.binary_or/2","doc":"","ref":"Explorer.Backend.Series.html#c:binary_or/2"},{"type":"callback","title":"Explorer.Backend.Series.cast/2","doc":"","ref":"Explorer.Backend.Series.html#c:cast/2"},{"type":"callback","title":"Explorer.Backend.Series.categories/1","doc":"","ref":"Explorer.Backend.Series.html#c:categories/1"},{"type":"callback","title":"Explorer.Backend.Series.categorise/2","doc":"","ref":"Explorer.Backend.Series.html#c:categorise/2"},{"type":"callback","title":"Explorer.Backend.Series.ceil/1","doc":"","ref":"Explorer.Backend.Series.html#c:ceil/1"},{"type":"callback","title":"Explorer.Backend.Series.clip/3","doc":"","ref":"Explorer.Backend.Series.html#c:clip/3"},{"type":"callback","title":"Explorer.Backend.Series.coalesce/2","doc":"","ref":"Explorer.Backend.Series.html#c:coalesce/2"},{"type":"callback","title":"Explorer.Backend.Series.concat/1","doc":"","ref":"Explorer.Backend.Series.html#c:concat/1"},{"type":"callback","title":"Explorer.Backend.Series.contains/2","doc":"","ref":"Explorer.Backend.Series.html#c:contains/2"},{"type":"callback","title":"Explorer.Backend.Series.correlation/3","doc":"","ref":"Explorer.Backend.Series.html#c:correlation/3"},{"type":"callback","title":"Explorer.Backend.Series.cos/1","doc":"","ref":"Explorer.Backend.Series.html#c:cos/1"},{"type":"callback","title":"Explorer.Backend.Series.count/1","doc":"","ref":"Explorer.Backend.Series.html#c:count/1"},{"type":"callback","title":"Explorer.Backend.Series.covariance/2","doc":"","ref":"Explorer.Backend.Series.html#c:covariance/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_max/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_max/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_min/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_min/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_product/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_product/2"},{"type":"callback","title":"Explorer.Backend.Series.cumulative_sum/2","doc":"","ref":"Explorer.Backend.Series.html#c:cumulative_sum/2"},{"type":"callback","title":"Explorer.Backend.Series.cut/5","doc":"","ref":"Explorer.Backend.Series.html#c:cut/5"},{"type":"callback","title":"Explorer.Backend.Series.day_of_week/1","doc":"","ref":"Explorer.Backend.Series.html#c:day_of_week/1"},{"type":"callback","title":"Explorer.Backend.Series.distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:distinct/1"},{"type":"callback","title":"Explorer.Backend.Series.divide/2","doc":"","ref":"Explorer.Backend.Series.html#c:divide/2"},{"type":"callback","title":"Explorer.Backend.Series.downcase/1","doc":"","ref":"Explorer.Backend.Series.html#c:downcase/1"},{"type":"callback","title":"Explorer.Backend.Series.dtype/1","doc":"","ref":"Explorer.Backend.Series.html#c:dtype/1"},{"type":"callback","title":"Explorer.Backend.Series.equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:equal/2"},{"type":"callback","title":"Explorer.Backend.Series.ewm_mean/5","doc":"","ref":"Explorer.Backend.Series.html#c:ewm_mean/5"},{"type":"callback","title":"Explorer.Backend.Series.exp/1","doc":"","ref":"Explorer.Backend.Series.html#c:exp/1"},{"type":"callback","title":"Explorer.Backend.Series.fill_missing_with_strategy/2","doc":"","ref":"Explorer.Backend.Series.html#c:fill_missing_with_strategy/2"},{"type":"callback","title":"Explorer.Backend.Series.fill_missing_with_value/2","doc":"","ref":"Explorer.Backend.Series.html#c:fill_missing_with_value/2"},{"type":"callback","title":"Explorer.Backend.Series.first/1","doc":"","ref":"Explorer.Backend.Series.html#c:first/1"},{"type":"callback","title":"Explorer.Backend.Series.floor/1","doc":"","ref":"Explorer.Backend.Series.html#c:floor/1"},{"type":"callback","title":"Explorer.Backend.Series.format/1","doc":"","ref":"Explorer.Backend.Series.html#c:format/1"},{"type":"callback","title":"Explorer.Backend.Series.frequencies/1","doc":"","ref":"Explorer.Backend.Series.html#c:frequencies/1"},{"type":"callback","title":"Explorer.Backend.Series.from_binary/2","doc":"","ref":"Explorer.Backend.Series.html#c:from_binary/2"},{"type":"callback","title":"Explorer.Backend.Series.from_list/2","doc":"","ref":"Explorer.Backend.Series.html#c:from_list/2"},{"type":"callback","title":"Explorer.Backend.Series.greater/2","doc":"","ref":"Explorer.Backend.Series.html#c:greater/2"},{"type":"callback","title":"Explorer.Backend.Series.greater_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:greater_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.head/2","doc":"","ref":"Explorer.Backend.Series.html#c:head/2"},{"type":"callback","title":"Explorer.Backend.Series.hour/1","doc":"","ref":"Explorer.Backend.Series.html#c:hour/1"},{"type":"callback","title":"Explorer.Backend.Series.inspect/2","doc":"","ref":"Explorer.Backend.Series.html#c:inspect/2"},{"type":"function","title":"Explorer.Backend.Series.inspect/5","doc":"Default inspect implementation for backends.","ref":"Explorer.Backend.Series.html#inspect/5"},{"type":"callback","title":"Explorer.Backend.Series.iotype/1","doc":"","ref":"Explorer.Backend.Series.html#c:iotype/1"},{"type":"callback","title":"Explorer.Backend.Series.is_finite/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_finite/1"},{"type":"callback","title":"Explorer.Backend.Series.is_infinite/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_infinite/1"},{"type":"callback","title":"Explorer.Backend.Series.is_nan/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_nan/1"},{"type":"callback","title":"Explorer.Backend.Series.is_nil/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_nil/1"},{"type":"callback","title":"Explorer.Backend.Series.is_not_nil/1","doc":"","ref":"Explorer.Backend.Series.html#c:is_not_nil/1"},{"type":"callback","title":"Explorer.Backend.Series.last/1","doc":"","ref":"Explorer.Backend.Series.html#c:last/1"},{"type":"callback","title":"Explorer.Backend.Series.less/2","doc":"","ref":"Explorer.Backend.Series.html#c:less/2"},{"type":"callback","title":"Explorer.Backend.Series.less_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:less_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.log/1","doc":"","ref":"Explorer.Backend.Series.html#c:log/1"},{"type":"callback","title":"Explorer.Backend.Series.log/2","doc":"","ref":"Explorer.Backend.Series.html#c:log/2"},{"type":"callback","title":"Explorer.Backend.Series.lstrip/2","doc":"","ref":"Explorer.Backend.Series.html#c:lstrip/2"},{"type":"callback","title":"Explorer.Backend.Series.mask/2","doc":"","ref":"Explorer.Backend.Series.html#c:mask/2"},{"type":"callback","title":"Explorer.Backend.Series.max/1","doc":"","ref":"Explorer.Backend.Series.html#c:max/1"},{"type":"callback","title":"Explorer.Backend.Series.mean/1","doc":"","ref":"Explorer.Backend.Series.html#c:mean/1"},{"type":"callback","title":"Explorer.Backend.Series.median/1","doc":"","ref":"Explorer.Backend.Series.html#c:median/1"},{"type":"callback","title":"Explorer.Backend.Series.min/1","doc":"","ref":"Explorer.Backend.Series.html#c:min/1"},{"type":"callback","title":"Explorer.Backend.Series.minute/1","doc":"","ref":"Explorer.Backend.Series.html#c:minute/1"},{"type":"callback","title":"Explorer.Backend.Series.month/1","doc":"","ref":"Explorer.Backend.Series.html#c:month/1"},{"type":"callback","title":"Explorer.Backend.Series.multiply/2","doc":"","ref":"Explorer.Backend.Series.html#c:multiply/2"},{"type":"callback","title":"Explorer.Backend.Series.n_distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:n_distinct/1"},{"type":"function","title":"Explorer.Backend.Series.new/2","doc":"Create a new `Series`.","ref":"Explorer.Backend.Series.html#new/2"},{"type":"callback","title":"Explorer.Backend.Series.nil_count/1","doc":"","ref":"Explorer.Backend.Series.html#c:nil_count/1"},{"type":"callback","title":"Explorer.Backend.Series.not_equal/2","doc":"","ref":"Explorer.Backend.Series.html#c:not_equal/2"},{"type":"callback","title":"Explorer.Backend.Series.peaks/2","doc":"","ref":"Explorer.Backend.Series.html#c:peaks/2"},{"type":"callback","title":"Explorer.Backend.Series.pow/2","doc":"","ref":"Explorer.Backend.Series.html#c:pow/2"},{"type":"callback","title":"Explorer.Backend.Series.product/1","doc":"","ref":"Explorer.Backend.Series.html#c:product/1"},{"type":"callback","title":"Explorer.Backend.Series.qcut/5","doc":"","ref":"Explorer.Backend.Series.html#c:qcut/5"},{"type":"callback","title":"Explorer.Backend.Series.quantile/2","doc":"","ref":"Explorer.Backend.Series.html#c:quantile/2"},{"type":"callback","title":"Explorer.Backend.Series.quotient/2","doc":"","ref":"Explorer.Backend.Series.html#c:quotient/2"},{"type":"callback","title":"Explorer.Backend.Series.rank/4","doc":"","ref":"Explorer.Backend.Series.html#c:rank/4"},{"type":"callback","title":"Explorer.Backend.Series.remainder/2","doc":"","ref":"Explorer.Backend.Series.html#c:remainder/2"},{"type":"callback","title":"Explorer.Backend.Series.reverse/1","doc":"","ref":"Explorer.Backend.Series.html#c:reverse/1"},{"type":"callback","title":"Explorer.Backend.Series.round/2","doc":"","ref":"Explorer.Backend.Series.html#c:round/2"},{"type":"callback","title":"Explorer.Backend.Series.rstrip/2","doc":"","ref":"Explorer.Backend.Series.html#c:rstrip/2"},{"type":"callback","title":"Explorer.Backend.Series.sample/5","doc":"","ref":"Explorer.Backend.Series.html#c:sample/5"},{"type":"callback","title":"Explorer.Backend.Series.second/1","doc":"","ref":"Explorer.Backend.Series.html#c:second/1"},{"type":"callback","title":"Explorer.Backend.Series.select/3","doc":"","ref":"Explorer.Backend.Series.html#c:select/3"},{"type":"callback","title":"Explorer.Backend.Series.shift/3","doc":"","ref":"Explorer.Backend.Series.html#c:shift/3"},{"type":"callback","title":"Explorer.Backend.Series.sin/1","doc":"","ref":"Explorer.Backend.Series.html#c:sin/1"},{"type":"callback","title":"Explorer.Backend.Series.size/1","doc":"","ref":"Explorer.Backend.Series.html#c:size/1"},{"type":"callback","title":"Explorer.Backend.Series.skew/2","doc":"","ref":"Explorer.Backend.Series.html#c:skew/2"},{"type":"callback","title":"Explorer.Backend.Series.slice/2","doc":"","ref":"Explorer.Backend.Series.html#c:slice/2"},{"type":"callback","title":"Explorer.Backend.Series.slice/3","doc":"","ref":"Explorer.Backend.Series.html#c:slice/3"},{"type":"callback","title":"Explorer.Backend.Series.sort/3","doc":"","ref":"Explorer.Backend.Series.html#c:sort/3"},{"type":"callback","title":"Explorer.Backend.Series.standard_deviation/1","doc":"","ref":"Explorer.Backend.Series.html#c:standard_deviation/1"},{"type":"callback","title":"Explorer.Backend.Series.strftime/2","doc":"","ref":"Explorer.Backend.Series.html#c:strftime/2"},{"type":"callback","title":"Explorer.Backend.Series.strip/2","doc":"","ref":"Explorer.Backend.Series.html#c:strip/2"},{"type":"callback","title":"Explorer.Backend.Series.strptime/2","doc":"","ref":"Explorer.Backend.Series.html#c:strptime/2"},{"type":"callback","title":"Explorer.Backend.Series.substring/3","doc":"","ref":"Explorer.Backend.Series.html#c:substring/3"},{"type":"callback","title":"Explorer.Backend.Series.subtract/2","doc":"","ref":"Explorer.Backend.Series.html#c:subtract/2"},{"type":"callback","title":"Explorer.Backend.Series.sum/1","doc":"","ref":"Explorer.Backend.Series.html#c:sum/1"},{"type":"callback","title":"Explorer.Backend.Series.tail/2","doc":"","ref":"Explorer.Backend.Series.html#c:tail/2"},{"type":"callback","title":"Explorer.Backend.Series.tan/1","doc":"","ref":"Explorer.Backend.Series.html#c:tan/1"},{"type":"callback","title":"Explorer.Backend.Series.to_iovec/1","doc":"","ref":"Explorer.Backend.Series.html#c:to_iovec/1"},{"type":"callback","title":"Explorer.Backend.Series.to_list/1","doc":"","ref":"Explorer.Backend.Series.html#c:to_list/1"},{"type":"callback","title":"Explorer.Backend.Series.transform/2","doc":"","ref":"Explorer.Backend.Series.html#c:transform/2"},{"type":"callback","title":"Explorer.Backend.Series.unary_not/1","doc":"","ref":"Explorer.Backend.Series.html#c:unary_not/1"},{"type":"callback","title":"Explorer.Backend.Series.unordered_distinct/1","doc":"","ref":"Explorer.Backend.Series.html#c:unordered_distinct/1"},{"type":"callback","title":"Explorer.Backend.Series.upcase/1","doc":"","ref":"Explorer.Backend.Series.html#c:upcase/1"},{"type":"callback","title":"Explorer.Backend.Series.variance/1","doc":"","ref":"Explorer.Backend.Series.html#c:variance/1"},{"type":"callback","title":"Explorer.Backend.Series.window_max/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_max/5"},{"type":"callback","title":"Explorer.Backend.Series.window_mean/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_mean/5"},{"type":"callback","title":"Explorer.Backend.Series.window_median/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_median/5"},{"type":"callback","title":"Explorer.Backend.Series.window_min/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_min/5"},{"type":"callback","title":"Explorer.Backend.Series.window_standard_deviation/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_standard_deviation/5"},{"type":"callback","title":"Explorer.Backend.Series.window_sum/5","doc":"","ref":"Explorer.Backend.Series.html#c:window_sum/5"},{"type":"callback","title":"Explorer.Backend.Series.year/1","doc":"","ref":"Explorer.Backend.Series.html#c:year/1"},{"type":"type","title":"Explorer.Backend.Series.df/0","doc":"","ref":"Explorer.Backend.Series.html#t:df/0"},{"type":"type","title":"Explorer.Backend.Series.dtype/0","doc":"","ref":"Explorer.Backend.Series.html#t:dtype/0"},{"type":"type","title":"Explorer.Backend.Series.lazy_s/0","doc":"","ref":"Explorer.Backend.Series.html#t:lazy_s/0"},{"type":"type","title":"Explorer.Backend.Series.non_finite/0","doc":"","ref":"Explorer.Backend.Series.html#t:non_finite/0"},{"type":"type","title":"Explorer.Backend.Series.option/1","doc":"","ref":"Explorer.Backend.Series.html#t:option/1"},{"type":"type","title":"Explorer.Backend.Series.s/0","doc":"","ref":"Explorer.Backend.Series.html#t:s/0"},{"type":"type","title":"Explorer.Backend.Series.t/0","doc":"","ref":"Explorer.Backend.Series.html#t:t/0"},{"type":"type","title":"Explorer.Backend.Series.valid_types/0","doc":"","ref":"Explorer.Backend.Series.html#t:valid_types/0"},{"type":"module","title":"Explorer.PolarsBackend","doc":"The Explorer backend for Polars.","ref":"Explorer.PolarsBackend.html"},{"type":"extras","title":"Ten Minutes to Explorer","doc":"# Ten Minutes to Explorer\n\n```elixir\nMix.install([\n {:explorer, \"~> 0.6.0\"},\n {:kino, \"~> 0.9.0\"}\n])\n```","ref":"exploring_explorer.html"},{"type":"extras","title":"Introduction - Ten Minutes to Explorer","doc":"Explorer is a dataframe library for Elixir. A dataframe is a common data structure used in data analysis. It is a two-dimensional table composed of columns and rows similar to a SQL table or a spreadsheet.\n\nExplorer's aim is to provide a simple and powerful API for manipulating dataframes. It takes influences mainly\n from the [`tidyverse`](https://www.tidyverse.org), but if you've used other dataframe libraries like `pandas` you shouldn't have too much trouble working with Explorer.\n\nThis document is meant to give you a crash course in using Explorer. More in-depth documentation can be found in the relevant sections of the docs.\n\nWe strongly recommend you run this livebook locally so you can see the outputs and play with the inputs!","ref":"exploring_explorer.html#introduction"},{"type":"extras","title":"Reading and writing data - Ten Minutes to Explorer","doc":"Data can be read from delimited files (like CSV), NDJSON, Parquet, and the Arrow IPC (feather) format. You can also load in data from a map or keyword list of columns with `Explorer.DataFrame.new/1`.\n\nFor CSV, your 'usual suspects' of options are available:\n\n* `delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n* `dtypes` - A keyword list of `[column_name: dtype]`. If a type is not specified for a column, it is imputed from the first 1000 rows. (default: `[]`)\n* `header` - Does the file have a header of column names as the first row or not? (default: `true`)\n* `max_rows` - Maximum number of lines to read. (default: `nil`)\n* `nil_values` - A list of strings that should be interpreted as a nil values. (default: `[]`)\n* `skip_rows` - The number of lines to skip at the beginning of the file. (default: `0`)\n* `columns` - A list of column names to keep. If present, only these columns are read into the dataframe. (default: `nil`)\n\n`Explorer` also has multiple example datasets built in, which you can load from the `Explorer.Datasets` module like so:\n\n```elixir\ndf = Explorer.Datasets.fossil_fuels()\n```\n\nYou'll notice that the output looks slightly different than many dataframe libraries. `Explorer` takes inspiration on this front from [`glimpse`](https://pillar.r-lib.org/reference/glimpse.html) in R. A benefit to this approach is that you will rarely need to elide columns.\n\nIf you'd like to see a table with your data, we've got you covered there too.\n\n```elixir\nExplorer.DataFrame.table(df)\n```\n\nWriting files is very similar to reading them. The options are a little more limited:\n\n* `header` - Should the column names be written as the first line of the file? (default: `true`)\n* `delimiter` - A single character used to separate fields within a record. (default: `\",\"`)\n\nFirst, let's add some useful aliases:\n\n```elixir\nalias Explorer.DataFrame\nalias Explorer.Series\n```\n\nAnd then write to a file of your choosing:\n\n```elixir\ninput = Kino.Input.text(\"Filename\")\n```\n\n```elixir\nfilename = Kino.Input.read(input)\nDataFrame.to_csv(df, filename)\n```","ref":"exploring_explorer.html#reading-and-writing-data"},{"type":"extras","title":"Working with Series - Ten Minutes to Explorer","doc":"`Explorer`, like `Polars`, works up from the concept of a `Series`. In many ways, you can think of a dataframe as a row-aligned map of `Series`. These are like `vectors` in R or `series` in Pandas.\n\nFor simplicity, `Explorer` uses the following `Series` `dtypes`:\n\n* `:float` - 64-bit floating point number\n* `:integer` - 64-bit signed integer\n* `:boolean` - Boolean\n* `:string` - UTF-8 encoded binary\n* `:date` - Date type that unwraps to `Elixir.Date`\n* `:datetime` - DateTime type that unwraps to `Elixir.NaiveDateTime`\n\n`Series` can be constructed from Elixir basic types. For example:\n\n```elixir\ns1 = Series.from_list([1, 2, 3])\n```\n\n```elixir\ns2 = Series.from_list([\"a\", \"b\", \"c\"])\n```\n\n```elixir\ns3 = Series.from_list([~D[2011-01-01], ~D[1965-01-21]])\n```\n\nYou'll notice that the `dtype` and size of the `Series` are at the top of the printed value. You can get those programmatically as well.\n\n```elixir\nSeries.dtype(s3)\n```\n\n```elixir\nSeries.size(s3)\n```\n\nAnd the printed values max out at 50:\n\n```elixir\n1..100 |> Enum.to_list() |> Series.from_list()\n```\n\nSeries are also nullable.\n\n```elixir\ns = Series.from_list([1.0, 2.0, nil, nil, 5.0])\n```\n\nAnd you can fill in those missing values using one of the following strategies:\n\n* `:forward` - replace nil with the previous value\n* `:backward` - replace nil with the next value\n* `:max` - replace nil with the series maximum\n* `:min` - replace nil with the series minimum\n* `:mean` - replace nil with the series mean\n\n```elixir\nSeries.fill_missing(s, :forward)\n```\n\nIn the case of mixed numeric types (i.e. integers and floats), `Series` will downcast to a float:\n\n```elixir\nSeries.from_list([1, 2.0])\n```\n\nIn all other cases, `Series` must all be of the same `dtype` or else you'll get an `ArgumentError`.\n\n```elixir\nSeries.from_list([1, 2, 3, \"a\"])\n```\n\nOne of the goals of `Explorer` is *useful error messages*. If you look at the error above, you get:\n\n> Cannot make a series from mismatched types. Type of \"a\" does not match inferred dtype integer.\n\nHopefully this makes abundantly clear what's going on.\n\n`Series` also implements the `Access` protocol. You can slice and dice in many ways:\n\n```elixir\ns = 1..10 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\ns[1]\n```\n\n```elixir\ns[-1]\n```\n\n```elixir\ns[0..4]\n```\n\n```elixir\ns[[0, 4, 4]]\n```\n\nAnd of course, you can convert back to an Elixir list.\n\n```elixir\nSeries.to_list(s)\n```\n\n`Explorer` supports comparisons.\n\n```elixir\ns = 1..11 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\ns1 = 11..1 |> Enum.to_list() |> Series.from_list()\n```\n\n```elixir\nSeries.equal(s, s1)\n```\n\n```elixir\nSeries.equal(s, 5)\n```\n\n```elixir\nSeries.not_equal(s, 10)\n```\n\n```elixir\nSeries.greater_equal(s, 4)\n```\n\nAnd arithmetic.\n\n```elixir\nSeries.add(s, s1)\n```\n\n```elixir\nSeries.subtract(s, 4)\n```\n\n```elixir\nSeries.multiply(s, s1)\n```\n\nRemember those helpful errors? We've tried to add those throughout. So if you try to do arithmetic with mismatching dtypes:\n\n```elixir\ns = Series.from_list([1, 2, 3])\ns1 = Series.from_list([1.0, 2.0, 3.0])\nSeries.add(s, s1)\n```\n\nJust kidding! Integers and floats will downcast to floats. Let's try again:\n\n```elixir\ns = Series.from_list([1, 2, 3])\ns1 = Series.from_list([\"a\", \"b\", \"c\"])\nSeries.add(s, s1)\n```\n\nYou can flip them around.\n\n```elixir\ns = Series.from_list([1, 2, 3, 4])\nSeries.reverse(s)\n```\n\nAnd sort.\n\n```elixir\n1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list() |> Series.sort()\n```\n\nOr argsort.\n\n```elixir\ns = 1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list()\nids = Series.argsort(s) |> Series.to_list()\n```\n\nWhich you can pass to `Explorer.Series.slice/2` if you want the sorted values.\n\n```elixir\nSeries.slice(s, ids)\n```\n\nYou can calculate cumulative values.\n\n```elixir\ns = 1..100 |> Enum.to_list() |> Series.from_list()\nSeries.cumulative_sum(s)\n```\n\nOr rolling ones.\n\n```elixir\nSeries.window_sum(s, 4)\n```\n\nYou can count and list unique values.\n\n```elixir\ns = Series.from_list([\"a\", \"b\", \"b\", \"c\", \"c\", \"c\"])\nSeries.distinct(s)\n```\n\n```elixir\nSeries.n_distinct(s)\n```\n\nAnd you can even get a dataframe showing the frequencies for each distinct value.\n\n```elixir\nSeries.frequencies(s)\n```","ref":"exploring_explorer.html#working-with-series"},{"type":"extras","title":"Working with DataFrames - Ten Minutes to Explorer","doc":"A `DataFrame` is really just a collection of `Series` of the same size. Which is why you can create a `DataFrame` from a `Keyword` list.\n\n```elixir\nDataFrame.new(a: [1, 2, 3], b: [\"a\", \"b\", \"c\"])\n```\n\nSimilarly to `Series`, the `Inspect` implementation prints some info at the top and to the left. At the top we see the shape of the dataframe (rows and columns) and then for each column we see the name, dtype, and first five values. We can see a bit more from that built-in dataset we loaded in earlier.\n\n```elixir\ndf\n```\n\nYou will also see grouping information there, but we'll get to that later. You can get the info yourself directly:\n\n```elixir\nDataFrame.names(df)\n```\n\n```elixir\nDataFrame.dtypes(df)\n```\n\n```elixir\nDataFrame.shape(df)\n```\n\n```elixir\n{DataFrame.n_rows(df), DataFrame.n_columns(df)}\n```\n\nWe can grab the head.\n\n```elixir\nDataFrame.head(df)\n```\n\nOr the tail. Let's get a few more values from the tail.\n\n```elixir\nDataFrame.tail(df, 10)\n```\n\n#","ref":"exploring_explorer.html#working-with-dataframes"},{"type":"extras","title":"Verbs and macros - Ten Minutes to Explorer","doc":"In `Explorer`, like in `dplyr`, we have five main verbs to work with dataframes:\n\n* select\n* filter\n* mutate\n* arrange\n* summarise\n\nWe are going to explore then in this notebook, but first we need to \"require\"\nthe `Explorer.DataFrame` module in order to load the macros needed for these verbs.\n\nI want to take the opportunity to create a shorter alias for the `DataFrame` module,\ncalled `DF`:\n\n```elixir\nrequire DataFrame, as: DF\n```\n\nFrom now on we are using the shorter version, `DF`, to refer to the required `Explorer.DataFrame`\nmodule.\n\n#","ref":"exploring_explorer.html#verbs-and-macros"},{"type":"extras","title":"Select - Ten Minutes to Explorer","doc":"Let's jump right into it. We can select columns pretty simply.\n\n```elixir\nDF.select(df, [\"year\", \"country\"])\n```\n\nBut Elixir gives us some superpowers. In R there's [`tidy-select`](https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html). I don't think we need that in Elixir. Anywhere in `Explorer` where you need to pass a list of column names, you can also execute a filtering callback on the column names. It's just an anonymous function passed to `df |> DataFrame.names() |> Enum.filter(callback_here)`.\n\n```elixir\nDF.select(df, &String.ends_with?(&1, \"fuel\"))\n```\n\nWant all but some columns? `discard/2` performs the opposite of `select/2`.\n\n```elixir\nDF.discard(df, &String.ends_with?(&1, \"fuel\"))\n```\n\n#","ref":"exploring_explorer.html#select"},{"type":"extras","title":"Filter - Ten Minutes to Explorer","doc":"The next verb we'll look at is `filter`.\n\nThis is implemented using a macro, so it's possible to use expressions\nlike you would if comparing variables in Elixir:\n\n```elixir\nDF.filter(df, country == \"BRAZIL\")\n```\n\nUsing complex filters is also possible:\n\n```elixir\nDF.filter(df, country == \"ALGERIA\" and year > 2012)\n```\n\nYou can also write the same filter without the macro, by using the callback version function which is `filter_with/2`:\n\n```elixir\nDF.filter_with(df, fn ldf ->\n ldf[\"country\"]\n |> Series.equal(\"ALGERIA\")\n |> Series.and(Series.greater(ldf[\"year\"], 2012))\nend)\n```\n\nBy the way, all the `Explorer.DataFrame` macros have a correspondent function that accepts a callback.\nIn fact, our macros are implemented using those functions.\n\nThe `filter_with/2` function is going to use a virtual representation of the dataframe\nthat we call a \"lazy frame\". With lazy frames you canĀ“t access the\nseries contents, but every operation will be optimized and run only once.\n\nRemember those helpful error messages?\n\n```elixir\nDF.filter(df, cuontry == \"BRAZIL\")\n```\n\n#","ref":"exploring_explorer.html#filter"},{"type":"extras","title":"Mutate - Ten Minutes to Explorer","doc":"A common task in data analysis is to add columns or change existing ones. Mutate is a handy verb.\n\n```elixir\nDF.mutate(df, new_column: solid_fuel + cement)\n```\n\nDid you catch that? You can pass in new columns as keyword arguments. It also works to transform existing columns.\n\n```elixir\nDF.mutate(df,\n gas_fuel: Series.cast(gas_fuel, :float),\n gas_and_liquid_fuel: gas_fuel + liquid_fuel\n)\n```\n\n`DataFrame.mutate/2` is flexible though. You may not always want to use keyword arguments. Given that column names are `String.t()`, it may make more sense to use a map.\n\n```elixir\nDF.mutate(df, %{\"gas_fuel\" => gas_fuel - 10})\n```\n\n`DF.transmute/2`, which is `DF.mutate/2` that only retains the specified columns, is forthcoming.\n\n#","ref":"exploring_explorer.html#mutate"},{"type":"extras","title":"Arrange - Ten Minutes to Explorer","doc":"Sorting the dataframe is pretty straightforward.\n\n```elixir\nDF.arrange(df, year)\n```\n\nBut it comes with some tricks up its sleeve.\n\n```elixir\nDF.arrange(df, asc: total, desc: year)\n```\n\nAs the examples show, `arrange/2` is a macro, and therefore you can use some functions to arrange your dataframe:\n\n```elixir\nDF.arrange(df, asc: Series.window_sum(total, 2))\n```\n\nSort operations happen left to right. And keyword list args permit specifying the direction.\n\n#","ref":"exploring_explorer.html#arrange"},{"type":"extras","title":"Distinct - Ten Minutes to Explorer","doc":"Okay, as expected here too. Very straightforward.\n\n```elixir\nDF.distinct(df, [\"year\", \"country\"])\n```\n\nYou can specify whether to keep the other columns as well, so the first row of each distinct value is kept:\n\n```elixir\nDF.distinct(df, [\"country\"], keep_all: true)\n```\n\n#","ref":"exploring_explorer.html#distinct"},{"type":"extras","title":"Rename - Ten Minutes to Explorer","doc":"Rename can take either a list of new names or a callback that is passed to `Enum.map/2` against the names. You can also use a map or keyword args to rename specific columns.\n\n```elixir\nDF.rename(df, year: \"year_test\")\n```\n\n```elixir\nDF.rename_with(df, &(&1 \"_test\"))\n```\n\n#","ref":"exploring_explorer.html#rename"},{"type":"extras","title":"Dummies - Ten Minutes to Explorer","doc":"This is fun! We can get dummy variables for unique values.\n\n```elixir\nDF.dummies(df, [\"year\"])\n```\n\n```elixir\nDF.dummies(df, [\"country\"])\n```\n\n#","ref":"exploring_explorer.html#dummies"},{"type":"extras","title":"Sampling - Ten Minutes to Explorer","doc":"Random samples can give us a percent or a specific number of samples, with or without replacement, and the function is seedable.\n\n```elixir\nDF.sample(df, 10)\n```\n\n```elixir\nDF.sample(df, 0.4)\n```\n\nTrying for those helpful error messages again.\n\n```elixir\nDF.sample(df, 10000)\n```\n\n```elixir\nDF.sample(df, 10000, replacement: true)\n```\n\n#","ref":"exploring_explorer.html#sampling"},{"type":"extras","title":"Pull and slice - Ten Minutes to Explorer","doc":"Slicing and dicing can be done with the `Access` protocol or with explicit pull/slice/take functions.\n\n```elixir\ndf[\"year\"]\n```\n\n```elixir\nDF.pull(df, \"year\")\n```\n\n```elixir\ndf[[\"year\", \"country\"]]\n```\n\n```elixir\nDF.slice(df, [1, 20, 50])\n```\n\nNegative offsets work for slice!\n\n```elixir\nDF.slice(df, -10, 5)\n```\n\n```elixir\nDF.slice(df, 10, 5)\n```\n\nSlice also works with ranges:\n\n```elixir\nDF.slice(df, 12..42)\n```\n\n#","ref":"exploring_explorer.html#pull-and-slice"},{"type":"extras","title":"Pivot - Ten Minutes to Explorer","doc":"We can `pivot_longer/3` and `pivot_wider/4`. These are inspired by [tidyr](https://tidyr.tidyverse.org/articles/pivot.html).\n\nThere are some shortcomings in `pivot_wider/4` related to `polars`. The `select` option must select only columns of numeric type.\n\n```elixir\nDF.pivot_longer(df, [\"year\", \"country\"], select: &String.ends_with?(&1, \"fuel\"))\n```\n\n```elixir\nDF.pivot_wider(df, \"country\", \"total\", id_columns: [\"year\"])\n```\n\nLet's make those names look nicer!\n\n```elixir\ntidy_names = fn name ->\n name\n |> String.downcase()\n |> String.replace(~r/\\s/, \" \")\n |> String.replace(~r/[^A-Za-z\\s]/, \"\")\n |> String.replace(\" \", \"_\")\nend\n\ndf\n|> DF.pivot_wider(\"country\", \"total\", id_columns: [\"year\"])\n|> DF.rename_with(tidy_names)\n```\n\n#","ref":"exploring_explorer.html#pivot"},{"type":"extras","title":"Joins - Ten Minutes to Explorer","doc":"Joining is *fast* and easy. You can specify the columns to join on and how to join. Polars even supports cartesian (cross) joins, so `Explorer` does too.\n\n```elixir\ndf1 = DF.select(df, [\"year\", \"country\", \"total\"])\ndf2 = DF.select(df, [\"year\", \"country\", \"cement\"])\n\nDF.join(df1, df2)\n```\n\n```elixir\ndf3 = df |> DF.select([\"year\", \"cement\"]) |> DF.slice(0, 500)\n\nDF.join(df1, df3, how: :left)\n```\n\n#","ref":"exploring_explorer.html#joins"},{"type":"extras","title":"Grouping - Ten Minutes to Explorer","doc":"`Explorer` supports *groupby* operations. They're limited based on what's possible in Polars, but they do most of what you need to do.\n\n```elixir\ngrouped = DF.group_by(df, [\"country\"])\n```\n\nNotice that the `Inspect` call now shows `groups` as well as `rows` and `columns`. You can, of course, get them explicitly.\n\n```elixir\nDF.groups(grouped)\n```\n\nAnd you can ungroup explicitly.\n\n```elixir\nDF.ungroup(grouped)\n```\n\nBut what we care about the most is aggregating! Let's see which country has the max `per_capita` value.\n\n```elixir\ngrouped\n|> DF.summarise(max_per_capita: max(per_capita))\n|> DF.arrange(desc: max_per_capita)\n```\n\nQatar it is.\n\nYou may noticed that we are using `max/1` inside the `summarise` macro. This is possible because we expose all functions from the `Series` module. You can use the following aggregations inside summarise:\n\n* `min/1` - Take the minimum value within the group. See `Explorer.Series.min/1`.\n* `max/1` - Take the maximum value within the group. See `Explorer.Series.max/1`.\n* `sum/1` - Take the sum of the series within the group. See `Explorer.Series.sum/1`.\n* `mean/1` - Take the mean of the series within the group. See `Explorer.Series.mean/1`.\n* `median/1` - Take the median of the series within the group. See `Explorer.Series.median/1`.\n* `first/1` - Take the first value within the group. See `Explorer.Series.first/1`.\n* `last/1` - Take the last value within the group. See `Explorer.Series.last/1`.\n* `count/1` - Count the number of rows per group.\n* `n_unique/1` - Count the number of unique rows per group.\n\nThe API is similar to `mutate`: you can use keyword args or a map and specify aggregations to use.\n\n```elixir\nDF.summarise(grouped, min_per_capita: min(per_capita), min_total: min(total))\n```\n\nSpeaking of `mutate`, it's 'group-aware'. As are `arrange`, `distinct`, and `n_rows`.\n\n```elixir\nDF.mutate(grouped, total_window_sum: window_sum(total, 3), rows_in_group: count(country))\n```\n\nIt's also possible to use aggregations inside other functions:\n\n```elixir\ngrouped\n|> DF.summarise(greater_than_9: greater(max(per_capita), 9.0), per_capita_max: max(per_capita))\n|> DataFrame.arrange(desc: per_capita_max)\n```\n\n#","ref":"exploring_explorer.html#grouping"},{"type":"extras","title":"That's it! - Ten Minutes to Explorer","doc":"And not. This is certainly not exhaustive, but I hope it gives you a good idea of what can be done and what the 'flavour' of the API is like. I'd love contributions and issues raised where you find them!","ref":"exploring_explorer.html#that-s-it"},{"type":"extras","title":"Changelog","doc":"# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [v0.6.1] - 2023-07-06\n\n#","ref":"changelog.html"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix summarise without groups for lazy frames.\n\n## [v0.6.0] - 2023-07-05\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add support for OTP 26 and Elixir 1.15.\n\n- Allow `Explorer.DataFrame.summarise/2` to work without groups.\n The aggregations can work considering the entire dataframe.\n\n- Add the following series functions: `product/1`, `cummulative_product/1`, `abs/1`,\n `skew/2`, `window_standard_deviation/3`, `rank/2`, `year/1`, `mounth/1`, `day/1`,\n `hour/1`, `minute/1`, `second/1`, `strptime/2`, `strftime/2`, `argmin/1`, `argmax/1`,\n `cut/3`, `qcut/3`, `correlation/3`, `covariance/2` and `clip/3`.\n\n They cover a lot in terms of functionality, so please check the `Explorer.Series`\n docs for further details.\n\n- Add `Explorer.DataFrame.nil_count/1` that counts the number of nil elements in each\n column.\n\n- Add `Explorer.DataFrame.frequencies/2` that creates a new dataframe with unique rows\n and the frequencies of each.\n\n- Add `Explorer.DataFrame.relocate/3` that enables changing order of columns from a df.\n\n- Add precompiled NIFs for FreeBSD.\n\n- Support scalar values in the `on_true` and `on_false` arguments of `Explore.Series.select/3`.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `Series.day_of_week/1` and `Series.round/2` for operations using a lazy frame.\n\n- Fix upcasted date to datetime for literal expressions. It allows to use scalar dates\n in expressions like this: `DF.mutate(a: ~D[2023-01-01])`. This also fixes the support\n for naive datetimes.\n\n- Improve error messages returned from the NIF to be always strings. Now we add more\n context to the string returned, instead of having `{:context, error_message}`.\n\n- Fix the `:infer_schema_length` option of `Explorer.DataFrame.from_csv/2` when passing `nil`.\n Now it's possible to take into account the entire file to infer the schema.\n\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Deprecated - Changelog","doc":"- Deprecate `Explorer.Series.to_date/1` and `Explorer.Series.to_time/1` in favor of\n using `Explorer.Series.cast(s, :date)` and `Explorer.Series.cast(s, :time)` respectively.\n\n## [v0.5.7] - 2023-05-10\n\n#","ref":"changelog.html#deprecated"},{"type":"extras","title":"Added - Changelog","doc":"- Allow `Explorer.Series.select/3` to receive series of size 1 in both sides.\n\n- Add trigonometric functions `sin/1`, `cos/1`, `tan/1`, `asin/1`, `acos/1` and\n `atan/1` to `Explorer.Series`.\n\n- Add `Explorer.DataFrame.to_rows_stream/2` function. This is useful to traverse\n dataframes with large series, but is not recommended since it can be an expensive\n operation.\n\n- Add LazyFrame version of `Explorer.DataFrame.to_ipc/3`.\n\n- Add options to control streaming when writing lazy dataframes. Now users can\n toggle streaming for the `to_ipc/3` and `to_parquet/3` functions.\n\n- Add `Explorer.DataFrame.from_ipc_stream/2` lazy, but using the eager implementation\n underneath.\n\n- Add option to control the end of line (EOF) char when reading CSV files.\n We call this new option `:eol_delimiter`, and it's available for the `from_csv/2`\n and `load_csv/2` functions in the `Explorer.DataFrame` module.\n\n- Allow `Explorer.DataFrame.pivot_wider/4` to use category fields.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `nif_not_loaded` error when `Explorer.Series.ewm_mean/2` is called from query.\n\n- Type check arguments for boolean series operations, only allowing series of\n the `boolean` dtype.\n\n- Do not use `../0` in order to keep compatible with Elixir 1.13\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Removed - Changelog","doc":"- Temporarely remove support for ARM 32 bits computers in the precompilation\n workflow.\n\n## [v0.5.6] - 2023-03-24\n\n#","ref":"changelog.html#removed"},{"type":"extras","title":"Added - Changelog","doc":"- Add the following functions to the `Explorer.Series` module: `log/1`, `log/2`\n and `exp/1`. They compute the logarithm and exponential of a series.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Allow `Explorer.Series.select/3` to receive series of size 1 for both the\n `on_true` and `on_false` arguments.\n\n- Fix the encoding of special float values that may return from some series\n functions. This is going to encode the atoms for NaN and infinity values.\n\n## [v0.5.5] - 2023-03-13\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add support for multiple value columns in pivot wider.\n The resultant dataframe that is created from this type of pivoting is going\n to have columns with the names prefixed by the original value column, followed\n by an underscore and the name of the variable.\n\n- Add `Explorer.Series.ewm_mean/2` for calculating exponentially weighted moving\n average.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Change the `Explorer.Backend.DataFrame`'s `pivot_wider` callback to work with\n multiple columns instead of only one.\n\n- Change the `Explorer.Backend.DataFrame`'s `window_*` callbacks to work with\n variables instead of keyword args. This is needed to make explicit when a backend\n is not implementing an option.\n\n- Change the `Explorer.Backend.DataFrame`'s `describe` callback and remove the\n need for an \"out df\", since we won't have a lazy version of that funcion.\n\n- This shouldn't affect the API, but we had an update in Polars.\n It is now using `v0.27.2`. For further details, see:\n [Rust Polars 0.27.0](https://github.com/pola-rs/polars/releases/tag/rs-0.27.0).\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Provide hints when converting string/binary series to tensors.\n\n- Add libatomic as a link to the generated NIF. This is needed to fix the load\n of the Explorer NIF when running on ARM 32 bits machines like the Pi 3.\n See the [original issue](https://github.com/philss/rustler_precompiled/issues/53)\n\n## [v0.5.4] - 2023-03-09\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix missing \"README.md\" file in the list of package files.\n Our readme is now required in compilation, because it contains the moduledoc for\n the main `Explorer` module.\n\n## [v0.5.3] - 2023-03-08\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add the `Explorer.Series.format/1` function that concatenates multiple series together,\n always returning a string series.\n\n- With the addition of `format/1`, we also have a new operator for string concatenation\n inside `Explorer.Query`. It is the ` ` operator, that is similar to what the `Kernel. /2`\n operator does, but instead of concatenating strings, it concatenates two series, returning\n a string series - it is using `format/1` underneath.\n\n- Add support for slicing by series in dataframes and other series.\n\n- Add support for 2D tensors in `Explorer.DataFrame.new/2`.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `Explorer.DataFrame.new/2` to respect the selected dtype when an entire series is nil.\n\n- Improve error message for mismatched dtypes in series operations.\n\n- Fix lazy series operations of binary series and binary values. This is going to wrap binary\n values in the correct dtype, in order to pass down to Polars.\n\n- Fix two bugs in `Explorer.DataFrame.pivot_wider/3`: `nil` values in the series that is\n used for new column names is now correctly creating a `nil` column. We also fixed the problem\n of a duplicated column created after pivoting, and possibly conflicting with an existing\n ID column. We add a suffix for these columns.\n\n## [v0.5.2] - 2023-02-28\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `across` and comprehensions to `Explorer.Query`. These features allow a\n more flexible and elegant way to work with multiple columns at once. Example:\n\n ```elixir\n iris = Explorer.Datasets.iris()\n Explorer.DataFrame.mutate(iris,\n for col <- across([\"sepal_width\", \"sepal_length\", \"petal_length\", \"petal_width\"]) do\n {col.name, (col - mean(col)) / variance(col)}\n end\n )\n ```\n\n See the `Explorer.Query` documentation for further details.\n\n- Add support for regexes to select columns of a dataframe. Example:\n\n ```elixir\n df = Explorer.Datasets.wine()\n df[~r/(class|hue)/]\n ```\n\n- Add the `:max_rows` and `:columns` options to `Explorer.DataFrame.from_parquet/2`. This mirrors\n the `from_csv/2` function.\n\n- Allow `Explorer.Series` functions that accept floats to work with `:nan`, `:infinity`\n and `:neg_infinity` values.\n\n- Add `Explorer.DataFrame.shuffle/2` and `Explorer.Series.shuffle/2`.\n\n- Add support for a list of filters in `Explorer.DataFrame.filter/2`. These filters are\n joined as `and` expressions.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Add `is_integer/1` guard to `Explorer.Series.shift/2`.\n- Raise if series sizes do not match for binary operations.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Changed - Changelog","doc":"- Rename the option `:replacement` to `:replace` for `Explorer.DataFrame.sample/3` and\n `Explorer.Series.sample/3`.\n\n- Change the default behaviour of sampling to not shuffle by default. A new option\n named `:shuffle` was added to control that.\n\n## [v0.5.1] - 2023-02-17\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Added - Changelog","doc":"- Add boolean dtype to `Series.in/2`.\n- Add binary dtype to `Series.in/2`.\n- Add `Series.day_of_week/1`.\n\n- Allow `Series.fill_missing/2` to:\n - receive `:infinity` and `:neg_infinity` values.\n - receive date and datetime values.\n - receive binary values.\n\n- Add support for `time` dtype.\n- Add version of `Series.pow/2` that accepts series on both sides.\n- Allow `Series.from_list/2` to receive `:nan`, `:infinity` and `:neg_infinity` atoms.\n- Add `Series.to_date/1` and `Series.to_time/1` for datetime series.\n- Allow casting of string series to category.\n- Accept tensors when creating a new dataframe.\n- Add compatibility with Nx v0.5.\n- Add support for Nx's serialize and deserialize.\n\n- Add the following function implementations for the Polars' Lazy dataframe backend:\n - `arrange_with`\n - `concat_columns`\n - `concat_rows`\n - `distinct`\n - `drop_nil`\n - `filter_with`\n - `join`\n - `mutate_with`\n - `pivot_longer`\n - `rename`\n - `summarise_with`\n - `to_parquet`\n\n Only `summarise_with` supports groups for this version.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Require version of Rustler to be `~> 0.27.0`, which mirrors the NIF requirement.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Casting to an unknown dtype returns a better error message.\n\n## [v0.5.0] - 2023-01-12\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `DataFrame.describe/2` to gather some statistics from a dataframe.\n- Add `Series.nil_count/1` to count nil values.\n- Add `Series.in/2` to check if a given value is inside a series.\n- Add `Series` float predicates: `is_finite/1`, `is_infinite/1` and `is_nan/1`.\n- Add `Series` string functions: `contains/2`, `trim/1`, `trim_leading/1`, `trim_trailing/1`,\n `upcase/1` and `downcase/1`.\n\n- Enable slicing of lazy frames (`LazyFrame`).\n- Add IO operations \"from/load\" to the lazy frame implementation.\n- Add support for the `:lazy` option in the `DataFrame.new/2` function.\n- Add `Series` float rounding methods: `round/2`, `floor/1` and `ceil/1`.\n- Add support for precompiling to Linux running on RISCV CPUs.\n- Add support for precompiling to Linux - with musl - running on AARCH64 computers.\n- Allow `DataFrame.new/1` to receive the `:dtypes` option.\n- Accept `:nan` as an option for `Series.fill_missing/2` with float series.\n- Add basic support for the categorical dtype - the `:category` dtype.\n- Add `Series.categories/1` to return categories from a categorical series.\n- Add `Series.categorise/2` to categorise a series of integers using predefined categories.\n- Add `Series.replace/2` to replace the contents of a series.\n- Support selecting columns with unusual names (like with spaces) inside `Explorer.Query`\n with `col/1`.\n\n The usage is like this:\n\n ```elixir\n Explorer.DataFrame.filter(df, col(\"my col\") > 42)\n ```\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix `DataFrame.mutate/2` using a boolean scalar value.\n- Stop leaking `UInt32` series to Elixir.\n- Cast numeric columns to our supported dtypes after IO read.\n This fix is only applied for the eager implementation for now.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Changed - Changelog","doc":"- Rename `Series.bintype/1` to `Series.iotype/1`.\n\n## [v0.4.0] - 2022-11-29\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `Series.quotient/2` and `Series.remainder/2` to work with integer division.\n- Add `Series.iotype/1` to return the underlying representation type.\n- Allow series on both sides of binary operations, like: `add(series, 1)`\n and `add(1, series)`.\n\n- Allow comparison, concat and coalesce operations on \"(series, lazy series)\".\n- Add lazy version of `Series.sample/3` and `Series.size/1`.\n- Add support for Arrow IPC Stream files.\n- Add `Explorer.Query` and the macros that allow a simplified query API.\n This is a huge improvement to some of the main functions, and allow refering to\n columns as they were variables.\n\n Before this change we would need to write a filter like this:\n\n ```elixir\n Explorer.DataFrame.filter_with(df, &Explorer.Series.greater(&1[\"col1\"], 42))\n ```\n\n But now it's also possible to write this operation like this:\n\n ```elixir\n Explorer.DataFrame.filter(df, col1 > 42)\n ```\n\n This operation is going to use `filter_with/2` underneath, which means that\n is going to use lazy series and compute the results at once.\n Notice that is mandatory to \"require\" the DataFrame module, since these operations\n are implemented as macros.\n\n The following new macros were added:\n - `filter/2`\n - `mutate/2`\n - `summarise/2`\n - `arrange/2`\n\n They substitute older versions that did not accept the new query syntax.\n\n- Add `DataFrame.put/3` to enable adding or replacing columns in a eager manner.\n This works similar to the previous version of `mutate/2`.\n\n- Add `Series.select/3` operation that enables selecting a value\n from two series based on a predicate.\n\n- Add \"dump\" and \"load\" functions to IO operations. They are useful to load\n or dump dataframes from/to memory.\n\n- Add `Series.to_iovec/2` and `Series.to_binary/1`. They return the underlying\n representation of series as binary. The first one returns a list of binaries,\n possibly with one element if the series is contiguous in memory. The second one\n returns a single binary representing the series.\n\n- Add `Series.shift/2` that shifts the series by an offset with nil values.\n- Rename `Series.fetch!/2` and `Series.take_every/2` to `Series.at/2`\n and `Series.at_every/2`.\n\n- Add `DataFrame.discard/2` to drop columns. This is the opposite of `select/2`.\n\n- Implement `Nx.LazyContainer` for `Explorer.DataFrame` and `Explorer.Series`\n so data can be passed into Nx.\n\n- Add `Series.not/1` that negates values in a boolean series.\n- Add the `:binary` dtype for Series. This enables the usage of arbitrary binaries.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Change DataFrame's `to_*` functions to return only `:ok`.\n- Change series inspect to resamble the dataframe inspect with the backend name.\n- Rename `Series.var/1` to `Series.variance/1`\n- Rename `Series.std/1` to `Series.standard_deviation/1`\n- Rename `Series.count/2` to `Series.frequencies/1` and add a new `Series.count/1`\n that returns the size of an \"eager\" series, or the count of members in a group\n for a lazy series.\n In case there is no groups, it calculates the size of the dataframe.\n- Change the option to control direction in `Series.sort/2` and `Series.argsort/2`.\n Instead of a boolean, now we have a new option called `:direction` that accepts\n `:asc` or `:desc`.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Fix the following DataFrame functions to work with groups:\n - `filter_with/2`\n - `head/2`\n - `tail/2`\n - `slice/2`\n - `slice/3`\n - `pivot_longer/3`\n - `pivot_wider/4`\n - `concat_rows/1`\n - `concat_columns/1`\n- Improve the documentation of functions that behave differently with groups.\n- Fix `arrange_with/2` to use \"group by\" stable, making results more predictable.\n- Add `nil` as a possible return value of aggregations.\n- Fix the behaviour of `Series.sort/2` and `Series.argsort/2` to add nils at the\n front when direction is descending, or at the back when the direction is ascending.\n This also adds an option to control this behaviour.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Removed - Changelog","doc":"- Remove support for `NDJSON` read and write for ARM 32 bits targets.\n This is due to a limitation of a dependency of Polars.\n\n## [v0.3.1] - 2022-09-09\n\n#","ref":"changelog.html#removed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Define `multiply` inside `*_with` operations.\n- Fix column types in several operations, such as `n_distinct`.\n\n## [v0.3.0] - 2022-09-01\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Added - Changelog","doc":"- Add `DataFrame.concat_columns/1` and `DataFrame.concat_columns/2` for horizontally stacking\n dataframes.\n- Add compression as an option to write parquet files.\n- Add count metadata to `DataFrame` table reader.\n- Add `DataFrame.filter_with/2`, `DataFrame.summarise_with/2`, `DataFrame.mutate_with/2` and\n`DataFrame.arrange_with/2`. They all accept a `DataFrame` and a function, and they all work with\n a new concept called \"lazy series\".\n\n Lazy Series is an opaque representation of a series that can be\n used to perform complex operations without pulling data from the series. This is faster than\n using masks. There is no big difference from the API perspective compared to the functions that were\n accepting callbacks before (eg. `filter/2` and the new `filter_with/2`), with the exception being\n `DataFrame.summarise_with/2` that now accepts a lot more operations.\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- Bump version requirement of the `table` dependency to `~> 0.1.2`, and raise for non-tabular values.\n- Normalize how columns are handled. This changes some functions to accept one column or\na list of columns, ranges, indexes and callbacks selecting columns.\n- Rename `DataFrame.filter/2` to `DataFrame.mask/2`.\n- Rename `Series.filter/2` to `Series.mask/2`.\n- Rename `take/2` from both `Series` and `DataFrame` to `slice/2`. `slice/2` now they accept ranges as well.\n- Raise an error if `DataFrame.pivot_wider/4` has float columns as IDs. This is because we canĀ“t\nproperly compare floats.\n- Change `DataFrame.distinct/2` to accept columns as argument instead of receiving it as option.\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Ensure that we can compare boolean series in functions like `Series.equal/2`.\n- Fix rename of columns after summarise.\n- Fix inspect of float series containing `NaN` or `Infinity` values. They are represented as atoms.\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Deprecated - Changelog","doc":"- Deprecate `DataFrame.filter/2` with a callback in favor of `DataFrame.filter_with/2`.\n\n## [v0.2.0] - 2022-06-22\n\n#","ref":"changelog.html#deprecated"},{"type":"extras","title":"Added - Changelog","doc":"- Consistently support ranges throughout the columns API\n- Support negative indexes throughout the columns API\n- Integrate with the `table` package\n- Add `Series.to_enum/1` for lazily traversing the series\n- Add `Series.coalesce/1` and `Series.coalesce/2` for finding the first non-null value in a list of series\n\n#","ref":"changelog.html#added"},{"type":"extras","title":"Changed - Changelog","doc":"- `Series.length/1` is now `Series.size/1` in keeping with Elixir idioms\n- `Nx` is now an optional dependency\n- Minimum Elixir version is now 1.13\n- `DataFrame.to_map/2` is now `DataFrame.to_columns/2` and `DataFrame.to_series/2`\n- `Rustler` is now an optional dependency\n- `read_` and `write_` IO functions are now `from_` and `to_`\n- `to_binary` is now `dump_csv`\n- Now uses `polars`'s \"simd\" feature\n- Now uses `polars`'s \"performant\" feature\n- `Explorer.default_backend/0` is now `Explorer.Backend.get/0`\n- `Explorer.default_backend/1` is now `Explorer.Backend.put/1`\n- `Series.cum_*` functions are now `Series.cumulative_*` to mirror `Nx`\n- `Series.rolling_*` functions are now `Series.window_*` to mirror `Nx`\n- `reverse?` is now an option instead of an argument in `Series.cumulative_*` functions\n- `DataFrame.from_columns/2` and `DataFrame.from_rows/2` is now `DataFrame.new/2`\n- Rename \"col\" to \"column\" throughout the API\n- Remove \"with\\_\" prefix in options throughout the API\n- `DataFrame.table/2` accepts options with `:limit` instead of single integer\n- `rename/2` no longer accepts a function, use `rename_with/2` instead\n- `rename_with/3` now expects the function as the last argument\n\n#","ref":"changelog.html#changed"},{"type":"extras","title":"Fixed - Changelog","doc":"- Explorer now works on Linux with musl\n\n## [v0.1.1] - 2022-04-27\n\n#","ref":"changelog.html#fixed"},{"type":"extras","title":"Security - Changelog","doc":"- Updated Rust dependencies to address Dependabot security alerts: [1](https://github.com/elixir-nx/explorer/security/dependabot/1), [2](https://github.com/elixir-nx/explorer/security/dependabot/3), [3](https://github.com/elixir-nx/explorer/security/dependabot/4)\n\n## [v0.1.0] - 2022-04-26\n\nFirst release.\n\n[Unreleased]: https://github.com/elixir-nx/explorer/compare/v0.6.1...HEAD\n[v0.6.1]: https://github.com/elixir-nx/explorer/compare/v0.6.0...v0.6.1\n[v0.6.0]: https://github.com/elixir-nx/explorer/compare/v0.5.7...v0.6.0\n[v0.5.7]: https://github.com/elixir-nx/explorer/compare/v0.5.6...v0.5.7\n[v0.5.6]: https://github.com/elixir-nx/explorer/compare/v0.5.5...v0.5.6\n[v0.5.5]: https://github.com/elixir-nx/explorer/compare/v0.5.4...v0.5.5\n[v0.5.4]: https://github.com/elixir-nx/explorer/compare/v0.5.3...v0.5.4\n[v0.5.3]: https://github.com/elixir-nx/explorer/compare/v0.5.2...v0.5.3\n[v0.5.2]: https://github.com/elixir-nx/explorer/compare/v0.5.1...v0.5.2\n[v0.5.1]: https://github.com/elixir-nx/explorer/compare/v0.5.0...v0.5.1\n[v0.5.0]: https://github.com/elixir-nx/explorer/compare/v0.4.0...v0.5.0\n[v0.4.0]: https://github.com/elixir-nx/explorer/compare/v0.3.1...v0.4.0\n[v0.3.1]: https://github.com/elixir-nx/explorer/compare/v0.3.0...v0.3.1\n[v0.3.0]: https://github.com/elixir-nx/explorer/compare/v0.2.0...v0.3.0\n[v0.2.0]: https://github.com/elixir-nx/explorer/compare/v0.1.1...v0.2.0\n[v0.1.1]: https://github.com/elixir-nx/explorer/compare/v0.1.0...v0.1.1\n[v0.1.0]: https://github.com/elixir-nx/explorer/releases/tag/v0.1.0","ref":"changelog.html#security"}],"content_type":"text/markdown"} \ No newline at end of file diff --git a/dist/sidebar_items-115BAD9F.js b/dist/sidebar_items-1155EA65.js similarity index 53% rename from dist/sidebar_items-115BAD9F.js rename to dist/sidebar_items-1155EA65.js index 38b4bace5..cd3b896bb 100644 --- a/dist/sidebar_items-115BAD9F.js +++ b/dist/sidebar_items-1155EA65.js @@ -1 +1 @@ -sidebarNodes={"modules":[{"id":"Explorer","deprecated":false,"group":"","title":"Explorer","sections":[{"id":"Getting started","anchor":"module-getting-started"},{"id":"A glimpse of the API","anchor":"module-a-glimpse-of-the-api"},{"id":"Features and design","anchor":"module-features-and-design"}]},{"id":"Explorer.DataFrame","deprecated":false,"group":"","title":"Explorer.DataFrame","sections":[{"id":"Creating dataframes","anchor":"module-creating-dataframes"},{"id":"Verbs","anchor":"module-verbs"},{"id":"IO operations","anchor":"module-io-operations"},{"id":"Selecting columns and access","anchor":"module-selecting-columns-and-access"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"column/0","deprecated":false,"title":"column()","anchor":"t:column/0"},{"id":"column_name/0","deprecated":false,"title":"column_name()","anchor":"t:column_name/0"},{"id":"column_names/0","deprecated":false,"title":"column_names()","anchor":"t:column_names/0"},{"id":"column_pairs/1","deprecated":false,"title":"column_pairs(value)","anchor":"t:column_pairs/1"},{"id":"columns/0","deprecated":false,"title":"columns()","anchor":"t:columns/0"},{"id":"fs_entry/0","deprecated":false,"title":"fs_entry()","anchor":"t:fs_entry/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions: Conversion","nodes":[{"id":"collect/1","deprecated":false,"title":"collect(df)","anchor":"collect/1"},{"id":"new/2","deprecated":false,"title":"new(data, opts \\\\ [])","anchor":"new/2"},{"id":"to_columns/2","deprecated":false,"title":"to_columns(df, opts \\\\ [])","anchor":"to_columns/2"},{"id":"to_lazy/1","deprecated":false,"title":"to_lazy(df)","anchor":"to_lazy/1"},{"id":"to_rows/2","deprecated":false,"title":"to_rows(df, opts \\\\ [])","anchor":"to_rows/2"},{"id":"to_rows_stream/2","deprecated":false,"title":"to_rows_stream(df, opts \\\\ [])","anchor":"to_rows_stream/2"},{"id":"to_series/2","deprecated":false,"title":"to_series(df, opts \\\\ [])","anchor":"to_series/2"}],"key":"functions-conversion"},{"name":"Functions: Single-table","nodes":[{"id":"arrange/2","deprecated":false,"title":"arrange(df, query)","anchor":"arrange/2"},{"id":"arrange_with/2","deprecated":false,"title":"arrange_with(df, fun)","anchor":"arrange_with/2"},{"id":"describe/2","deprecated":false,"title":"describe(df, opts \\\\ [])","anchor":"describe/2"},{"id":"discard/2","deprecated":false,"title":"discard(df, columns_or_column)","anchor":"discard/2"},{"id":"distinct/3","deprecated":false,"title":"distinct(df, columns \\\\ 0..-1//1, opts \\\\ [])","anchor":"distinct/3"},{"id":"drop_nil/2","deprecated":false,"title":"drop_nil(df, columns_or_column \\\\ 0..-1//1)","anchor":"drop_nil/2"},{"id":"dummies/2","deprecated":false,"title":"dummies(df, columns_or_column)","anchor":"dummies/2"},{"id":"filter/2","deprecated":false,"title":"filter(df, query)","anchor":"filter/2"},{"id":"filter_with/2","deprecated":false,"title":"filter_with(df, fun)","anchor":"filter_with/2"},{"id":"frequencies/2","deprecated":false,"title":"frequencies(df, columns)","anchor":"frequencies/2"},{"id":"group_by/2","deprecated":false,"title":"group_by(df, group)","anchor":"group_by/2"},{"id":"mask/2","deprecated":false,"title":"mask(df, mask)","anchor":"mask/2"},{"id":"mutate/2","deprecated":false,"title":"mutate(df, mutations)","anchor":"mutate/2"},{"id":"mutate_with/2","deprecated":false,"title":"mutate_with(df, fun)","anchor":"mutate_with/2"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(df)","anchor":"nil_count/1"},{"id":"pivot_longer/3","deprecated":false,"title":"pivot_longer(df, columns_to_pivot, opts \\\\ [])","anchor":"pivot_longer/3"},{"id":"pivot_wider/4","deprecated":false,"title":"pivot_wider(df, names_from, values_from, opts \\\\ [])","anchor":"pivot_wider/4"},{"id":"pull/2","deprecated":false,"title":"pull(df, column)","anchor":"pull/2"},{"id":"put/4","deprecated":false,"title":"put(df, column_name, series_or_tensor_or_list, opts \\\\ [])","anchor":"put/4"},{"id":"relocate/3","deprecated":false,"title":"relocate(df, columns_or_column, opts)","anchor":"relocate/3"},{"id":"rename/2","deprecated":false,"title":"rename(df, names)","anchor":"rename/2"},{"id":"rename_with/3","deprecated":false,"title":"rename_with(df, columns \\\\ 0..-1//1, callback)","anchor":"rename_with/3"},{"id":"select/2","deprecated":false,"title":"select(df, columns_or_column)","anchor":"select/2"},{"id":"summarise/2","deprecated":false,"title":"summarise(df, query)","anchor":"summarise/2"},{"id":"summarise_with/2","deprecated":false,"title":"summarise_with(df, fun)","anchor":"summarise_with/2"},{"id":"ungroup/2","deprecated":false,"title":"ungroup(df, groups \\\\ 0..-1//1)","anchor":"ungroup/2"}],"key":"functions-single-table"},{"name":"Functions: Multi-table","nodes":[{"id":"concat_columns/1","deprecated":false,"title":"concat_columns(dfs)","anchor":"concat_columns/1"},{"id":"concat_columns/2","deprecated":false,"title":"concat_columns(df1, df2)","anchor":"concat_columns/2"},{"id":"concat_rows/1","deprecated":false,"title":"concat_rows(dfs)","anchor":"concat_rows/1"},{"id":"concat_rows/2","deprecated":false,"title":"concat_rows(df1, df2)","anchor":"concat_rows/2"},{"id":"join/3","deprecated":false,"title":"join(left, right, opts \\\\ [])","anchor":"join/3"}],"key":"functions-multi-table"},{"name":"Functions: Row-based","nodes":[{"id":"head/2","deprecated":false,"title":"head(df, nrows \\\\ 5)","anchor":"head/2"},{"id":"sample/3","deprecated":false,"title":"sample(df, n_or_frac, opts \\\\ [])","anchor":"sample/3"},{"id":"shuffle/2","deprecated":false,"title":"shuffle(df, opts \\\\ [])","anchor":"shuffle/2"},{"id":"slice/2","deprecated":false,"title":"slice(df, row_indices)","anchor":"slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(df, offset, length)","anchor":"slice/3"},{"id":"tail/2","deprecated":false,"title":"tail(df, nrows \\\\ 5)","anchor":"tail/2"}],"key":"functions-row-based"},{"name":"Functions: Introspection","nodes":[{"id":"dtypes/1","deprecated":false,"title":"dtypes(df)","anchor":"dtypes/1"},{"id":"groups/1","deprecated":false,"title":"groups(data_frame)","anchor":"groups/1"},{"id":"n_columns/1","deprecated":false,"title":"n_columns(df)","anchor":"n_columns/1"},{"id":"n_rows/1","deprecated":false,"title":"n_rows(df)","anchor":"n_rows/1"},{"id":"names/1","deprecated":false,"title":"names(df)","anchor":"names/1"},{"id":"shape/1","deprecated":false,"title":"shape(df)","anchor":"shape/1"}],"key":"functions-introspection"},{"name":"Functions: IO","nodes":[{"id":"dump_csv/2","deprecated":false,"title":"dump_csv(df, opts \\\\ [])","anchor":"dump_csv/2"},{"id":"dump_csv!/2","deprecated":false,"title":"dump_csv!(df, opts \\\\ [])","anchor":"dump_csv!/2"},{"id":"dump_ipc/2","deprecated":false,"title":"dump_ipc(df, opts \\\\ [])","anchor":"dump_ipc/2"},{"id":"dump_ipc!/2","deprecated":false,"title":"dump_ipc!(df, opts \\\\ [])","anchor":"dump_ipc!/2"},{"id":"dump_ipc_stream/2","deprecated":false,"title":"dump_ipc_stream(df, opts \\\\ [])","anchor":"dump_ipc_stream/2"},{"id":"dump_ipc_stream!/2","deprecated":false,"title":"dump_ipc_stream!(df, opts \\\\ [])","anchor":"dump_ipc_stream!/2"},{"id":"dump_ndjson/1","deprecated":false,"title":"dump_ndjson(df)","anchor":"dump_ndjson/1"},{"id":"dump_ndjson!/1","deprecated":false,"title":"dump_ndjson!(df)","anchor":"dump_ndjson!/1"},{"id":"dump_parquet/2","deprecated":false,"title":"dump_parquet(df, opts \\\\ [])","anchor":"dump_parquet/2"},{"id":"dump_parquet!/2","deprecated":false,"title":"dump_parquet!(df, opts \\\\ [])","anchor":"dump_parquet!/2"},{"id":"from_csv/2","deprecated":false,"title":"from_csv(filename, opts \\\\ [])","anchor":"from_csv/2"},{"id":"from_csv!/2","deprecated":false,"title":"from_csv!(filename, opts \\\\ [])","anchor":"from_csv!/2"},{"id":"from_ipc/2","deprecated":false,"title":"from_ipc(filename, opts \\\\ [])","anchor":"from_ipc/2"},{"id":"from_ipc!/2","deprecated":false,"title":"from_ipc!(filename, opts \\\\ [])","anchor":"from_ipc!/2"},{"id":"from_ipc_stream/2","deprecated":false,"title":"from_ipc_stream(filename, opts \\\\ [])","anchor":"from_ipc_stream/2"},{"id":"from_ipc_stream!/2","deprecated":false,"title":"from_ipc_stream!(filename, opts \\\\ [])","anchor":"from_ipc_stream!/2"},{"id":"from_ndjson/2","deprecated":false,"title":"from_ndjson(filename, opts \\\\ [])","anchor":"from_ndjson/2"},{"id":"from_ndjson!/2","deprecated":false,"title":"from_ndjson!(filename, opts \\\\ [])","anchor":"from_ndjson!/2"},{"id":"from_parquet/2","deprecated":false,"title":"from_parquet(filename, opts \\\\ [])","anchor":"from_parquet/2"},{"id":"from_parquet!/2","deprecated":false,"title":"from_parquet!(filename, opts \\\\ [])","anchor":"from_parquet!/2"},{"id":"from_query/4","deprecated":false,"title":"from_query(conn, query, params, opts \\\\ [])","anchor":"from_query/4"},{"id":"from_query!/4","deprecated":false,"title":"from_query!(conn, query, params, opts \\\\ [])","anchor":"from_query!/4"},{"id":"load_csv/2","deprecated":false,"title":"load_csv(contents, opts \\\\ [])","anchor":"load_csv/2"},{"id":"load_csv!/2","deprecated":false,"title":"load_csv!(contents, opts \\\\ [])","anchor":"load_csv!/2"},{"id":"load_ipc/2","deprecated":false,"title":"load_ipc(contents, opts \\\\ [])","anchor":"load_ipc/2"},{"id":"load_ipc!/2","deprecated":false,"title":"load_ipc!(contents, opts \\\\ [])","anchor":"load_ipc!/2"},{"id":"load_ipc_stream/2","deprecated":false,"title":"load_ipc_stream(contents, opts \\\\ [])","anchor":"load_ipc_stream/2"},{"id":"load_ipc_stream!/2","deprecated":false,"title":"load_ipc_stream!(contents, opts \\\\ [])","anchor":"load_ipc_stream!/2"},{"id":"load_ndjson/2","deprecated":false,"title":"load_ndjson(contents, opts \\\\ [])","anchor":"load_ndjson/2"},{"id":"load_ndjson!/2","deprecated":false,"title":"load_ndjson!(contents, opts \\\\ [])","anchor":"load_ndjson!/2"},{"id":"load_parquet/2","deprecated":false,"title":"load_parquet(contents, opts \\\\ [])","anchor":"load_parquet/2"},{"id":"load_parquet!/2","deprecated":false,"title":"load_parquet!(contents, opts \\\\ [])","anchor":"load_parquet!/2"},{"id":"to_csv/3","deprecated":false,"title":"to_csv(df, filename, opts \\\\ [])","anchor":"to_csv/3"},{"id":"to_csv!/3","deprecated":false,"title":"to_csv!(df, filename, opts \\\\ [])","anchor":"to_csv!/3"},{"id":"to_ipc/3","deprecated":false,"title":"to_ipc(df, filename, opts \\\\ [])","anchor":"to_ipc/3"},{"id":"to_ipc!/3","deprecated":false,"title":"to_ipc!(df, filename, opts \\\\ [])","anchor":"to_ipc!/3"},{"id":"to_ipc_stream/3","deprecated":false,"title":"to_ipc_stream(df, filename, opts \\\\ [])","anchor":"to_ipc_stream/3"},{"id":"to_ipc_stream!/3","deprecated":false,"title":"to_ipc_stream!(df, filename, opts \\\\ [])","anchor":"to_ipc_stream!/3"},{"id":"to_ndjson/3","deprecated":false,"title":"to_ndjson(df, filename, opts \\\\ [])","anchor":"to_ndjson/3"},{"id":"to_ndjson!/3","deprecated":false,"title":"to_ndjson!(df, filename, opts \\\\ [])","anchor":"to_ndjson!/3"},{"id":"to_parquet/3","deprecated":false,"title":"to_parquet(df, filename, opts \\\\ [])","anchor":"to_parquet/3"},{"id":"to_parquet!/3","deprecated":false,"title":"to_parquet!(df, filename, opts \\\\ [])","anchor":"to_parquet!/3"}],"key":"functions-io"}]},{"id":"Explorer.Datasets","deprecated":false,"group":"","title":"Explorer.Datasets","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"fossil_fuels/0","deprecated":false,"title":"fossil_fuels()","anchor":"fossil_fuels/0"},{"id":"iris/0","deprecated":false,"title":"iris()","anchor":"iris/0"},{"id":"wine/0","deprecated":false,"title":"wine()","anchor":"wine/0"}],"key":"functions"}]},{"id":"Explorer.Query","deprecated":false,"group":"","title":"Explorer.Query","sections":[{"id":"Supported operations","anchor":"module-supported-operations"},{"id":"Interpolation","anchor":"module-interpolation"},{"id":"Across and comprehensions","anchor":"module-across-and-comprehensions"},{"id":"Implementation details","anchor":"module-implementation-details"}],"nodeGroups":[{"name":"Functions","nodes":[{"id":"**/2","deprecated":false,"title":"left ** right","anchor":"**/2"},{"id":"*/2","deprecated":false,"title":"left * right","anchor":"*/2"},{"id":"+/1","deprecated":false,"title":"+number","anchor":"+/1"},{"id":"+/2","deprecated":false,"title":"left + right","anchor":"+/2"},{"id":"-/1","deprecated":false,"title":"-number","anchor":"-/1"},{"id":"-/2","deprecated":false,"title":"left - right","anchor":"-/2"},{"id":"//2","deprecated":false,"title":"left / right","anchor":"//2"},{"id":"!=/2","deprecated":false,"title":"left != right","anchor":"!=/2"},{"id":"/2","deprecated":false,"title":"left <> right","anchor":"%3C%3E/2"},{"id":"==/2","deprecated":false,"title":"left == right","anchor":"==/2"},{"id":">/2","deprecated":false,"title":"left > right","anchor":"%3E/2"},{"id":">=/2","deprecated":false,"title":"left >= right","anchor":"%3E=/2"},{"id":"across/0","deprecated":false,"title":"across()","anchor":"across/0"},{"id":"across/1","deprecated":false,"title":"across(selector)","anchor":"across/1"},{"id":"col/1","deprecated":false,"title":"col(name)","anchor":"col/1"},{"id":"query/1","deprecated":false,"title":"query(expression)","anchor":"query/1"}],"key":"functions"}]},{"id":"Explorer.Series","deprecated":false,"group":"","title":"Explorer.Series","sections":[{"id":"Creating series","anchor":"module-creating-series"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"datetime_dtype/0","deprecated":false,"title":"datetime_dtype()","anchor":"t:datetime_dtype/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"inferable_scalar/0","deprecated":false,"title":"inferable_scalar()","anchor":"t:inferable_scalar/0"},{"id":"lazy_t/0","deprecated":false,"title":"lazy_t()","anchor":"t:lazy_t/0"},{"id":"non_finite/0","deprecated":false,"title":"non_finite()","anchor":"t:non_finite/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions: Conversion","nodes":[{"id":"from_binary/3","deprecated":false,"title":"from_binary(binary, dtype, opts \\\\ [])","anchor":"from_binary/3"},{"id":"from_list/2","deprecated":false,"title":"from_list(list, opts \\\\ [])","anchor":"from_list/2"},{"id":"from_tensor/2","deprecated":false,"title":"from_tensor(tensor, opts \\\\ [])","anchor":"from_tensor/2"},{"id":"replace/2","deprecated":false,"title":"replace(series, tensor_or_list)","anchor":"replace/2"},{"id":"to_binary/1","deprecated":false,"title":"to_binary(series)","anchor":"to_binary/1"},{"id":"to_enum/1","deprecated":false,"title":"to_enum(series)","anchor":"to_enum/1"},{"id":"to_iovec/1","deprecated":false,"title":"to_iovec(series)","anchor":"to_iovec/1"},{"id":"to_list/1","deprecated":false,"title":"to_list(series)","anchor":"to_list/1"},{"id":"to_tensor/2","deprecated":false,"title":"to_tensor(series, tensor_opts \\\\ [])","anchor":"to_tensor/2"}],"key":"functions-conversion"},{"name":"Functions: Aggregation","nodes":[{"id":"argmax/1","deprecated":false,"title":"argmax(series)","anchor":"argmax/1"},{"id":"argmin/1","deprecated":false,"title":"argmin(series)","anchor":"argmin/1"},{"id":"correlation/3","deprecated":false,"title":"correlation(left, right, ddof \\\\ 1)","anchor":"correlation/3"},{"id":"count/1","deprecated":false,"title":"count(series)","anchor":"count/1"},{"id":"covariance/2","deprecated":false,"title":"covariance(left, right)","anchor":"covariance/2"},{"id":"cut/3","deprecated":false,"title":"cut(series, bins, opts \\\\ [])","anchor":"cut/3"},{"id":"frequencies/1","deprecated":false,"title":"frequencies(series)","anchor":"frequencies/1"},{"id":"max/1","deprecated":false,"title":"max(series)","anchor":"max/1"},{"id":"mean/1","deprecated":false,"title":"mean(series)","anchor":"mean/1"},{"id":"median/1","deprecated":false,"title":"median(series)","anchor":"median/1"},{"id":"min/1","deprecated":false,"title":"min(series)","anchor":"min/1"},{"id":"n_distinct/1","deprecated":false,"title":"n_distinct(series)","anchor":"n_distinct/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(series)","anchor":"nil_count/1"},{"id":"product/1","deprecated":false,"title":"product(series)","anchor":"product/1"},{"id":"qcut/3","deprecated":false,"title":"qcut(series, quantiles, opts \\\\ [])","anchor":"qcut/3"},{"id":"quantile/2","deprecated":false,"title":"quantile(series, quantile)","anchor":"quantile/2"},{"id":"skew/2","deprecated":false,"title":"skew(series, opts \\\\ [])","anchor":"skew/2"},{"id":"standard_deviation/1","deprecated":false,"title":"standard_deviation(series)","anchor":"standard_deviation/1"},{"id":"sum/1","deprecated":false,"title":"sum(series)","anchor":"sum/1"},{"id":"variance/1","deprecated":false,"title":"variance(series)","anchor":"variance/1"}],"key":"functions-aggregation"},{"name":"Functions: Element-wise","nodes":[{"id":"abs/1","deprecated":false,"title":"abs(series)","anchor":"abs/1"},{"id":"add/2","deprecated":false,"title":"add(left, right)","anchor":"add/2"},{"id":"all_equal/2","deprecated":false,"title":"all_equal(left, right)","anchor":"all_equal/2"},{"id":"and/2","deprecated":false,"title":"left and right","anchor":"and/2"},{"id":"cast/2","deprecated":false,"title":"cast(series, dtype)","anchor":"cast/2"},{"id":"categorise/2","deprecated":false,"title":"categorise(series, categories)","anchor":"categorise/2"},{"id":"clip/3","deprecated":false,"title":"clip(series, min, max)","anchor":"clip/3"},{"id":"coalesce/1","deprecated":false,"title":"coalesce(list)","anchor":"coalesce/1"},{"id":"coalesce/2","deprecated":false,"title":"coalesce(s1, s2)","anchor":"coalesce/2"},{"id":"divide/2","deprecated":false,"title":"divide(left, right)","anchor":"divide/2"},{"id":"equal/2","deprecated":false,"title":"equal(left, right)","anchor":"equal/2"},{"id":"exp/1","deprecated":false,"title":"exp(s)","anchor":"exp/1"},{"id":"greater/2","deprecated":false,"title":"greater(left, right)","anchor":"greater/2"},{"id":"greater_equal/2","deprecated":false,"title":"greater_equal(left, right)","anchor":"greater_equal/2"},{"id":"in/2","deprecated":false,"title":"left in right","anchor":"in/2"},{"id":"is_nil/1","deprecated":false,"title":"is_nil(series)","anchor":"is_nil/1"},{"id":"is_not_nil/1","deprecated":false,"title":"is_not_nil(series)","anchor":"is_not_nil/1"},{"id":"less/2","deprecated":false,"title":"less(left, right)","anchor":"less/2"},{"id":"less_equal/2","deprecated":false,"title":"less_equal(left, right)","anchor":"less_equal/2"},{"id":"log/1","deprecated":false,"title":"log(s)","anchor":"log/1"},{"id":"log/2","deprecated":false,"title":"log(argument, base)","anchor":"log/2"},{"id":"mask/2","deprecated":false,"title":"mask(series, mask)","anchor":"mask/2"},{"id":"multiply/2","deprecated":false,"title":"multiply(left, right)","anchor":"multiply/2"},{"id":"not/1","deprecated":false,"title":"not series","anchor":"not/1"},{"id":"not_equal/2","deprecated":false,"title":"not_equal(left, right)","anchor":"not_equal/2"},{"id":"or/2","deprecated":false,"title":"left or right","anchor":"or/2"},{"id":"peaks/2","deprecated":false,"title":"peaks(series, max_or_min \\\\ :max)","anchor":"peaks/2"},{"id":"pow/2","deprecated":false,"title":"pow(left, right)","anchor":"pow/2"},{"id":"quotient/2","deprecated":false,"title":"quotient(left, right)","anchor":"quotient/2"},{"id":"rank/2","deprecated":false,"title":"rank(series, opts \\\\ [])","anchor":"rank/2"},{"id":"remainder/2","deprecated":false,"title":"remainder(left, right)","anchor":"remainder/2"},{"id":"select/3","deprecated":false,"title":"select(predicate, on_true, on_false)","anchor":"select/3"},{"id":"strftime/2","deprecated":false,"title":"strftime(series, format_string)","anchor":"strftime/2"},{"id":"strptime/2","deprecated":false,"title":"strptime(series, format_string)","anchor":"strptime/2"},{"id":"subtract/2","deprecated":false,"title":"subtract(left, right)","anchor":"subtract/2"},{"id":"transform/2","deprecated":false,"title":"transform(series, fun)","anchor":"transform/2"}],"key":"functions-element-wise"},{"name":"Functions: Datetime ops","nodes":[{"id":"day_of_week/1","deprecated":false,"title":"day_of_week(series)","anchor":"day_of_week/1"},{"id":"hour/1","deprecated":false,"title":"hour(series)","anchor":"hour/1"},{"id":"minute/1","deprecated":false,"title":"minute(series)","anchor":"minute/1"},{"id":"month/1","deprecated":false,"title":"month(series)","anchor":"month/1"},{"id":"second/1","deprecated":false,"title":"second(series)","anchor":"second/1"},{"id":"year/1","deprecated":false,"title":"year(series)","anchor":"year/1"}],"key":"functions-datetime-ops"},{"name":"Functions: Float ops","nodes":[{"id":"acos/1","deprecated":false,"title":"acos(series)","anchor":"acos/1"},{"id":"asin/1","deprecated":false,"title":"asin(series)","anchor":"asin/1"},{"id":"atan/1","deprecated":false,"title":"atan(series)","anchor":"atan/1"},{"id":"ceil/1","deprecated":false,"title":"ceil(series)","anchor":"ceil/1"},{"id":"cos/1","deprecated":false,"title":"cos(series)","anchor":"cos/1"},{"id":"floor/1","deprecated":false,"title":"floor(series)","anchor":"floor/1"},{"id":"is_finite/1","deprecated":false,"title":"is_finite(series)","anchor":"is_finite/1"},{"id":"is_infinite/1","deprecated":false,"title":"is_infinite(series)","anchor":"is_infinite/1"},{"id":"is_nan/1","deprecated":false,"title":"is_nan(series)","anchor":"is_nan/1"},{"id":"round/2","deprecated":false,"title":"round(series, decimals)","anchor":"round/2"},{"id":"sin/1","deprecated":false,"title":"sin(series)","anchor":"sin/1"},{"id":"tan/1","deprecated":false,"title":"tan(series)","anchor":"tan/1"}],"key":"functions-float-ops"},{"name":"Functions: String ops","nodes":[{"id":"contains/2","deprecated":false,"title":"contains(series, pattern)","anchor":"contains/2"},{"id":"downcase/1","deprecated":false,"title":"downcase(series)","anchor":"downcase/1"},{"id":"lstrip/1","deprecated":false,"title":"lstrip(series)","anchor":"lstrip/1"},{"id":"lstrip/2","deprecated":false,"title":"lstrip(series, string)","anchor":"lstrip/2"},{"id":"rstrip/1","deprecated":false,"title":"rstrip(series)","anchor":"rstrip/1"},{"id":"rstrip/2","deprecated":false,"title":"rstrip(series, string)","anchor":"rstrip/2"},{"id":"strip/1","deprecated":false,"title":"strip(series)","anchor":"strip/1"},{"id":"strip/2","deprecated":false,"title":"strip(series, string)","anchor":"strip/2"},{"id":"substring/2","deprecated":false,"title":"substring(series, offset)","anchor":"substring/2"},{"id":"substring/3","deprecated":false,"title":"substring(series, offset, length)","anchor":"substring/3"},{"id":"upcase/1","deprecated":false,"title":"upcase(series)","anchor":"upcase/1"}],"key":"functions-string-ops"},{"name":"Functions: Introspection","nodes":[{"id":"categories/1","deprecated":false,"title":"categories(series)","anchor":"categories/1"},{"id":"dtype/1","deprecated":false,"title":"dtype(series)","anchor":"dtype/1"},{"id":"iotype/1","deprecated":false,"title":"iotype(series)","anchor":"iotype/1"},{"id":"size/1","deprecated":false,"title":"size(series)","anchor":"size/1"}],"key":"functions-introspection"},{"name":"Functions: Shape","nodes":[{"id":"argsort/2","deprecated":false,"title":"argsort(series, opts \\\\ [])","anchor":"argsort/2"},{"id":"at/2","deprecated":false,"title":"at(series, idx)","anchor":"at/2"},{"id":"at_every/2","deprecated":false,"title":"at_every(series, every_n)","anchor":"at_every/2"},{"id":"concat/1","deprecated":false,"title":"concat(series)","anchor":"concat/1"},{"id":"concat/2","deprecated":false,"title":"concat(s1, s2)","anchor":"concat/2"},{"id":"distinct/1","deprecated":false,"title":"distinct(series)","anchor":"distinct/1"},{"id":"first/1","deprecated":false,"title":"first(series)","anchor":"first/1"},{"id":"format/1","deprecated":false,"title":"format(list)","anchor":"format/1"},{"id":"head/2","deprecated":false,"title":"head(series, n_elements \\\\ 10)","anchor":"head/2"},{"id":"last/1","deprecated":false,"title":"last(series)","anchor":"last/1"},{"id":"reverse/1","deprecated":false,"title":"reverse(series)","anchor":"reverse/1"},{"id":"sample/3","deprecated":false,"title":"sample(series, n_or_frac, opts \\\\ [])","anchor":"sample/3"},{"id":"shift/2","deprecated":false,"title":"shift(series, offset)","anchor":"shift/2"},{"id":"shuffle/2","deprecated":false,"title":"shuffle(series, opts \\\\ [])","anchor":"shuffle/2"},{"id":"slice/2","deprecated":false,"title":"slice(series, indices)","anchor":"slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(series, offset, size)","anchor":"slice/3"},{"id":"sort/2","deprecated":false,"title":"sort(series, opts \\\\ [])","anchor":"sort/2"},{"id":"tail/2","deprecated":false,"title":"tail(series, n_elements \\\\ 10)","anchor":"tail/2"},{"id":"unordered_distinct/1","deprecated":false,"title":"unordered_distinct(series)","anchor":"unordered_distinct/1"}],"key":"functions-shape"},{"name":"Functions: Window","nodes":[{"id":"cumulative_max/2","deprecated":false,"title":"cumulative_max(series, opts \\\\ [])","anchor":"cumulative_max/2"},{"id":"cumulative_min/2","deprecated":false,"title":"cumulative_min(series, opts \\\\ [])","anchor":"cumulative_min/2"},{"id":"cumulative_product/2","deprecated":false,"title":"cumulative_product(series, opts \\\\ [])","anchor":"cumulative_product/2"},{"id":"cumulative_sum/2","deprecated":false,"title":"cumulative_sum(series, opts \\\\ [])","anchor":"cumulative_sum/2"},{"id":"ewm_mean/2","deprecated":false,"title":"ewm_mean(series, opts \\\\ [])","anchor":"ewm_mean/2"},{"id":"fill_missing/2","deprecated":false,"title":"fill_missing(series, value)","anchor":"fill_missing/2"},{"id":"window_max/3","deprecated":false,"title":"window_max(series, window_size, opts \\\\ [])","anchor":"window_max/3"},{"id":"window_mean/3","deprecated":false,"title":"window_mean(series, window_size, opts \\\\ [])","anchor":"window_mean/3"},{"id":"window_median/3","deprecated":false,"title":"window_median(series, window_size, opts \\\\ [])","anchor":"window_median/3"},{"id":"window_min/3","deprecated":false,"title":"window_min(series, window_size, opts \\\\ [])","anchor":"window_min/3"},{"id":"window_standard_deviation/3","deprecated":false,"title":"window_standard_deviation(series, window_size, opts \\\\ [])","anchor":"window_standard_deviation/3"},{"id":"window_sum/3","deprecated":false,"title":"window_sum(series, window_size, opts \\\\ [])","anchor":"window_sum/3"}],"key":"functions-window"},{"name":"Functions","nodes":[{"id":"to_date/1","deprecated":true,"title":"to_date(series)","anchor":"to_date/1"},{"id":"to_time/1","deprecated":true,"title":"to_time(series)","anchor":"to_time/1"}],"key":"functions"}]},{"id":"Explorer.TensorFrame","deprecated":false,"group":"","title":"Explorer.TensorFrame","sections":[{"id":"Stack and concatenating","anchor":"module-stack-and-concatenating"},{"id":"Warning: returning TensorFrames","anchor":"module-warning-returning-tensorframes"},{"id":"Supported dtypes","anchor":"module-supported-dtypes"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions","nodes":[{"id":"pull/2","deprecated":false,"title":"pull(tf, name)","anchor":"pull/2"},{"id":"put/3","deprecated":false,"title":"put(tf, name, tensor)","anchor":"put/3"}],"key":"functions"}]},{"id":"FSS","deprecated":false,"group":"","title":"FSS","sections":[]},{"id":"FSS.HTTP","deprecated":false,"group":"","title":"FSS.HTTP","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"parse/2","deprecated":false,"title":"parse(url, opts \\\\ [])","anchor":"parse/2"}],"key":"functions"}]},{"id":"FSS.HTTP.Config","deprecated":false,"group":"","title":"FSS.HTTP.Config","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"FSS.HTTP.Entry","deprecated":false,"group":"","title":"FSS.HTTP.Entry","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"FSS.Local","deprecated":false,"group":"","title":"FSS.Local","sections":[]},{"id":"FSS.Local.Entry","deprecated":false,"group":"","title":"FSS.Local.Entry","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"FSS.S3","deprecated":false,"group":"","title":"FSS.S3","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"config_from_system_env/0","deprecated":false,"title":"config_from_system_env()","anchor":"config_from_system_env/0"}],"key":"functions"}]},{"id":"FSS.S3.Config","deprecated":false,"group":"","title":"FSS.S3.Config","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"FSS.S3.Entry","deprecated":false,"group":"","title":"FSS.S3.Entry","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions","nodes":[{"id":"check!/3","deprecated":false,"title":"check!(config, key, env)","anchor":"check!/3"},{"id":"parse/2","deprecated":false,"title":"parse(url, opts \\\\ [])","anchor":"parse/2"}],"key":"functions"}]},{"id":"Explorer.Backend","deprecated":false,"group":"Backends","title":"Explorer.Backend","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"get/0","deprecated":false,"title":"get()","anchor":"get/0"},{"id":"put/1","deprecated":false,"title":"put(backend)","anchor":"put/1"}],"key":"functions"}]},{"id":"Explorer.Backend.DataFrame","deprecated":false,"group":"Backends","title":"Explorer.Backend.DataFrame","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"basic_types/0","deprecated":false,"title":"basic_types()","anchor":"t:basic_types/0"},{"id":"column_name/0","deprecated":false,"title":"column_name()","anchor":"t:column_name/0"},{"id":"columns_for_io/0","deprecated":false,"title":"columns_for_io()","anchor":"t:columns_for_io/0"},{"id":"compression/0","deprecated":false,"title":"compression()","anchor":"t:compression/0"},{"id":"df/0","deprecated":false,"title":"df()","anchor":"t:df/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"dtypes/0","deprecated":false,"title":"dtypes()","anchor":"t:dtypes/0"},{"id":"fs_entry/0","deprecated":false,"title":"fs_entry()","anchor":"t:fs_entry/0"},{"id":"lazy_frame/0","deprecated":false,"title":"lazy_frame()","anchor":"t:lazy_frame/0"},{"id":"lazy_series/0","deprecated":false,"title":"lazy_series()","anchor":"t:lazy_series/0"},{"id":"mutate_value/0","deprecated":false,"title":"mutate_value()","anchor":"t:mutate_value/0"},{"id":"ok_result/0","deprecated":false,"title":"ok_result()","anchor":"t:ok_result/0"},{"id":"option/1","deprecated":false,"title":"option(type)","anchor":"t:option/1"},{"id":"result/1","deprecated":false,"title":"result(t)","anchor":"t:result/1"},{"id":"series/0","deprecated":false,"title":"series()","anchor":"t:series/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Callbacks","nodes":[{"id":"arrange_with/3","deprecated":false,"title":"arrange_with(df, out_df, directions)","anchor":"c:arrange_with/3"},{"id":"collect/1","deprecated":false,"title":"collect(df)","anchor":"c:collect/1"},{"id":"concat_columns/2","deprecated":false,"title":"concat_columns(list, out_df)","anchor":"c:concat_columns/2"},{"id":"concat_rows/2","deprecated":false,"title":"concat_rows(list, out_df)","anchor":"c:concat_rows/2"},{"id":"describe/2","deprecated":false,"title":"describe(df, percentiles)","anchor":"c:describe/2"},{"id":"distinct/3","deprecated":false,"title":"distinct(df, out_df, columns)","anchor":"c:distinct/3"},{"id":"drop_nil/2","deprecated":false,"title":"drop_nil(df, columns)","anchor":"c:drop_nil/2"},{"id":"dummies/3","deprecated":false,"title":"dummies(df, out_df, columns)","anchor":"c:dummies/3"},{"id":"dump_csv/3","deprecated":false,"title":"dump_csv(df, header?, delimiter)","anchor":"c:dump_csv/3"},{"id":"dump_ipc/2","deprecated":false,"title":"dump_ipc(df, compression)","anchor":"c:dump_ipc/2"},{"id":"dump_ipc_stream/2","deprecated":false,"title":"dump_ipc_stream(df, compression)","anchor":"c:dump_ipc_stream/2"},{"id":"dump_ndjson/1","deprecated":false,"title":"dump_ndjson(df)","anchor":"c:dump_ndjson/1"},{"id":"dump_parquet/2","deprecated":false,"title":"dump_parquet(df, compression)","anchor":"c:dump_parquet/2"},{"id":"filter_with/3","deprecated":false,"title":"filter_with(df, out_df, lazy_series)","anchor":"c:filter_with/3"},{"id":"from_csv/12","deprecated":false,"title":"from_csv(\n entry,\n dtypes,\n delimiter,\n nil_values,\n skip_rows,\n header?,\n encoding,\n max_rows,\n columns,\n infer_schema_length,\n parse_dates,\n eol_delimiter\n)","anchor":"c:from_csv/12"},{"id":"from_ipc/2","deprecated":false,"title":"from_ipc(entry, columns)","anchor":"c:from_ipc/2"},{"id":"from_ipc_stream/2","deprecated":false,"title":"from_ipc_stream(filename, columns)","anchor":"c:from_ipc_stream/2"},{"id":"from_ndjson/3","deprecated":false,"title":"from_ndjson(filename, infer_schema_length, batch_size)","anchor":"c:from_ndjson/3"},{"id":"from_parquet/3","deprecated":false,"title":"from_parquet(entry, max_rows, columns)","anchor":"c:from_parquet/3"},{"id":"from_query/3","deprecated":false,"title":"from_query(t, query, params)","anchor":"c:from_query/3"},{"id":"from_series/1","deprecated":false,"title":"from_series(list)","anchor":"c:from_series/1"},{"id":"from_tabular/2","deprecated":false,"title":"from_tabular(t, dtypes)","anchor":"c:from_tabular/2"},{"id":"head/2","deprecated":false,"title":"head(df, rows)","anchor":"c:head/2"},{"id":"inspect/2","deprecated":false,"title":"inspect(df, opts)","anchor":"c:inspect/2"},{"id":"join/5","deprecated":false,"title":"join(left, right, out_df, on, how)","anchor":"c:join/5"},{"id":"lazy/0","deprecated":false,"title":"lazy()","anchor":"c:lazy/0"},{"id":"load_csv/12","deprecated":false,"title":"load_csv(\n contents,\n dtypes,\n delimiter,\n nil_values,\n skip_rows,\n header?,\n encoding,\n max_rows,\n columns,\n infer_schema_length,\n parse_dates,\n eol_delimiter\n)","anchor":"c:load_csv/12"},{"id":"load_ipc/2","deprecated":false,"title":"load_ipc(contents, columns)","anchor":"c:load_ipc/2"},{"id":"load_ipc_stream/2","deprecated":false,"title":"load_ipc_stream(contents, columns)","anchor":"c:load_ipc_stream/2"},{"id":"load_ndjson/3","deprecated":false,"title":"load_ndjson(contents, infer_schema_length, batch_size)","anchor":"c:load_ndjson/3"},{"id":"load_parquet/1","deprecated":false,"title":"load_parquet(contents)","anchor":"c:load_parquet/1"},{"id":"mask/2","deprecated":false,"title":"mask(df, mask)","anchor":"c:mask/2"},{"id":"mutate_with/3","deprecated":false,"title":"mutate_with(df, out_df, mutations)","anchor":"c:mutate_with/3"},{"id":"n_rows/1","deprecated":false,"title":"n_rows(df)","anchor":"c:n_rows/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(df)","anchor":"c:nil_count/1"},{"id":"pivot_longer/6","deprecated":false,"title":"pivot_longer(df, out_df, columns_to_pivot, columns_to_keep, names_to, values_to)","anchor":"c:pivot_longer/6"},{"id":"pivot_wider/5","deprecated":false,"title":"pivot_wider(df, id_columns, names_from, values_from, names_prefix)","anchor":"c:pivot_wider/5"},{"id":"pull/2","deprecated":false,"title":"pull(df, column)","anchor":"c:pull/2"},{"id":"put/4","deprecated":false,"title":"put(df, out_df, column_name, series)","anchor":"c:put/4"},{"id":"rename/3","deprecated":false,"title":"rename(df, out_df, list)","anchor":"c:rename/3"},{"id":"sample/5","deprecated":false,"title":"sample(df, n_or_frac, replace, shuffle, seed)","anchor":"c:sample/5"},{"id":"select/2","deprecated":false,"title":"select(df, out_df)","anchor":"c:select/2"},{"id":"slice/2","deprecated":false,"title":"slice(df, indices)","anchor":"c:slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(df, offset, length)","anchor":"c:slice/3"},{"id":"summarise_with/3","deprecated":false,"title":"summarise_with(df, out_df, aggregations)","anchor":"c:summarise_with/3"},{"id":"tail/2","deprecated":false,"title":"tail(df, rows)","anchor":"c:tail/2"},{"id":"to_csv/4","deprecated":false,"title":"to_csv(df, entry, header?, delimiter)","anchor":"c:to_csv/4"},{"id":"to_ipc/4","deprecated":false,"title":"to_ipc(df, entry, compression, streaming)","anchor":"c:to_ipc/4"},{"id":"to_ipc_stream/3","deprecated":false,"title":"to_ipc_stream(df, entry, compression)","anchor":"c:to_ipc_stream/3"},{"id":"to_lazy/1","deprecated":false,"title":"to_lazy(df)","anchor":"c:to_lazy/1"},{"id":"to_ndjson/2","deprecated":false,"title":"to_ndjson(df, entry)","anchor":"c:to_ndjson/2"},{"id":"to_parquet/4","deprecated":false,"title":"to_parquet(df, entry, compression, streaming)","anchor":"c:to_parquet/4"},{"id":"to_rows/2","deprecated":false,"title":"to_rows(df, atom_keys?)","anchor":"c:to_rows/2"},{"id":"to_rows_stream/3","deprecated":false,"title":"to_rows_stream(df, atom_keys?, chunk_size)","anchor":"c:to_rows_stream/3"}],"key":"callbacks"},{"name":"Functions","nodes":[{"id":"inspect/5","deprecated":false,"title":"inspect(df, backend, n_rows, inspect_opts, opts \\\\ [])","anchor":"inspect/5"},{"id":"new/3","deprecated":false,"title":"new(data, names, dtypes)","anchor":"new/3"}],"key":"functions"}]},{"id":"Explorer.Backend.LazyFrame","deprecated":false,"group":"Backends","title":"Explorer.Backend.LazyFrame","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"Explorer.Backend.LazySeries","deprecated":false,"group":"Backends","title":"Explorer.Backend.LazySeries","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"Explorer.Backend.Series","deprecated":false,"group":"Backends","title":"Explorer.Backend.Series","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"df/0","deprecated":false,"title":"df()","anchor":"t:df/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"lazy_s/0","deprecated":false,"title":"lazy_s()","anchor":"t:lazy_s/0"},{"id":"non_finite/0","deprecated":false,"title":"non_finite()","anchor":"t:non_finite/0"},{"id":"option/1","deprecated":false,"title":"option(type)","anchor":"t:option/1"},{"id":"s/0","deprecated":false,"title":"s()","anchor":"t:s/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"},{"id":"valid_types/0","deprecated":false,"title":"valid_types()","anchor":"t:valid_types/0"}],"key":"types"},{"name":"Callbacks","nodes":[{"id":"abs/1","deprecated":false,"title":"abs(s)","anchor":"c:abs/1"},{"id":"acos/1","deprecated":false,"title":"acos(s)","anchor":"c:acos/1"},{"id":"add/2","deprecated":false,"title":"add(arg1, arg2)","anchor":"c:add/2"},{"id":"all_equal/2","deprecated":false,"title":"all_equal(s, s)","anchor":"c:all_equal/2"},{"id":"argmax/1","deprecated":false,"title":"argmax(s)","anchor":"c:argmax/1"},{"id":"argmin/1","deprecated":false,"title":"argmin(s)","anchor":"c:argmin/1"},{"id":"argsort/3","deprecated":false,"title":"argsort(s, descending?, nils_last)","anchor":"c:argsort/3"},{"id":"asin/1","deprecated":false,"title":"asin(s)","anchor":"c:asin/1"},{"id":"at/2","deprecated":false,"title":"at(s, idx)","anchor":"c:at/2"},{"id":"at_every/2","deprecated":false,"title":"at_every(s, integer)","anchor":"c:at_every/2"},{"id":"atan/1","deprecated":false,"title":"atan(s)","anchor":"c:atan/1"},{"id":"binary_and/2","deprecated":false,"title":"binary_and(s, s)","anchor":"c:binary_and/2"},{"id":"binary_in/2","deprecated":false,"title":"binary_in(s, s)","anchor":"c:binary_in/2"},{"id":"binary_or/2","deprecated":false,"title":"binary_or(s, s)","anchor":"c:binary_or/2"},{"id":"cast/2","deprecated":false,"title":"cast(s, dtype)","anchor":"c:cast/2"},{"id":"categories/1","deprecated":false,"title":"categories(s)","anchor":"c:categories/1"},{"id":"categorise/2","deprecated":false,"title":"categorise(s, s)","anchor":"c:categorise/2"},{"id":"ceil/1","deprecated":false,"title":"ceil(s)","anchor":"c:ceil/1"},{"id":"clip/3","deprecated":false,"title":"clip(s, number, number)","anchor":"c:clip/3"},{"id":"coalesce/2","deprecated":false,"title":"coalesce(s, s)","anchor":"c:coalesce/2"},{"id":"concat/1","deprecated":false,"title":"concat(list)","anchor":"c:concat/1"},{"id":"contains/2","deprecated":false,"title":"contains(s, t)","anchor":"c:contains/2"},{"id":"correlation/3","deprecated":false,"title":"correlation(s, s, ddof)","anchor":"c:correlation/3"},{"id":"cos/1","deprecated":false,"title":"cos(s)","anchor":"c:cos/1"},{"id":"count/1","deprecated":false,"title":"count(s)","anchor":"c:count/1"},{"id":"covariance/2","deprecated":false,"title":"covariance(s, s)","anchor":"c:covariance/2"},{"id":"cumulative_max/2","deprecated":false,"title":"cumulative_max(s, reverse?)","anchor":"c:cumulative_max/2"},{"id":"cumulative_min/2","deprecated":false,"title":"cumulative_min(s, reverse?)","anchor":"c:cumulative_min/2"},{"id":"cumulative_product/2","deprecated":false,"title":"cumulative_product(s, reverse?)","anchor":"c:cumulative_product/2"},{"id":"cumulative_sum/2","deprecated":false,"title":"cumulative_sum(s, reverse?)","anchor":"c:cumulative_sum/2"},{"id":"cut/5","deprecated":false,"title":"cut(s, list, arg3, arg4, arg5)","anchor":"c:cut/5"},{"id":"day_of_week/1","deprecated":false,"title":"day_of_week(s)","anchor":"c:day_of_week/1"},{"id":"distinct/1","deprecated":false,"title":"distinct(s)","anchor":"c:distinct/1"},{"id":"divide/2","deprecated":false,"title":"divide(arg1, arg2)","anchor":"c:divide/2"},{"id":"downcase/1","deprecated":false,"title":"downcase(s)","anchor":"c:downcase/1"},{"id":"dtype/1","deprecated":false,"title":"dtype(s)","anchor":"c:dtype/1"},{"id":"equal/2","deprecated":false,"title":"equal(arg1, arg2)","anchor":"c:equal/2"},{"id":"ewm_mean/5","deprecated":false,"title":"ewm_mean(s, alpha, adjust, min_periods, ignore_nils)","anchor":"c:ewm_mean/5"},{"id":"exp/1","deprecated":false,"title":"exp(s)","anchor":"c:exp/1"},{"id":"fill_missing_with_strategy/2","deprecated":false,"title":"fill_missing_with_strategy(s, arg2)","anchor":"c:fill_missing_with_strategy/2"},{"id":"fill_missing_with_value/2","deprecated":false,"title":"fill_missing_with_value(s, arg2)","anchor":"c:fill_missing_with_value/2"},{"id":"first/1","deprecated":false,"title":"first(s)","anchor":"c:first/1"},{"id":"floor/1","deprecated":false,"title":"floor(s)","anchor":"c:floor/1"},{"id":"format/1","deprecated":false,"title":"format(list)","anchor":"c:format/1"},{"id":"frequencies/1","deprecated":false,"title":"frequencies(s)","anchor":"c:frequencies/1"},{"id":"from_binary/2","deprecated":false,"title":"from_binary(binary, dtype)","anchor":"c:from_binary/2"},{"id":"from_list/2","deprecated":false,"title":"from_list(list, dtype)","anchor":"c:from_list/2"},{"id":"greater/2","deprecated":false,"title":"greater(arg1, arg2)","anchor":"c:greater/2"},{"id":"greater_equal/2","deprecated":false,"title":"greater_equal(arg1, arg2)","anchor":"c:greater_equal/2"},{"id":"head/2","deprecated":false,"title":"head(s, n)","anchor":"c:head/2"},{"id":"hour/1","deprecated":false,"title":"hour(s)","anchor":"c:hour/1"},{"id":"inspect/2","deprecated":false,"title":"inspect(s, opts)","anchor":"c:inspect/2"},{"id":"iotype/1","deprecated":false,"title":"iotype(s)","anchor":"c:iotype/1"},{"id":"is_finite/1","deprecated":false,"title":"is_finite(s)","anchor":"c:is_finite/1"},{"id":"is_infinite/1","deprecated":false,"title":"is_infinite(s)","anchor":"c:is_infinite/1"},{"id":"is_nan/1","deprecated":false,"title":"is_nan(s)","anchor":"c:is_nan/1"},{"id":"is_nil/1","deprecated":false,"title":"is_nil(s)","anchor":"c:is_nil/1"},{"id":"is_not_nil/1","deprecated":false,"title":"is_not_nil(s)","anchor":"c:is_not_nil/1"},{"id":"last/1","deprecated":false,"title":"last(s)","anchor":"c:last/1"},{"id":"less/2","deprecated":false,"title":"less(arg1, arg2)","anchor":"c:less/2"},{"id":"less_equal/2","deprecated":false,"title":"less_equal(arg1, arg2)","anchor":"c:less_equal/2"},{"id":"log/1","deprecated":false,"title":"log(argument)","anchor":"c:log/1"},{"id":"log/2","deprecated":false,"title":"log(argument, base)","anchor":"c:log/2"},{"id":"lstrip/2","deprecated":false,"title":"lstrip(s, arg2)","anchor":"c:lstrip/2"},{"id":"mask/2","deprecated":false,"title":"mask(s, mask)","anchor":"c:mask/2"},{"id":"max/1","deprecated":false,"title":"max(s)","anchor":"c:max/1"},{"id":"mean/1","deprecated":false,"title":"mean(s)","anchor":"c:mean/1"},{"id":"median/1","deprecated":false,"title":"median(s)","anchor":"c:median/1"},{"id":"min/1","deprecated":false,"title":"min(s)","anchor":"c:min/1"},{"id":"minute/1","deprecated":false,"title":"minute(s)","anchor":"c:minute/1"},{"id":"month/1","deprecated":false,"title":"month(s)","anchor":"c:month/1"},{"id":"multiply/2","deprecated":false,"title":"multiply(arg1, arg2)","anchor":"c:multiply/2"},{"id":"n_distinct/1","deprecated":false,"title":"n_distinct(s)","anchor":"c:n_distinct/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(s)","anchor":"c:nil_count/1"},{"id":"not_equal/2","deprecated":false,"title":"not_equal(arg1, arg2)","anchor":"c:not_equal/2"},{"id":"peaks/2","deprecated":false,"title":"peaks(s, arg2)","anchor":"c:peaks/2"},{"id":"pow/2","deprecated":false,"title":"pow(arg1, arg2)","anchor":"c:pow/2"},{"id":"product/1","deprecated":false,"title":"product(s)","anchor":"c:product/1"},{"id":"qcut/5","deprecated":false,"title":"qcut(s, list, arg3, arg4, arg5)","anchor":"c:qcut/5"},{"id":"quantile/2","deprecated":false,"title":"quantile(s, float)","anchor":"c:quantile/2"},{"id":"quotient/2","deprecated":false,"title":"quotient(arg1, arg2)","anchor":"c:quotient/2"},{"id":"rank/4","deprecated":false,"title":"rank(s, method, descending, seed)","anchor":"c:rank/4"},{"id":"remainder/2","deprecated":false,"title":"remainder(arg1, arg2)","anchor":"c:remainder/2"},{"id":"reverse/1","deprecated":false,"title":"reverse(s)","anchor":"c:reverse/1"},{"id":"round/2","deprecated":false,"title":"round(s, decimals)","anchor":"c:round/2"},{"id":"rstrip/2","deprecated":false,"title":"rstrip(s, arg2)","anchor":"c:rstrip/2"},{"id":"sample/5","deprecated":false,"title":"sample(s, n_or_frac, replacement, shuffle, seed)","anchor":"c:sample/5"},{"id":"second/1","deprecated":false,"title":"second(s)","anchor":"c:second/1"},{"id":"select/3","deprecated":false,"title":"select(predicate, arg2, arg3)","anchor":"c:select/3"},{"id":"shift/3","deprecated":false,"title":"shift(s, offset, default)","anchor":"c:shift/3"},{"id":"sin/1","deprecated":false,"title":"sin(s)","anchor":"c:sin/1"},{"id":"size/1","deprecated":false,"title":"size(s)","anchor":"c:size/1"},{"id":"skew/2","deprecated":false,"title":"skew(s, bias?)","anchor":"c:skew/2"},{"id":"slice/2","deprecated":false,"title":"slice(s, indices)","anchor":"c:slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(s, offset, length)","anchor":"c:slice/3"},{"id":"sort/3","deprecated":false,"title":"sort(s, descending?, nils_last)","anchor":"c:sort/3"},{"id":"standard_deviation/1","deprecated":false,"title":"standard_deviation(s)","anchor":"c:standard_deviation/1"},{"id":"strftime/2","deprecated":false,"title":"strftime(s, t)","anchor":"c:strftime/2"},{"id":"strip/2","deprecated":false,"title":"strip(s, arg2)","anchor":"c:strip/2"},{"id":"strptime/2","deprecated":false,"title":"strptime(s, t)","anchor":"c:strptime/2"},{"id":"substring/3","deprecated":false,"title":"substring(s, integer, arg3)","anchor":"c:substring/3"},{"id":"subtract/2","deprecated":false,"title":"subtract(arg1, arg2)","anchor":"c:subtract/2"},{"id":"sum/1","deprecated":false,"title":"sum(s)","anchor":"c:sum/1"},{"id":"tail/2","deprecated":false,"title":"tail(s, n)","anchor":"c:tail/2"},{"id":"tan/1","deprecated":false,"title":"tan(s)","anchor":"c:tan/1"},{"id":"to_iovec/1","deprecated":false,"title":"to_iovec(s)","anchor":"c:to_iovec/1"},{"id":"to_list/1","deprecated":false,"title":"to_list(s)","anchor":"c:to_list/1"},{"id":"transform/2","deprecated":false,"title":"transform(s, function)","anchor":"c:transform/2"},{"id":"unary_not/1","deprecated":false,"title":"unary_not(s)","anchor":"c:unary_not/1"},{"id":"unordered_distinct/1","deprecated":false,"title":"unordered_distinct(s)","anchor":"c:unordered_distinct/1"},{"id":"upcase/1","deprecated":false,"title":"upcase(s)","anchor":"c:upcase/1"},{"id":"variance/1","deprecated":false,"title":"variance(s)","anchor":"c:variance/1"},{"id":"window_max/5","deprecated":false,"title":"window_max(s, window_size, weights, min_periods, center)","anchor":"c:window_max/5"},{"id":"window_mean/5","deprecated":false,"title":"window_mean(s, window_size, weights, min_periods, center)","anchor":"c:window_mean/5"},{"id":"window_median/5","deprecated":false,"title":"window_median(s, window_size, weights, min_periods, center)","anchor":"c:window_median/5"},{"id":"window_min/5","deprecated":false,"title":"window_min(s, window_size, weights, min_periods, center)","anchor":"c:window_min/5"},{"id":"window_standard_deviation/5","deprecated":false,"title":"window_standard_deviation(s, window_size, weights, min_periods, center)","anchor":"c:window_standard_deviation/5"},{"id":"window_sum/5","deprecated":false,"title":"window_sum(s, window_size, weights, min_periods, center)","anchor":"c:window_sum/5"},{"id":"year/1","deprecated":false,"title":"year(s)","anchor":"c:year/1"}],"key":"callbacks"},{"name":"Functions","nodes":[{"id":"inspect/5","deprecated":false,"title":"inspect(series, backend, n_rows, inspect_opts, opts \\\\ [])","anchor":"inspect/5"},{"id":"new/2","deprecated":false,"title":"new(data, dtype)","anchor":"new/2"}],"key":"functions"}]},{"id":"Explorer.PolarsBackend","deprecated":false,"group":"Backends","title":"Explorer.PolarsBackend","sections":[]}],"extras":[{"id":"api-reference","group":"","title":"API Reference","headers":[{"id":"Modules","anchor":"modules"}]},{"id":"exploring_explorer","group":"","title":"Ten Minutes to Explorer","headers":[{"id":"Introduction","anchor":"introduction"},{"id":"Reading and writing data","anchor":"reading-and-writing-data"},{"id":"Working with Series","anchor":"working-with-series"},{"id":"Working with DataFrames","anchor":"working-with-dataframes"}]},{"id":"changelog","group":"","title":"Changelog","headers":[{"id":"Unreleased","anchor":"unreleased"},{"id":"v0.6.1 - 2023-07-06","anchor":"v0-6-1-2023-07-06"},{"id":"v0.6.0 - 2023-07-05","anchor":"v0-6-0-2023-07-05"},{"id":"v0.5.7 - 2023-05-10","anchor":"v0-5-7-2023-05-10"},{"id":"v0.5.6 - 2023-03-24","anchor":"v0-5-6-2023-03-24"},{"id":"v0.5.5 - 2023-03-13","anchor":"v0-5-5-2023-03-13"},{"id":"v0.5.4 - 2023-03-09","anchor":"v0-5-4-2023-03-09"},{"id":"v0.5.3 - 2023-03-08","anchor":"v0-5-3-2023-03-08"},{"id":"v0.5.2 - 2023-02-28","anchor":"v0-5-2-2023-02-28"},{"id":"v0.5.1 - 2023-02-17","anchor":"v0-5-1-2023-02-17"},{"id":"v0.5.0 - 2023-01-12","anchor":"v0-5-0-2023-01-12"},{"id":"v0.4.0 - 2022-11-29","anchor":"v0-4-0-2022-11-29"},{"id":"v0.3.1 - 2022-09-09","anchor":"v0-3-1-2022-09-09"},{"id":"v0.3.0 - 2022-09-01","anchor":"v0-3-0-2022-09-01"},{"id":"v0.2.0 - 2022-06-22","anchor":"v0-2-0-2022-06-22"},{"id":"v0.1.1 - 2022-04-27","anchor":"v0-1-1-2022-04-27"},{"id":"v0.1.0 - 2022-04-26","anchor":"v0-1-0-2022-04-26"}]}],"tasks":[]} \ No newline at end of file +sidebarNodes={"modules":[{"id":"Explorer","deprecated":false,"group":"","title":"Explorer","sections":[{"id":"Getting started","anchor":"module-getting-started"},{"id":"A glimpse of the API","anchor":"module-a-glimpse-of-the-api"},{"id":"Features and design","anchor":"module-features-and-design"}]},{"id":"Explorer.DataFrame","deprecated":false,"group":"","title":"Explorer.DataFrame","sections":[{"id":"Creating dataframes","anchor":"module-creating-dataframes"},{"id":"Verbs","anchor":"module-verbs"},{"id":"IO operations","anchor":"module-io-operations"},{"id":"Selecting columns and access","anchor":"module-selecting-columns-and-access"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"column/0","deprecated":false,"title":"column()","anchor":"t:column/0"},{"id":"column_name/0","deprecated":false,"title":"column_name()","anchor":"t:column_name/0"},{"id":"column_names/0","deprecated":false,"title":"column_names()","anchor":"t:column_names/0"},{"id":"column_pairs/1","deprecated":false,"title":"column_pairs(value)","anchor":"t:column_pairs/1"},{"id":"columns/0","deprecated":false,"title":"columns()","anchor":"t:columns/0"},{"id":"fs_entry/0","deprecated":false,"title":"fs_entry()","anchor":"t:fs_entry/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions: Conversion","nodes":[{"id":"collect/1","deprecated":false,"title":"collect(df)","anchor":"collect/1"},{"id":"new/2","deprecated":false,"title":"new(data, opts \\\\ [])","anchor":"new/2"},{"id":"to_columns/2","deprecated":false,"title":"to_columns(df, opts \\\\ [])","anchor":"to_columns/2"},{"id":"to_lazy/1","deprecated":false,"title":"to_lazy(df)","anchor":"to_lazy/1"},{"id":"to_rows/2","deprecated":false,"title":"to_rows(df, opts \\\\ [])","anchor":"to_rows/2"},{"id":"to_rows_stream/2","deprecated":false,"title":"to_rows_stream(df, opts \\\\ [])","anchor":"to_rows_stream/2"},{"id":"to_series/2","deprecated":false,"title":"to_series(df, opts \\\\ [])","anchor":"to_series/2"}],"key":"functions-conversion"},{"name":"Functions: Single-table","nodes":[{"id":"arrange/2","deprecated":false,"title":"arrange(df, query)","anchor":"arrange/2"},{"id":"arrange_with/2","deprecated":false,"title":"arrange_with(df, fun)","anchor":"arrange_with/2"},{"id":"describe/2","deprecated":false,"title":"describe(df, opts \\\\ [])","anchor":"describe/2"},{"id":"discard/2","deprecated":false,"title":"discard(df, columns_or_column)","anchor":"discard/2"},{"id":"distinct/3","deprecated":false,"title":"distinct(df, columns \\\\ 0..-1//1, opts \\\\ [])","anchor":"distinct/3"},{"id":"drop_nil/2","deprecated":false,"title":"drop_nil(df, columns_or_column \\\\ 0..-1//1)","anchor":"drop_nil/2"},{"id":"dummies/2","deprecated":false,"title":"dummies(df, columns_or_column)","anchor":"dummies/2"},{"id":"filter/2","deprecated":false,"title":"filter(df, query)","anchor":"filter/2"},{"id":"filter_with/2","deprecated":false,"title":"filter_with(df, fun)","anchor":"filter_with/2"},{"id":"frequencies/2","deprecated":false,"title":"frequencies(df, columns)","anchor":"frequencies/2"},{"id":"group_by/2","deprecated":false,"title":"group_by(df, group)","anchor":"group_by/2"},{"id":"mask/2","deprecated":false,"title":"mask(df, mask)","anchor":"mask/2"},{"id":"mutate/2","deprecated":false,"title":"mutate(df, mutations)","anchor":"mutate/2"},{"id":"mutate_with/2","deprecated":false,"title":"mutate_with(df, fun)","anchor":"mutate_with/2"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(df)","anchor":"nil_count/1"},{"id":"pivot_longer/3","deprecated":false,"title":"pivot_longer(df, columns_to_pivot, opts \\\\ [])","anchor":"pivot_longer/3"},{"id":"pivot_wider/4","deprecated":false,"title":"pivot_wider(df, names_from, values_from, opts \\\\ [])","anchor":"pivot_wider/4"},{"id":"pull/2","deprecated":false,"title":"pull(df, column)","anchor":"pull/2"},{"id":"put/4","deprecated":false,"title":"put(df, column_name, series_or_tensor_or_list, opts \\\\ [])","anchor":"put/4"},{"id":"relocate/3","deprecated":false,"title":"relocate(df, columns_or_column, opts)","anchor":"relocate/3"},{"id":"rename/2","deprecated":false,"title":"rename(df, names)","anchor":"rename/2"},{"id":"rename_with/3","deprecated":false,"title":"rename_with(df, columns \\\\ 0..-1//1, callback)","anchor":"rename_with/3"},{"id":"select/2","deprecated":false,"title":"select(df, columns_or_column)","anchor":"select/2"},{"id":"summarise/2","deprecated":false,"title":"summarise(df, query)","anchor":"summarise/2"},{"id":"summarise_with/2","deprecated":false,"title":"summarise_with(df, fun)","anchor":"summarise_with/2"},{"id":"ungroup/2","deprecated":false,"title":"ungroup(df, groups \\\\ 0..-1//1)","anchor":"ungroup/2"}],"key":"functions-single-table"},{"name":"Functions: Multi-table","nodes":[{"id":"concat_columns/1","deprecated":false,"title":"concat_columns(dfs)","anchor":"concat_columns/1"},{"id":"concat_columns/2","deprecated":false,"title":"concat_columns(df1, df2)","anchor":"concat_columns/2"},{"id":"concat_rows/1","deprecated":false,"title":"concat_rows(dfs)","anchor":"concat_rows/1"},{"id":"concat_rows/2","deprecated":false,"title":"concat_rows(df1, df2)","anchor":"concat_rows/2"},{"id":"join/3","deprecated":false,"title":"join(left, right, opts \\\\ [])","anchor":"join/3"}],"key":"functions-multi-table"},{"name":"Functions: Row-based","nodes":[{"id":"head/2","deprecated":false,"title":"head(df, nrows \\\\ 5)","anchor":"head/2"},{"id":"sample/3","deprecated":false,"title":"sample(df, n_or_frac, opts \\\\ [])","anchor":"sample/3"},{"id":"shuffle/2","deprecated":false,"title":"shuffle(df, opts \\\\ [])","anchor":"shuffle/2"},{"id":"slice/2","deprecated":false,"title":"slice(df, row_indices)","anchor":"slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(df, offset, length)","anchor":"slice/3"},{"id":"tail/2","deprecated":false,"title":"tail(df, nrows \\\\ 5)","anchor":"tail/2"}],"key":"functions-row-based"},{"name":"Functions: Introspection","nodes":[{"id":"dtypes/1","deprecated":false,"title":"dtypes(df)","anchor":"dtypes/1"},{"id":"groups/1","deprecated":false,"title":"groups(data_frame)","anchor":"groups/1"},{"id":"n_columns/1","deprecated":false,"title":"n_columns(df)","anchor":"n_columns/1"},{"id":"n_rows/1","deprecated":false,"title":"n_rows(df)","anchor":"n_rows/1"},{"id":"names/1","deprecated":false,"title":"names(df)","anchor":"names/1"},{"id":"shape/1","deprecated":false,"title":"shape(df)","anchor":"shape/1"}],"key":"functions-introspection"},{"name":"Functions: IO","nodes":[{"id":"dump_csv/2","deprecated":false,"title":"dump_csv(df, opts \\\\ [])","anchor":"dump_csv/2"},{"id":"dump_csv!/2","deprecated":false,"title":"dump_csv!(df, opts \\\\ [])","anchor":"dump_csv!/2"},{"id":"dump_ipc/2","deprecated":false,"title":"dump_ipc(df, opts \\\\ [])","anchor":"dump_ipc/2"},{"id":"dump_ipc!/2","deprecated":false,"title":"dump_ipc!(df, opts \\\\ [])","anchor":"dump_ipc!/2"},{"id":"dump_ipc_stream/2","deprecated":false,"title":"dump_ipc_stream(df, opts \\\\ [])","anchor":"dump_ipc_stream/2"},{"id":"dump_ipc_stream!/2","deprecated":false,"title":"dump_ipc_stream!(df, opts \\\\ [])","anchor":"dump_ipc_stream!/2"},{"id":"dump_ndjson/1","deprecated":false,"title":"dump_ndjson(df)","anchor":"dump_ndjson/1"},{"id":"dump_ndjson!/1","deprecated":false,"title":"dump_ndjson!(df)","anchor":"dump_ndjson!/1"},{"id":"dump_parquet/2","deprecated":false,"title":"dump_parquet(df, opts \\\\ [])","anchor":"dump_parquet/2"},{"id":"dump_parquet!/2","deprecated":false,"title":"dump_parquet!(df, opts \\\\ [])","anchor":"dump_parquet!/2"},{"id":"from_csv/2","deprecated":false,"title":"from_csv(filename, opts \\\\ [])","anchor":"from_csv/2"},{"id":"from_csv!/2","deprecated":false,"title":"from_csv!(filename, opts \\\\ [])","anchor":"from_csv!/2"},{"id":"from_ipc/2","deprecated":false,"title":"from_ipc(filename, opts \\\\ [])","anchor":"from_ipc/2"},{"id":"from_ipc!/2","deprecated":false,"title":"from_ipc!(filename, opts \\\\ [])","anchor":"from_ipc!/2"},{"id":"from_ipc_stream/2","deprecated":false,"title":"from_ipc_stream(filename, opts \\\\ [])","anchor":"from_ipc_stream/2"},{"id":"from_ipc_stream!/2","deprecated":false,"title":"from_ipc_stream!(filename, opts \\\\ [])","anchor":"from_ipc_stream!/2"},{"id":"from_ndjson/2","deprecated":false,"title":"from_ndjson(filename, opts \\\\ [])","anchor":"from_ndjson/2"},{"id":"from_ndjson!/2","deprecated":false,"title":"from_ndjson!(filename, opts \\\\ [])","anchor":"from_ndjson!/2"},{"id":"from_parquet/2","deprecated":false,"title":"from_parquet(filename, opts \\\\ [])","anchor":"from_parquet/2"},{"id":"from_parquet!/2","deprecated":false,"title":"from_parquet!(filename, opts \\\\ [])","anchor":"from_parquet!/2"},{"id":"from_query/4","deprecated":false,"title":"from_query(conn, query, params, opts \\\\ [])","anchor":"from_query/4"},{"id":"from_query!/4","deprecated":false,"title":"from_query!(conn, query, params, opts \\\\ [])","anchor":"from_query!/4"},{"id":"load_csv/2","deprecated":false,"title":"load_csv(contents, opts \\\\ [])","anchor":"load_csv/2"},{"id":"load_csv!/2","deprecated":false,"title":"load_csv!(contents, opts \\\\ [])","anchor":"load_csv!/2"},{"id":"load_ipc/2","deprecated":false,"title":"load_ipc(contents, opts \\\\ [])","anchor":"load_ipc/2"},{"id":"load_ipc!/2","deprecated":false,"title":"load_ipc!(contents, opts \\\\ [])","anchor":"load_ipc!/2"},{"id":"load_ipc_stream/2","deprecated":false,"title":"load_ipc_stream(contents, opts \\\\ [])","anchor":"load_ipc_stream/2"},{"id":"load_ipc_stream!/2","deprecated":false,"title":"load_ipc_stream!(contents, opts \\\\ [])","anchor":"load_ipc_stream!/2"},{"id":"load_ndjson/2","deprecated":false,"title":"load_ndjson(contents, opts \\\\ [])","anchor":"load_ndjson/2"},{"id":"load_ndjson!/2","deprecated":false,"title":"load_ndjson!(contents, opts \\\\ [])","anchor":"load_ndjson!/2"},{"id":"load_parquet/2","deprecated":false,"title":"load_parquet(contents, opts \\\\ [])","anchor":"load_parquet/2"},{"id":"load_parquet!/2","deprecated":false,"title":"load_parquet!(contents, opts \\\\ [])","anchor":"load_parquet!/2"},{"id":"to_csv/3","deprecated":false,"title":"to_csv(df, filename, opts \\\\ [])","anchor":"to_csv/3"},{"id":"to_csv!/3","deprecated":false,"title":"to_csv!(df, filename, opts \\\\ [])","anchor":"to_csv!/3"},{"id":"to_ipc/3","deprecated":false,"title":"to_ipc(df, filename, opts \\\\ [])","anchor":"to_ipc/3"},{"id":"to_ipc!/3","deprecated":false,"title":"to_ipc!(df, filename, opts \\\\ [])","anchor":"to_ipc!/3"},{"id":"to_ipc_stream/3","deprecated":false,"title":"to_ipc_stream(df, filename, opts \\\\ [])","anchor":"to_ipc_stream/3"},{"id":"to_ipc_stream!/3","deprecated":false,"title":"to_ipc_stream!(df, filename, opts \\\\ [])","anchor":"to_ipc_stream!/3"},{"id":"to_ndjson/3","deprecated":false,"title":"to_ndjson(df, filename, opts \\\\ [])","anchor":"to_ndjson/3"},{"id":"to_ndjson!/3","deprecated":false,"title":"to_ndjson!(df, filename, opts \\\\ [])","anchor":"to_ndjson!/3"},{"id":"to_parquet/3","deprecated":false,"title":"to_parquet(df, filename, opts \\\\ [])","anchor":"to_parquet/3"},{"id":"to_parquet!/3","deprecated":false,"title":"to_parquet!(df, filename, opts \\\\ [])","anchor":"to_parquet!/3"}],"key":"functions-io"}]},{"id":"Explorer.Datasets","deprecated":false,"group":"","title":"Explorer.Datasets","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"fossil_fuels/0","deprecated":false,"title":"fossil_fuels()","anchor":"fossil_fuels/0"},{"id":"iris/0","deprecated":false,"title":"iris()","anchor":"iris/0"},{"id":"wine/0","deprecated":false,"title":"wine()","anchor":"wine/0"}],"key":"functions"}]},{"id":"Explorer.Query","deprecated":false,"group":"","title":"Explorer.Query","sections":[{"id":"Supported operations","anchor":"module-supported-operations"},{"id":"Interpolation","anchor":"module-interpolation"},{"id":"Across and comprehensions","anchor":"module-across-and-comprehensions"},{"id":"Implementation details","anchor":"module-implementation-details"}],"nodeGroups":[{"name":"Functions","nodes":[{"id":"**/2","deprecated":false,"title":"left ** right","anchor":"**/2"},{"id":"*/2","deprecated":false,"title":"left * right","anchor":"*/2"},{"id":"+/1","deprecated":false,"title":"+number","anchor":"+/1"},{"id":"+/2","deprecated":false,"title":"left + right","anchor":"+/2"},{"id":"-/1","deprecated":false,"title":"-number","anchor":"-/1"},{"id":"-/2","deprecated":false,"title":"left - right","anchor":"-/2"},{"id":"//2","deprecated":false,"title":"left / right","anchor":"//2"},{"id":"!=/2","deprecated":false,"title":"left != right","anchor":"!=/2"},{"id":"/2","deprecated":false,"title":"left <> right","anchor":"%3C%3E/2"},{"id":"==/2","deprecated":false,"title":"left == right","anchor":"==/2"},{"id":">/2","deprecated":false,"title":"left > right","anchor":"%3E/2"},{"id":">=/2","deprecated":false,"title":"left >= right","anchor":"%3E=/2"},{"id":"across/0","deprecated":false,"title":"across()","anchor":"across/0"},{"id":"across/1","deprecated":false,"title":"across(selector)","anchor":"across/1"},{"id":"col/1","deprecated":false,"title":"col(name)","anchor":"col/1"},{"id":"query/1","deprecated":false,"title":"query(expression)","anchor":"query/1"}],"key":"functions"}]},{"id":"Explorer.Series","deprecated":false,"group":"","title":"Explorer.Series","sections":[{"id":"Creating series","anchor":"module-creating-series"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"datetime_dtype/0","deprecated":false,"title":"datetime_dtype()","anchor":"t:datetime_dtype/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"inferable_scalar/0","deprecated":false,"title":"inferable_scalar()","anchor":"t:inferable_scalar/0"},{"id":"lazy_t/0","deprecated":false,"title":"lazy_t()","anchor":"t:lazy_t/0"},{"id":"non_finite/0","deprecated":false,"title":"non_finite()","anchor":"t:non_finite/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions: Conversion","nodes":[{"id":"from_binary/3","deprecated":false,"title":"from_binary(binary, dtype, opts \\\\ [])","anchor":"from_binary/3"},{"id":"from_list/2","deprecated":false,"title":"from_list(list, opts \\\\ [])","anchor":"from_list/2"},{"id":"from_tensor/2","deprecated":false,"title":"from_tensor(tensor, opts \\\\ [])","anchor":"from_tensor/2"},{"id":"replace/2","deprecated":false,"title":"replace(series, tensor_or_list)","anchor":"replace/2"},{"id":"to_binary/1","deprecated":false,"title":"to_binary(series)","anchor":"to_binary/1"},{"id":"to_enum/1","deprecated":false,"title":"to_enum(series)","anchor":"to_enum/1"},{"id":"to_iovec/1","deprecated":false,"title":"to_iovec(series)","anchor":"to_iovec/1"},{"id":"to_list/1","deprecated":false,"title":"to_list(series)","anchor":"to_list/1"},{"id":"to_tensor/2","deprecated":false,"title":"to_tensor(series, tensor_opts \\\\ [])","anchor":"to_tensor/2"}],"key":"functions-conversion"},{"name":"Functions: Aggregation","nodes":[{"id":"argmax/1","deprecated":false,"title":"argmax(series)","anchor":"argmax/1"},{"id":"argmin/1","deprecated":false,"title":"argmin(series)","anchor":"argmin/1"},{"id":"correlation/3","deprecated":false,"title":"correlation(left, right, ddof \\\\ 1)","anchor":"correlation/3"},{"id":"count/1","deprecated":false,"title":"count(series)","anchor":"count/1"},{"id":"covariance/2","deprecated":false,"title":"covariance(left, right)","anchor":"covariance/2"},{"id":"cut/3","deprecated":false,"title":"cut(series, bins, opts \\\\ [])","anchor":"cut/3"},{"id":"frequencies/1","deprecated":false,"title":"frequencies(series)","anchor":"frequencies/1"},{"id":"max/1","deprecated":false,"title":"max(series)","anchor":"max/1"},{"id":"mean/1","deprecated":false,"title":"mean(series)","anchor":"mean/1"},{"id":"median/1","deprecated":false,"title":"median(series)","anchor":"median/1"},{"id":"min/1","deprecated":false,"title":"min(series)","anchor":"min/1"},{"id":"n_distinct/1","deprecated":false,"title":"n_distinct(series)","anchor":"n_distinct/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(series)","anchor":"nil_count/1"},{"id":"product/1","deprecated":false,"title":"product(series)","anchor":"product/1"},{"id":"qcut/3","deprecated":false,"title":"qcut(series, quantiles, opts \\\\ [])","anchor":"qcut/3"},{"id":"quantile/2","deprecated":false,"title":"quantile(series, quantile)","anchor":"quantile/2"},{"id":"skew/2","deprecated":false,"title":"skew(series, opts \\\\ [])","anchor":"skew/2"},{"id":"standard_deviation/1","deprecated":false,"title":"standard_deviation(series)","anchor":"standard_deviation/1"},{"id":"sum/1","deprecated":false,"title":"sum(series)","anchor":"sum/1"},{"id":"variance/1","deprecated":false,"title":"variance(series)","anchor":"variance/1"}],"key":"functions-aggregation"},{"name":"Functions: Element-wise","nodes":[{"id":"abs/1","deprecated":false,"title":"abs(series)","anchor":"abs/1"},{"id":"add/2","deprecated":false,"title":"add(left, right)","anchor":"add/2"},{"id":"all_equal/2","deprecated":false,"title":"all_equal(left, right)","anchor":"all_equal/2"},{"id":"and/2","deprecated":false,"title":"left and right","anchor":"and/2"},{"id":"cast/2","deprecated":false,"title":"cast(series, dtype)","anchor":"cast/2"},{"id":"categorise/2","deprecated":false,"title":"categorise(series, categories)","anchor":"categorise/2"},{"id":"clip/3","deprecated":false,"title":"clip(series, min, max)","anchor":"clip/3"},{"id":"coalesce/1","deprecated":false,"title":"coalesce(list)","anchor":"coalesce/1"},{"id":"coalesce/2","deprecated":false,"title":"coalesce(s1, s2)","anchor":"coalesce/2"},{"id":"divide/2","deprecated":false,"title":"divide(left, right)","anchor":"divide/2"},{"id":"equal/2","deprecated":false,"title":"equal(left, right)","anchor":"equal/2"},{"id":"exp/1","deprecated":false,"title":"exp(s)","anchor":"exp/1"},{"id":"greater/2","deprecated":false,"title":"greater(left, right)","anchor":"greater/2"},{"id":"greater_equal/2","deprecated":false,"title":"greater_equal(left, right)","anchor":"greater_equal/2"},{"id":"in/2","deprecated":false,"title":"left in right","anchor":"in/2"},{"id":"is_nil/1","deprecated":false,"title":"is_nil(series)","anchor":"is_nil/1"},{"id":"is_not_nil/1","deprecated":false,"title":"is_not_nil(series)","anchor":"is_not_nil/1"},{"id":"less/2","deprecated":false,"title":"less(left, right)","anchor":"less/2"},{"id":"less_equal/2","deprecated":false,"title":"less_equal(left, right)","anchor":"less_equal/2"},{"id":"log/1","deprecated":false,"title":"log(s)","anchor":"log/1"},{"id":"log/2","deprecated":false,"title":"log(argument, base)","anchor":"log/2"},{"id":"mask/2","deprecated":false,"title":"mask(series, mask)","anchor":"mask/2"},{"id":"multiply/2","deprecated":false,"title":"multiply(left, right)","anchor":"multiply/2"},{"id":"not/1","deprecated":false,"title":"not series","anchor":"not/1"},{"id":"not_equal/2","deprecated":false,"title":"not_equal(left, right)","anchor":"not_equal/2"},{"id":"or/2","deprecated":false,"title":"left or right","anchor":"or/2"},{"id":"peaks/2","deprecated":false,"title":"peaks(series, max_or_min \\\\ :max)","anchor":"peaks/2"},{"id":"pow/2","deprecated":false,"title":"pow(left, right)","anchor":"pow/2"},{"id":"quotient/2","deprecated":false,"title":"quotient(left, right)","anchor":"quotient/2"},{"id":"rank/2","deprecated":false,"title":"rank(series, opts \\\\ [])","anchor":"rank/2"},{"id":"remainder/2","deprecated":false,"title":"remainder(left, right)","anchor":"remainder/2"},{"id":"select/3","deprecated":false,"title":"select(predicate, on_true, on_false)","anchor":"select/3"},{"id":"strftime/2","deprecated":false,"title":"strftime(series, format_string)","anchor":"strftime/2"},{"id":"strptime/2","deprecated":false,"title":"strptime(series, format_string)","anchor":"strptime/2"},{"id":"subtract/2","deprecated":false,"title":"subtract(left, right)","anchor":"subtract/2"},{"id":"transform/2","deprecated":false,"title":"transform(series, fun)","anchor":"transform/2"}],"key":"functions-element-wise"},{"name":"Functions: Datetime ops","nodes":[{"id":"day_of_week/1","deprecated":false,"title":"day_of_week(series)","anchor":"day_of_week/1"},{"id":"hour/1","deprecated":false,"title":"hour(series)","anchor":"hour/1"},{"id":"minute/1","deprecated":false,"title":"minute(series)","anchor":"minute/1"},{"id":"month/1","deprecated":false,"title":"month(series)","anchor":"month/1"},{"id":"second/1","deprecated":false,"title":"second(series)","anchor":"second/1"},{"id":"year/1","deprecated":false,"title":"year(series)","anchor":"year/1"}],"key":"functions-datetime-ops"},{"name":"Functions: Float ops","nodes":[{"id":"acos/1","deprecated":false,"title":"acos(series)","anchor":"acos/1"},{"id":"asin/1","deprecated":false,"title":"asin(series)","anchor":"asin/1"},{"id":"atan/1","deprecated":false,"title":"atan(series)","anchor":"atan/1"},{"id":"ceil/1","deprecated":false,"title":"ceil(series)","anchor":"ceil/1"},{"id":"cos/1","deprecated":false,"title":"cos(series)","anchor":"cos/1"},{"id":"floor/1","deprecated":false,"title":"floor(series)","anchor":"floor/1"},{"id":"is_finite/1","deprecated":false,"title":"is_finite(series)","anchor":"is_finite/1"},{"id":"is_infinite/1","deprecated":false,"title":"is_infinite(series)","anchor":"is_infinite/1"},{"id":"is_nan/1","deprecated":false,"title":"is_nan(series)","anchor":"is_nan/1"},{"id":"round/2","deprecated":false,"title":"round(series, decimals)","anchor":"round/2"},{"id":"sin/1","deprecated":false,"title":"sin(series)","anchor":"sin/1"},{"id":"tan/1","deprecated":false,"title":"tan(series)","anchor":"tan/1"}],"key":"functions-float-ops"},{"name":"Functions: String ops","nodes":[{"id":"contains/2","deprecated":false,"title":"contains(series, pattern)","anchor":"contains/2"},{"id":"downcase/1","deprecated":false,"title":"downcase(series)","anchor":"downcase/1"},{"id":"lstrip/1","deprecated":false,"title":"lstrip(series)","anchor":"lstrip/1"},{"id":"lstrip/2","deprecated":false,"title":"lstrip(series, string)","anchor":"lstrip/2"},{"id":"rstrip/1","deprecated":false,"title":"rstrip(series)","anchor":"rstrip/1"},{"id":"rstrip/2","deprecated":false,"title":"rstrip(series, string)","anchor":"rstrip/2"},{"id":"strip/1","deprecated":false,"title":"strip(series)","anchor":"strip/1"},{"id":"strip/2","deprecated":false,"title":"strip(series, string)","anchor":"strip/2"},{"id":"substring/2","deprecated":false,"title":"substring(series, offset)","anchor":"substring/2"},{"id":"substring/3","deprecated":false,"title":"substring(series, offset, length)","anchor":"substring/3"},{"id":"upcase/1","deprecated":false,"title":"upcase(series)","anchor":"upcase/1"}],"key":"functions-string-ops"},{"name":"Functions: Introspection","nodes":[{"id":"categories/1","deprecated":false,"title":"categories(series)","anchor":"categories/1"},{"id":"dtype/1","deprecated":false,"title":"dtype(series)","anchor":"dtype/1"},{"id":"iotype/1","deprecated":false,"title":"iotype(series)","anchor":"iotype/1"},{"id":"size/1","deprecated":false,"title":"size(series)","anchor":"size/1"}],"key":"functions-introspection"},{"name":"Functions: Shape","nodes":[{"id":"argsort/2","deprecated":false,"title":"argsort(series, opts \\\\ [])","anchor":"argsort/2"},{"id":"at/2","deprecated":false,"title":"at(series, idx)","anchor":"at/2"},{"id":"at_every/2","deprecated":false,"title":"at_every(series, every_n)","anchor":"at_every/2"},{"id":"concat/1","deprecated":false,"title":"concat(series)","anchor":"concat/1"},{"id":"concat/2","deprecated":false,"title":"concat(s1, s2)","anchor":"concat/2"},{"id":"distinct/1","deprecated":false,"title":"distinct(series)","anchor":"distinct/1"},{"id":"first/1","deprecated":false,"title":"first(series)","anchor":"first/1"},{"id":"format/1","deprecated":false,"title":"format(list)","anchor":"format/1"},{"id":"head/2","deprecated":false,"title":"head(series, n_elements \\\\ 10)","anchor":"head/2"},{"id":"last/1","deprecated":false,"title":"last(series)","anchor":"last/1"},{"id":"reverse/1","deprecated":false,"title":"reverse(series)","anchor":"reverse/1"},{"id":"sample/3","deprecated":false,"title":"sample(series, n_or_frac, opts \\\\ [])","anchor":"sample/3"},{"id":"shift/2","deprecated":false,"title":"shift(series, offset)","anchor":"shift/2"},{"id":"shuffle/2","deprecated":false,"title":"shuffle(series, opts \\\\ [])","anchor":"shuffle/2"},{"id":"slice/2","deprecated":false,"title":"slice(series, indices)","anchor":"slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(series, offset, size)","anchor":"slice/3"},{"id":"sort/2","deprecated":false,"title":"sort(series, opts \\\\ [])","anchor":"sort/2"},{"id":"tail/2","deprecated":false,"title":"tail(series, n_elements \\\\ 10)","anchor":"tail/2"},{"id":"unordered_distinct/1","deprecated":false,"title":"unordered_distinct(series)","anchor":"unordered_distinct/1"}],"key":"functions-shape"},{"name":"Functions: Window","nodes":[{"id":"cumulative_max/2","deprecated":false,"title":"cumulative_max(series, opts \\\\ [])","anchor":"cumulative_max/2"},{"id":"cumulative_min/2","deprecated":false,"title":"cumulative_min(series, opts \\\\ [])","anchor":"cumulative_min/2"},{"id":"cumulative_product/2","deprecated":false,"title":"cumulative_product(series, opts \\\\ [])","anchor":"cumulative_product/2"},{"id":"cumulative_sum/2","deprecated":false,"title":"cumulative_sum(series, opts \\\\ [])","anchor":"cumulative_sum/2"},{"id":"ewm_mean/2","deprecated":false,"title":"ewm_mean(series, opts \\\\ [])","anchor":"ewm_mean/2"},{"id":"fill_missing/2","deprecated":false,"title":"fill_missing(series, value)","anchor":"fill_missing/2"},{"id":"window_max/3","deprecated":false,"title":"window_max(series, window_size, opts \\\\ [])","anchor":"window_max/3"},{"id":"window_mean/3","deprecated":false,"title":"window_mean(series, window_size, opts \\\\ [])","anchor":"window_mean/3"},{"id":"window_median/3","deprecated":false,"title":"window_median(series, window_size, opts \\\\ [])","anchor":"window_median/3"},{"id":"window_min/3","deprecated":false,"title":"window_min(series, window_size, opts \\\\ [])","anchor":"window_min/3"},{"id":"window_standard_deviation/3","deprecated":false,"title":"window_standard_deviation(series, window_size, opts \\\\ [])","anchor":"window_standard_deviation/3"},{"id":"window_sum/3","deprecated":false,"title":"window_sum(series, window_size, opts \\\\ [])","anchor":"window_sum/3"}],"key":"functions-window"},{"name":"Functions","nodes":[{"id":"to_date/1","deprecated":true,"title":"to_date(series)","anchor":"to_date/1"},{"id":"to_time/1","deprecated":true,"title":"to_time(series)","anchor":"to_time/1"}],"key":"functions"}]},{"id":"Explorer.TensorFrame","deprecated":false,"group":"","title":"Explorer.TensorFrame","sections":[{"id":"Stack and concatenating","anchor":"module-stack-and-concatenating"},{"id":"Warning: returning TensorFrames","anchor":"module-warning-returning-tensorframes"},{"id":"Supported dtypes","anchor":"module-supported-dtypes"}],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Functions","nodes":[{"id":"pull/2","deprecated":false,"title":"pull(tf, name)","anchor":"pull/2"},{"id":"put/3","deprecated":false,"title":"put(tf, name, tensor)","anchor":"put/3"}],"key":"functions"}]},{"id":"Explorer.Backend","deprecated":false,"group":"Backends","title":"Explorer.Backend","sections":[],"nodeGroups":[{"name":"Functions","nodes":[{"id":"get/0","deprecated":false,"title":"get()","anchor":"get/0"},{"id":"put/1","deprecated":false,"title":"put(backend)","anchor":"put/1"}],"key":"functions"}]},{"id":"Explorer.Backend.DataFrame","deprecated":false,"group":"Backends","title":"Explorer.Backend.DataFrame","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"basic_types/0","deprecated":false,"title":"basic_types()","anchor":"t:basic_types/0"},{"id":"column_name/0","deprecated":false,"title":"column_name()","anchor":"t:column_name/0"},{"id":"columns_for_io/0","deprecated":false,"title":"columns_for_io()","anchor":"t:columns_for_io/0"},{"id":"compression/0","deprecated":false,"title":"compression()","anchor":"t:compression/0"},{"id":"df/0","deprecated":false,"title":"df()","anchor":"t:df/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"dtypes/0","deprecated":false,"title":"dtypes()","anchor":"t:dtypes/0"},{"id":"fs_entry/0","deprecated":false,"title":"fs_entry()","anchor":"t:fs_entry/0"},{"id":"lazy_frame/0","deprecated":false,"title":"lazy_frame()","anchor":"t:lazy_frame/0"},{"id":"lazy_series/0","deprecated":false,"title":"lazy_series()","anchor":"t:lazy_series/0"},{"id":"mutate_value/0","deprecated":false,"title":"mutate_value()","anchor":"t:mutate_value/0"},{"id":"ok_result/0","deprecated":false,"title":"ok_result()","anchor":"t:ok_result/0"},{"id":"option/1","deprecated":false,"title":"option(type)","anchor":"t:option/1"},{"id":"result/1","deprecated":false,"title":"result(t)","anchor":"t:result/1"},{"id":"series/0","deprecated":false,"title":"series()","anchor":"t:series/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"},{"name":"Callbacks","nodes":[{"id":"arrange_with/3","deprecated":false,"title":"arrange_with(df, out_df, directions)","anchor":"c:arrange_with/3"},{"id":"collect/1","deprecated":false,"title":"collect(df)","anchor":"c:collect/1"},{"id":"concat_columns/2","deprecated":false,"title":"concat_columns(list, out_df)","anchor":"c:concat_columns/2"},{"id":"concat_rows/2","deprecated":false,"title":"concat_rows(list, out_df)","anchor":"c:concat_rows/2"},{"id":"describe/2","deprecated":false,"title":"describe(df, percentiles)","anchor":"c:describe/2"},{"id":"distinct/3","deprecated":false,"title":"distinct(df, out_df, columns)","anchor":"c:distinct/3"},{"id":"drop_nil/2","deprecated":false,"title":"drop_nil(df, columns)","anchor":"c:drop_nil/2"},{"id":"dummies/3","deprecated":false,"title":"dummies(df, out_df, columns)","anchor":"c:dummies/3"},{"id":"dump_csv/3","deprecated":false,"title":"dump_csv(df, header?, delimiter)","anchor":"c:dump_csv/3"},{"id":"dump_ipc/2","deprecated":false,"title":"dump_ipc(df, compression)","anchor":"c:dump_ipc/2"},{"id":"dump_ipc_stream/2","deprecated":false,"title":"dump_ipc_stream(df, compression)","anchor":"c:dump_ipc_stream/2"},{"id":"dump_ndjson/1","deprecated":false,"title":"dump_ndjson(df)","anchor":"c:dump_ndjson/1"},{"id":"dump_parquet/2","deprecated":false,"title":"dump_parquet(df, compression)","anchor":"c:dump_parquet/2"},{"id":"filter_with/3","deprecated":false,"title":"filter_with(df, out_df, lazy_series)","anchor":"c:filter_with/3"},{"id":"from_csv/12","deprecated":false,"title":"from_csv(\n entry,\n dtypes,\n delimiter,\n nil_values,\n skip_rows,\n header?,\n encoding,\n max_rows,\n columns,\n infer_schema_length,\n parse_dates,\n eol_delimiter\n)","anchor":"c:from_csv/12"},{"id":"from_ipc/2","deprecated":false,"title":"from_ipc(entry, columns)","anchor":"c:from_ipc/2"},{"id":"from_ipc_stream/2","deprecated":false,"title":"from_ipc_stream(filename, columns)","anchor":"c:from_ipc_stream/2"},{"id":"from_ndjson/3","deprecated":false,"title":"from_ndjson(filename, infer_schema_length, batch_size)","anchor":"c:from_ndjson/3"},{"id":"from_parquet/3","deprecated":false,"title":"from_parquet(entry, max_rows, columns)","anchor":"c:from_parquet/3"},{"id":"from_query/3","deprecated":false,"title":"from_query(t, query, params)","anchor":"c:from_query/3"},{"id":"from_series/1","deprecated":false,"title":"from_series(list)","anchor":"c:from_series/1"},{"id":"from_tabular/2","deprecated":false,"title":"from_tabular(t, dtypes)","anchor":"c:from_tabular/2"},{"id":"head/2","deprecated":false,"title":"head(df, rows)","anchor":"c:head/2"},{"id":"inspect/2","deprecated":false,"title":"inspect(df, opts)","anchor":"c:inspect/2"},{"id":"join/5","deprecated":false,"title":"join(left, right, out_df, on, how)","anchor":"c:join/5"},{"id":"lazy/0","deprecated":false,"title":"lazy()","anchor":"c:lazy/0"},{"id":"load_csv/12","deprecated":false,"title":"load_csv(\n contents,\n dtypes,\n delimiter,\n nil_values,\n skip_rows,\n header?,\n encoding,\n max_rows,\n columns,\n infer_schema_length,\n parse_dates,\n eol_delimiter\n)","anchor":"c:load_csv/12"},{"id":"load_ipc/2","deprecated":false,"title":"load_ipc(contents, columns)","anchor":"c:load_ipc/2"},{"id":"load_ipc_stream/2","deprecated":false,"title":"load_ipc_stream(contents, columns)","anchor":"c:load_ipc_stream/2"},{"id":"load_ndjson/3","deprecated":false,"title":"load_ndjson(contents, infer_schema_length, batch_size)","anchor":"c:load_ndjson/3"},{"id":"load_parquet/1","deprecated":false,"title":"load_parquet(contents)","anchor":"c:load_parquet/1"},{"id":"mask/2","deprecated":false,"title":"mask(df, mask)","anchor":"c:mask/2"},{"id":"mutate_with/3","deprecated":false,"title":"mutate_with(df, out_df, mutations)","anchor":"c:mutate_with/3"},{"id":"n_rows/1","deprecated":false,"title":"n_rows(df)","anchor":"c:n_rows/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(df)","anchor":"c:nil_count/1"},{"id":"pivot_longer/6","deprecated":false,"title":"pivot_longer(df, out_df, columns_to_pivot, columns_to_keep, names_to, values_to)","anchor":"c:pivot_longer/6"},{"id":"pivot_wider/5","deprecated":false,"title":"pivot_wider(df, id_columns, names_from, values_from, names_prefix)","anchor":"c:pivot_wider/5"},{"id":"pull/2","deprecated":false,"title":"pull(df, column)","anchor":"c:pull/2"},{"id":"put/4","deprecated":false,"title":"put(df, out_df, column_name, series)","anchor":"c:put/4"},{"id":"rename/3","deprecated":false,"title":"rename(df, out_df, list)","anchor":"c:rename/3"},{"id":"sample/5","deprecated":false,"title":"sample(df, n_or_frac, replace, shuffle, seed)","anchor":"c:sample/5"},{"id":"select/2","deprecated":false,"title":"select(df, out_df)","anchor":"c:select/2"},{"id":"slice/2","deprecated":false,"title":"slice(df, indices)","anchor":"c:slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(df, offset, length)","anchor":"c:slice/3"},{"id":"summarise_with/3","deprecated":false,"title":"summarise_with(df, out_df, aggregations)","anchor":"c:summarise_with/3"},{"id":"tail/2","deprecated":false,"title":"tail(df, rows)","anchor":"c:tail/2"},{"id":"to_csv/4","deprecated":false,"title":"to_csv(df, entry, header?, delimiter)","anchor":"c:to_csv/4"},{"id":"to_ipc/4","deprecated":false,"title":"to_ipc(df, entry, compression, streaming)","anchor":"c:to_ipc/4"},{"id":"to_ipc_stream/3","deprecated":false,"title":"to_ipc_stream(df, entry, compression)","anchor":"c:to_ipc_stream/3"},{"id":"to_lazy/1","deprecated":false,"title":"to_lazy(df)","anchor":"c:to_lazy/1"},{"id":"to_ndjson/2","deprecated":false,"title":"to_ndjson(df, entry)","anchor":"c:to_ndjson/2"},{"id":"to_parquet/4","deprecated":false,"title":"to_parquet(df, entry, compression, streaming)","anchor":"c:to_parquet/4"},{"id":"to_rows/2","deprecated":false,"title":"to_rows(df, atom_keys?)","anchor":"c:to_rows/2"},{"id":"to_rows_stream/3","deprecated":false,"title":"to_rows_stream(df, atom_keys?, chunk_size)","anchor":"c:to_rows_stream/3"}],"key":"callbacks"},{"name":"Functions","nodes":[{"id":"inspect/5","deprecated":false,"title":"inspect(df, backend, n_rows, inspect_opts, opts \\\\ [])","anchor":"inspect/5"},{"id":"new/3","deprecated":false,"title":"new(data, names, dtypes)","anchor":"new/3"}],"key":"functions"}]},{"id":"Explorer.Backend.LazyFrame","deprecated":false,"group":"Backends","title":"Explorer.Backend.LazyFrame","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"Explorer.Backend.LazySeries","deprecated":false,"group":"Backends","title":"Explorer.Backend.LazySeries","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"}],"key":"types"}]},{"id":"Explorer.Backend.Series","deprecated":false,"group":"Backends","title":"Explorer.Backend.Series","sections":[],"nodeGroups":[{"name":"Types","nodes":[{"id":"df/0","deprecated":false,"title":"df()","anchor":"t:df/0"},{"id":"dtype/0","deprecated":false,"title":"dtype()","anchor":"t:dtype/0"},{"id":"lazy_s/0","deprecated":false,"title":"lazy_s()","anchor":"t:lazy_s/0"},{"id":"non_finite/0","deprecated":false,"title":"non_finite()","anchor":"t:non_finite/0"},{"id":"option/1","deprecated":false,"title":"option(type)","anchor":"t:option/1"},{"id":"s/0","deprecated":false,"title":"s()","anchor":"t:s/0"},{"id":"t/0","deprecated":false,"title":"t()","anchor":"t:t/0"},{"id":"valid_types/0","deprecated":false,"title":"valid_types()","anchor":"t:valid_types/0"}],"key":"types"},{"name":"Callbacks","nodes":[{"id":"abs/1","deprecated":false,"title":"abs(s)","anchor":"c:abs/1"},{"id":"acos/1","deprecated":false,"title":"acos(s)","anchor":"c:acos/1"},{"id":"add/2","deprecated":false,"title":"add(arg1, arg2)","anchor":"c:add/2"},{"id":"all_equal/2","deprecated":false,"title":"all_equal(s, s)","anchor":"c:all_equal/2"},{"id":"argmax/1","deprecated":false,"title":"argmax(s)","anchor":"c:argmax/1"},{"id":"argmin/1","deprecated":false,"title":"argmin(s)","anchor":"c:argmin/1"},{"id":"argsort/3","deprecated":false,"title":"argsort(s, descending?, nils_last)","anchor":"c:argsort/3"},{"id":"asin/1","deprecated":false,"title":"asin(s)","anchor":"c:asin/1"},{"id":"at/2","deprecated":false,"title":"at(s, idx)","anchor":"c:at/2"},{"id":"at_every/2","deprecated":false,"title":"at_every(s, integer)","anchor":"c:at_every/2"},{"id":"atan/1","deprecated":false,"title":"atan(s)","anchor":"c:atan/1"},{"id":"binary_and/2","deprecated":false,"title":"binary_and(s, s)","anchor":"c:binary_and/2"},{"id":"binary_in/2","deprecated":false,"title":"binary_in(s, s)","anchor":"c:binary_in/2"},{"id":"binary_or/2","deprecated":false,"title":"binary_or(s, s)","anchor":"c:binary_or/2"},{"id":"cast/2","deprecated":false,"title":"cast(s, dtype)","anchor":"c:cast/2"},{"id":"categories/1","deprecated":false,"title":"categories(s)","anchor":"c:categories/1"},{"id":"categorise/2","deprecated":false,"title":"categorise(s, s)","anchor":"c:categorise/2"},{"id":"ceil/1","deprecated":false,"title":"ceil(s)","anchor":"c:ceil/1"},{"id":"clip/3","deprecated":false,"title":"clip(s, number, number)","anchor":"c:clip/3"},{"id":"coalesce/2","deprecated":false,"title":"coalesce(s, s)","anchor":"c:coalesce/2"},{"id":"concat/1","deprecated":false,"title":"concat(list)","anchor":"c:concat/1"},{"id":"contains/2","deprecated":false,"title":"contains(s, t)","anchor":"c:contains/2"},{"id":"correlation/3","deprecated":false,"title":"correlation(s, s, ddof)","anchor":"c:correlation/3"},{"id":"cos/1","deprecated":false,"title":"cos(s)","anchor":"c:cos/1"},{"id":"count/1","deprecated":false,"title":"count(s)","anchor":"c:count/1"},{"id":"covariance/2","deprecated":false,"title":"covariance(s, s)","anchor":"c:covariance/2"},{"id":"cumulative_max/2","deprecated":false,"title":"cumulative_max(s, reverse?)","anchor":"c:cumulative_max/2"},{"id":"cumulative_min/2","deprecated":false,"title":"cumulative_min(s, reverse?)","anchor":"c:cumulative_min/2"},{"id":"cumulative_product/2","deprecated":false,"title":"cumulative_product(s, reverse?)","anchor":"c:cumulative_product/2"},{"id":"cumulative_sum/2","deprecated":false,"title":"cumulative_sum(s, reverse?)","anchor":"c:cumulative_sum/2"},{"id":"cut/5","deprecated":false,"title":"cut(s, list, arg3, arg4, arg5)","anchor":"c:cut/5"},{"id":"day_of_week/1","deprecated":false,"title":"day_of_week(s)","anchor":"c:day_of_week/1"},{"id":"distinct/1","deprecated":false,"title":"distinct(s)","anchor":"c:distinct/1"},{"id":"divide/2","deprecated":false,"title":"divide(arg1, arg2)","anchor":"c:divide/2"},{"id":"downcase/1","deprecated":false,"title":"downcase(s)","anchor":"c:downcase/1"},{"id":"dtype/1","deprecated":false,"title":"dtype(s)","anchor":"c:dtype/1"},{"id":"equal/2","deprecated":false,"title":"equal(arg1, arg2)","anchor":"c:equal/2"},{"id":"ewm_mean/5","deprecated":false,"title":"ewm_mean(s, alpha, adjust, min_periods, ignore_nils)","anchor":"c:ewm_mean/5"},{"id":"exp/1","deprecated":false,"title":"exp(s)","anchor":"c:exp/1"},{"id":"fill_missing_with_strategy/2","deprecated":false,"title":"fill_missing_with_strategy(s, arg2)","anchor":"c:fill_missing_with_strategy/2"},{"id":"fill_missing_with_value/2","deprecated":false,"title":"fill_missing_with_value(s, arg2)","anchor":"c:fill_missing_with_value/2"},{"id":"first/1","deprecated":false,"title":"first(s)","anchor":"c:first/1"},{"id":"floor/1","deprecated":false,"title":"floor(s)","anchor":"c:floor/1"},{"id":"format/1","deprecated":false,"title":"format(list)","anchor":"c:format/1"},{"id":"frequencies/1","deprecated":false,"title":"frequencies(s)","anchor":"c:frequencies/1"},{"id":"from_binary/2","deprecated":false,"title":"from_binary(binary, dtype)","anchor":"c:from_binary/2"},{"id":"from_list/2","deprecated":false,"title":"from_list(list, dtype)","anchor":"c:from_list/2"},{"id":"greater/2","deprecated":false,"title":"greater(arg1, arg2)","anchor":"c:greater/2"},{"id":"greater_equal/2","deprecated":false,"title":"greater_equal(arg1, arg2)","anchor":"c:greater_equal/2"},{"id":"head/2","deprecated":false,"title":"head(s, n)","anchor":"c:head/2"},{"id":"hour/1","deprecated":false,"title":"hour(s)","anchor":"c:hour/1"},{"id":"inspect/2","deprecated":false,"title":"inspect(s, opts)","anchor":"c:inspect/2"},{"id":"iotype/1","deprecated":false,"title":"iotype(s)","anchor":"c:iotype/1"},{"id":"is_finite/1","deprecated":false,"title":"is_finite(s)","anchor":"c:is_finite/1"},{"id":"is_infinite/1","deprecated":false,"title":"is_infinite(s)","anchor":"c:is_infinite/1"},{"id":"is_nan/1","deprecated":false,"title":"is_nan(s)","anchor":"c:is_nan/1"},{"id":"is_nil/1","deprecated":false,"title":"is_nil(s)","anchor":"c:is_nil/1"},{"id":"is_not_nil/1","deprecated":false,"title":"is_not_nil(s)","anchor":"c:is_not_nil/1"},{"id":"last/1","deprecated":false,"title":"last(s)","anchor":"c:last/1"},{"id":"less/2","deprecated":false,"title":"less(arg1, arg2)","anchor":"c:less/2"},{"id":"less_equal/2","deprecated":false,"title":"less_equal(arg1, arg2)","anchor":"c:less_equal/2"},{"id":"log/1","deprecated":false,"title":"log(argument)","anchor":"c:log/1"},{"id":"log/2","deprecated":false,"title":"log(argument, base)","anchor":"c:log/2"},{"id":"lstrip/2","deprecated":false,"title":"lstrip(s, arg2)","anchor":"c:lstrip/2"},{"id":"mask/2","deprecated":false,"title":"mask(s, mask)","anchor":"c:mask/2"},{"id":"max/1","deprecated":false,"title":"max(s)","anchor":"c:max/1"},{"id":"mean/1","deprecated":false,"title":"mean(s)","anchor":"c:mean/1"},{"id":"median/1","deprecated":false,"title":"median(s)","anchor":"c:median/1"},{"id":"min/1","deprecated":false,"title":"min(s)","anchor":"c:min/1"},{"id":"minute/1","deprecated":false,"title":"minute(s)","anchor":"c:minute/1"},{"id":"month/1","deprecated":false,"title":"month(s)","anchor":"c:month/1"},{"id":"multiply/2","deprecated":false,"title":"multiply(arg1, arg2)","anchor":"c:multiply/2"},{"id":"n_distinct/1","deprecated":false,"title":"n_distinct(s)","anchor":"c:n_distinct/1"},{"id":"nil_count/1","deprecated":false,"title":"nil_count(s)","anchor":"c:nil_count/1"},{"id":"not_equal/2","deprecated":false,"title":"not_equal(arg1, arg2)","anchor":"c:not_equal/2"},{"id":"peaks/2","deprecated":false,"title":"peaks(s, arg2)","anchor":"c:peaks/2"},{"id":"pow/2","deprecated":false,"title":"pow(arg1, arg2)","anchor":"c:pow/2"},{"id":"product/1","deprecated":false,"title":"product(s)","anchor":"c:product/1"},{"id":"qcut/5","deprecated":false,"title":"qcut(s, list, arg3, arg4, arg5)","anchor":"c:qcut/5"},{"id":"quantile/2","deprecated":false,"title":"quantile(s, float)","anchor":"c:quantile/2"},{"id":"quotient/2","deprecated":false,"title":"quotient(arg1, arg2)","anchor":"c:quotient/2"},{"id":"rank/4","deprecated":false,"title":"rank(s, method, descending, seed)","anchor":"c:rank/4"},{"id":"remainder/2","deprecated":false,"title":"remainder(arg1, arg2)","anchor":"c:remainder/2"},{"id":"reverse/1","deprecated":false,"title":"reverse(s)","anchor":"c:reverse/1"},{"id":"round/2","deprecated":false,"title":"round(s, decimals)","anchor":"c:round/2"},{"id":"rstrip/2","deprecated":false,"title":"rstrip(s, arg2)","anchor":"c:rstrip/2"},{"id":"sample/5","deprecated":false,"title":"sample(s, n_or_frac, replacement, shuffle, seed)","anchor":"c:sample/5"},{"id":"second/1","deprecated":false,"title":"second(s)","anchor":"c:second/1"},{"id":"select/3","deprecated":false,"title":"select(predicate, arg2, arg3)","anchor":"c:select/3"},{"id":"shift/3","deprecated":false,"title":"shift(s, offset, default)","anchor":"c:shift/3"},{"id":"sin/1","deprecated":false,"title":"sin(s)","anchor":"c:sin/1"},{"id":"size/1","deprecated":false,"title":"size(s)","anchor":"c:size/1"},{"id":"skew/2","deprecated":false,"title":"skew(s, bias?)","anchor":"c:skew/2"},{"id":"slice/2","deprecated":false,"title":"slice(s, indices)","anchor":"c:slice/2"},{"id":"slice/3","deprecated":false,"title":"slice(s, offset, length)","anchor":"c:slice/3"},{"id":"sort/3","deprecated":false,"title":"sort(s, descending?, nils_last)","anchor":"c:sort/3"},{"id":"standard_deviation/1","deprecated":false,"title":"standard_deviation(s)","anchor":"c:standard_deviation/1"},{"id":"strftime/2","deprecated":false,"title":"strftime(s, t)","anchor":"c:strftime/2"},{"id":"strip/2","deprecated":false,"title":"strip(s, arg2)","anchor":"c:strip/2"},{"id":"strptime/2","deprecated":false,"title":"strptime(s, t)","anchor":"c:strptime/2"},{"id":"substring/3","deprecated":false,"title":"substring(s, integer, arg3)","anchor":"c:substring/3"},{"id":"subtract/2","deprecated":false,"title":"subtract(arg1, arg2)","anchor":"c:subtract/2"},{"id":"sum/1","deprecated":false,"title":"sum(s)","anchor":"c:sum/1"},{"id":"tail/2","deprecated":false,"title":"tail(s, n)","anchor":"c:tail/2"},{"id":"tan/1","deprecated":false,"title":"tan(s)","anchor":"c:tan/1"},{"id":"to_iovec/1","deprecated":false,"title":"to_iovec(s)","anchor":"c:to_iovec/1"},{"id":"to_list/1","deprecated":false,"title":"to_list(s)","anchor":"c:to_list/1"},{"id":"transform/2","deprecated":false,"title":"transform(s, function)","anchor":"c:transform/2"},{"id":"unary_not/1","deprecated":false,"title":"unary_not(s)","anchor":"c:unary_not/1"},{"id":"unordered_distinct/1","deprecated":false,"title":"unordered_distinct(s)","anchor":"c:unordered_distinct/1"},{"id":"upcase/1","deprecated":false,"title":"upcase(s)","anchor":"c:upcase/1"},{"id":"variance/1","deprecated":false,"title":"variance(s)","anchor":"c:variance/1"},{"id":"window_max/5","deprecated":false,"title":"window_max(s, window_size, weights, min_periods, center)","anchor":"c:window_max/5"},{"id":"window_mean/5","deprecated":false,"title":"window_mean(s, window_size, weights, min_periods, center)","anchor":"c:window_mean/5"},{"id":"window_median/5","deprecated":false,"title":"window_median(s, window_size, weights, min_periods, center)","anchor":"c:window_median/5"},{"id":"window_min/5","deprecated":false,"title":"window_min(s, window_size, weights, min_periods, center)","anchor":"c:window_min/5"},{"id":"window_standard_deviation/5","deprecated":false,"title":"window_standard_deviation(s, window_size, weights, min_periods, center)","anchor":"c:window_standard_deviation/5"},{"id":"window_sum/5","deprecated":false,"title":"window_sum(s, window_size, weights, min_periods, center)","anchor":"c:window_sum/5"},{"id":"year/1","deprecated":false,"title":"year(s)","anchor":"c:year/1"}],"key":"callbacks"},{"name":"Functions","nodes":[{"id":"inspect/5","deprecated":false,"title":"inspect(series, backend, n_rows, inspect_opts, opts \\\\ [])","anchor":"inspect/5"},{"id":"new/2","deprecated":false,"title":"new(data, dtype)","anchor":"new/2"}],"key":"functions"}]},{"id":"Explorer.PolarsBackend","deprecated":false,"group":"Backends","title":"Explorer.PolarsBackend","sections":[]}],"extras":[{"id":"api-reference","group":"","title":"API Reference","headers":[{"id":"Modules","anchor":"modules"}]},{"id":"exploring_explorer","group":"","title":"Ten Minutes to Explorer","headers":[{"id":"Introduction","anchor":"introduction"},{"id":"Reading and writing data","anchor":"reading-and-writing-data"},{"id":"Working with Series","anchor":"working-with-series"},{"id":"Working with DataFrames","anchor":"working-with-dataframes"}]},{"id":"changelog","group":"","title":"Changelog","headers":[{"id":"Unreleased","anchor":"unreleased"},{"id":"v0.6.1 - 2023-07-06","anchor":"v0-6-1-2023-07-06"},{"id":"v0.6.0 - 2023-07-05","anchor":"v0-6-0-2023-07-05"},{"id":"v0.5.7 - 2023-05-10","anchor":"v0-5-7-2023-05-10"},{"id":"v0.5.6 - 2023-03-24","anchor":"v0-5-6-2023-03-24"},{"id":"v0.5.5 - 2023-03-13","anchor":"v0-5-5-2023-03-13"},{"id":"v0.5.4 - 2023-03-09","anchor":"v0-5-4-2023-03-09"},{"id":"v0.5.3 - 2023-03-08","anchor":"v0-5-3-2023-03-08"},{"id":"v0.5.2 - 2023-02-28","anchor":"v0-5-2-2023-02-28"},{"id":"v0.5.1 - 2023-02-17","anchor":"v0-5-1-2023-02-17"},{"id":"v0.5.0 - 2023-01-12","anchor":"v0-5-0-2023-01-12"},{"id":"v0.4.0 - 2022-11-29","anchor":"v0-4-0-2022-11-29"},{"id":"v0.3.1 - 2022-09-09","anchor":"v0-3-1-2022-09-09"},{"id":"v0.3.0 - 2022-09-01","anchor":"v0-3-0-2022-09-01"},{"id":"v0.2.0 - 2022-06-22","anchor":"v0-2-0-2022-06-22"},{"id":"v0.1.1 - 2022-04-27","anchor":"v0-1-1-2022-04-27"},{"id":"v0.1.0 - 2022-04-26","anchor":"v0-1-0-2022-04-26"}]}],"tasks":[]} \ No newline at end of file diff --git a/exploring_explorer.html b/exploring_explorer.html index 80c072441..fe430fd5f 100644 --- a/exploring_explorer.html +++ b/exploring_explorer.html @@ -13,7 +13,7 @@ - + @@ -115,10 +115,10 @@

      -
      Mix.install([
      -  {:explorer, "~> 0.6.0"},
      -  {:kino, "~> 0.9.0"}
      -])

      +
      Mix.install([
      +  {:explorer, "~> 0.6.0"},
      +  {:kino, "~> 0.9.0"}
      +])

      Introduction @@ -131,29 +131,29 @@

      Reading and writing data

      -

      Data can be read from delimited files (like CSV), NDJSON, Parquet, and the Arrow IPC (feather) format. You can also load in data from a map or keyword list of columns with Explorer.DataFrame.new/1.

      For CSV, your 'usual suspects' of options are available:

      • delimiter - A single character used to separate fields within a record. (default: ",")
      • dtypes - A keyword list of [column_name: dtype]. If a type is not specified for a column, it is imputed from the first 1000 rows. (default: [])
      • header - Does the file have a header of column names as the first row or not? (default: true)
      • max_rows - Maximum number of lines to read. (default: nil)
      • nil_values - A list of strings that should be interpreted as a nil values. (default: [])
      • skip_rows - The number of lines to skip at the beginning of the file. (default: 0)
      • columns - A list of column names to keep. If present, only these columns are read into the dataframe. (default: nil)

      Explorer also has multiple example datasets built in, which you can load from the Explorer.Datasets module like so:

      df = Explorer.Datasets.fossil_fuels()

      You'll notice that the output looks slightly different than many dataframe libraries. Explorer takes inspiration on this front from glimpse in R. A benefit to this approach is that you will rarely need to elide columns.

      If you'd like to see a table with your data, we've got you covered there too.

      Explorer.DataFrame.table(df)

      Writing files is very similar to reading them. The options are a little more limited:

      • header - Should the column names be written as the first line of the file? (default: true)
      • delimiter - A single character used to separate fields within a record. (default: ",")

      First, let's add some useful aliases:

      alias Explorer.DataFrame
      -alias Explorer.Series

      And then write to a file of your choosing:

      input = Kino.Input.text("Filename")
      filename = Kino.Input.read(input)
      -DataFrame.to_csv(df, filename)

      +

      Data can be read from delimited files (like CSV), NDJSON, Parquet, and the Arrow IPC (feather) format. You can also load in data from a map or keyword list of columns with Explorer.DataFrame.new/1.

      For CSV, your 'usual suspects' of options are available:

      • delimiter - A single character used to separate fields within a record. (default: ",")
      • dtypes - A keyword list of [column_name: dtype]. If a type is not specified for a column, it is imputed from the first 1000 rows. (default: [])
      • header - Does the file have a header of column names as the first row or not? (default: true)
      • max_rows - Maximum number of lines to read. (default: nil)
      • nil_values - A list of strings that should be interpreted as a nil values. (default: [])
      • skip_rows - The number of lines to skip at the beginning of the file. (default: 0)
      • columns - A list of column names to keep. If present, only these columns are read into the dataframe. (default: nil)

      Explorer also has multiple example datasets built in, which you can load from the Explorer.Datasets module like so:

      df = Explorer.Datasets.fossil_fuels()

      You'll notice that the output looks slightly different than many dataframe libraries. Explorer takes inspiration on this front from glimpse in R. A benefit to this approach is that you will rarely need to elide columns.

      If you'd like to see a table with your data, we've got you covered there too.

      Explorer.DataFrame.table(df)

      Writing files is very similar to reading them. The options are a little more limited:

      • header - Should the column names be written as the first line of the file? (default: true)
      • delimiter - A single character used to separate fields within a record. (default: ",")

      First, let's add some useful aliases:

      alias Explorer.DataFrame
      +alias Explorer.Series

      And then write to a file of your choosing:

      input = Kino.Input.text("Filename")
      filename = Kino.Input.read(input)
      +DataFrame.to_csv(df, filename)

      Working with Series

      -

      Explorer, like Polars, works up from the concept of a Series. In many ways, you can think of a dataframe as a row-aligned map of Series. These are like vectors in R or series in Pandas.

      For simplicity, Explorer uses the following Series dtypes:

      • :float - 64-bit floating point number
      • :integer - 64-bit signed integer
      • :boolean - Boolean
      • :string - UTF-8 encoded binary
      • :date - Date type that unwraps to Elixir.Date
      • :datetime - DateTime type that unwraps to Elixir.NaiveDateTime

      Series can be constructed from Elixir basic types. For example:

      s1 = Series.from_list([1, 2, 3])
      s2 = Series.from_list(["a", "b", "c"])
      s3 = Series.from_list([~D[2011-01-01], ~D[1965-01-21]])

      You'll notice that the dtype and size of the Series are at the top of the printed value. You can get those programmatically as well.

      Series.dtype(s3)
      Series.size(s3)

      And the printed values max out at 50:

      1..100 |> Enum.to_list() |> Series.from_list()

      Series are also nullable.

      s = Series.from_list([1.0, 2.0, nil, nil, 5.0])

      And you can fill in those missing values using one of the following strategies:

      • :forward - replace nil with the previous value
      • :backward - replace nil with the next value
      • :max - replace nil with the series maximum
      • :min - replace nil with the series minimum
      • :mean - replace nil with the series mean
      Series.fill_missing(s, :forward)

      In the case of mixed numeric types (i.e. integers and floats), Series will downcast to a float:

      Series.from_list([1, 2.0])

      In all other cases, Series must all be of the same dtype or else you'll get an ArgumentError.

      Series.from_list([1, 2, 3, "a"])

      One of the goals of Explorer is useful error messages. If you look at the error above, you get:

      Cannot make a series from mismatched types. Type of "a" does not match inferred dtype integer.

      Hopefully this makes abundantly clear what's going on.

      Series also implements the Access protocol. You can slice and dice in many ways:

      s = 1..10 |> Enum.to_list() |> Series.from_list()
      s[1]
      s[-1]
      s[0..4]
      s[[0, 4, 4]]

      And of course, you can convert back to an Elixir list.

      Series.to_list(s)

      Explorer supports comparisons.

      s = 1..11 |> Enum.to_list() |> Series.from_list()
      s1 = 11..1 |> Enum.to_list() |> Series.from_list()
      Series.equal(s, s1)
      Series.equal(s, 5)
      Series.not_equal(s, 10)
      Series.greater_equal(s, 4)

      And arithmetic.

      Series.add(s, s1)
      Series.subtract(s, 4)
      Series.multiply(s, s1)

      Remember those helpful errors? We've tried to add those throughout. So if you try to do arithmetic with mismatching dtypes:

      s = Series.from_list([1, 2, 3])
      -s1 = Series.from_list([1.0, 2.0, 3.0])
      -Series.add(s, s1)

      Just kidding! Integers and floats will downcast to floats. Let's try again:

      s = Series.from_list([1, 2, 3])
      -s1 = Series.from_list(["a", "b", "c"])
      -Series.add(s, s1)

      You can flip them around.

      s = Series.from_list([1, 2, 3, 4])
      -Series.reverse(s)

      And sort.

      1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list() |> Series.sort()

      Or argsort.

      s = 1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list()
      -ids = Series.argsort(s) |> Series.to_list()

      Which you can pass to Explorer.Series.slice/2 if you want the sorted values.

      Series.slice(s, ids)

      You can calculate cumulative values.

      s = 1..100 |> Enum.to_list() |> Series.from_list()
      -Series.cumulative_sum(s)

      Or rolling ones.

      Series.window_sum(s, 4)

      You can count and list unique values.

      s = Series.from_list(["a", "b", "b", "c", "c", "c"])
      -Series.distinct(s)
      Series.n_distinct(s)

      And you can even get a dataframe showing the frequencies for each distinct value.

      Series.frequencies(s)

      +

      Explorer, like Polars, works up from the concept of a Series. In many ways, you can think of a dataframe as a row-aligned map of Series. These are like vectors in R or series in Pandas.

      For simplicity, Explorer uses the following Series dtypes:

      • :float - 64-bit floating point number
      • :integer - 64-bit signed integer
      • :boolean - Boolean
      • :string - UTF-8 encoded binary
      • :date - Date type that unwraps to Elixir.Date
      • :datetime - DateTime type that unwraps to Elixir.NaiveDateTime

      Series can be constructed from Elixir basic types. For example:

      s1 = Series.from_list([1, 2, 3])
      s2 = Series.from_list(["a", "b", "c"])
      s3 = Series.from_list([~D[2011-01-01], ~D[1965-01-21]])

      You'll notice that the dtype and size of the Series are at the top of the printed value. You can get those programmatically as well.

      Series.dtype(s3)
      Series.size(s3)

      And the printed values max out at 50:

      1..100 |> Enum.to_list() |> Series.from_list()

      Series are also nullable.

      s = Series.from_list([1.0, 2.0, nil, nil, 5.0])

      And you can fill in those missing values using one of the following strategies:

      • :forward - replace nil with the previous value
      • :backward - replace nil with the next value
      • :max - replace nil with the series maximum
      • :min - replace nil with the series minimum
      • :mean - replace nil with the series mean
      Series.fill_missing(s, :forward)

      In the case of mixed numeric types (i.e. integers and floats), Series will downcast to a float:

      Series.from_list([1, 2.0])

      In all other cases, Series must all be of the same dtype or else you'll get an ArgumentError.

      Series.from_list([1, 2, 3, "a"])

      One of the goals of Explorer is useful error messages. If you look at the error above, you get:

      Cannot make a series from mismatched types. Type of "a" does not match inferred dtype integer.

      Hopefully this makes abundantly clear what's going on.

      Series also implements the Access protocol. You can slice and dice in many ways:

      s = 1..10 |> Enum.to_list() |> Series.from_list()
      s[1]
      s[-1]
      s[0..4]
      s[[0, 4, 4]]

      And of course, you can convert back to an Elixir list.

      Series.to_list(s)

      Explorer supports comparisons.

      s = 1..11 |> Enum.to_list() |> Series.from_list()
      s1 = 11..1 |> Enum.to_list() |> Series.from_list()
      Series.equal(s, s1)
      Series.equal(s, 5)
      Series.not_equal(s, 10)
      Series.greater_equal(s, 4)

      And arithmetic.

      Series.add(s, s1)
      Series.subtract(s, 4)
      Series.multiply(s, s1)

      Remember those helpful errors? We've tried to add those throughout. So if you try to do arithmetic with mismatching dtypes:

      s = Series.from_list([1, 2, 3])
      +s1 = Series.from_list([1.0, 2.0, 3.0])
      +Series.add(s, s1)

      Just kidding! Integers and floats will downcast to floats. Let's try again:

      s = Series.from_list([1, 2, 3])
      +s1 = Series.from_list(["a", "b", "c"])
      +Series.add(s, s1)

      You can flip them around.

      s = Series.from_list([1, 2, 3, 4])
      +Series.reverse(s)

      And sort.

      1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list() |> Series.sort()

      Or argsort.

      s = 1..100 |> Enum.to_list() |> Enum.shuffle() |> Series.from_list()
      +ids = Series.argsort(s) |> Series.to_list()

      Which you can pass to Explorer.Series.slice/2 if you want the sorted values.

      Series.slice(s, ids)

      You can calculate cumulative values.

      s = 1..100 |> Enum.to_list() |> Series.from_list()
      +Series.cumulative_sum(s)

      Or rolling ones.

      Series.window_sum(s, 4)

      You can count and list unique values.

      s = Series.from_list(["a", "b", "b", "c", "c", "c"])
      +Series.distinct(s)
      Series.n_distinct(s)

      And you can even get a dataframe showing the frequencies for each distinct value.

      Series.frequencies(s)

      Working with DataFrames

      -

      A DataFrame is really just a collection of Series of the same size. Which is why you can create a DataFrame from a Keyword list.

      DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])

      Similarly to Series, the Inspect implementation prints some info at the top and to the left. At the top we see the shape of the dataframe (rows and columns) and then for each column we see the name, dtype, and first five values. We can see a bit more from that built-in dataset we loaded in earlier.

      df

      You will also see grouping information there, but we'll get to that later. You can get the info yourself directly:

      DataFrame.names(df)
      DataFrame.dtypes(df)
      DataFrame.shape(df)
      {DataFrame.n_rows(df), DataFrame.n_columns(df)}

      We can grab the head.

      DataFrame.head(df)

      Or the tail. Let's get a few more values from the tail.

      DataFrame.tail(df, 10)

      +

      A DataFrame is really just a collection of Series of the same size. Which is why you can create a DataFrame from a Keyword list.

      DataFrame.new(a: [1, 2, 3], b: ["a", "b", "c"])

      Similarly to Series, the Inspect implementation prints some info at the top and to the left. At the top we see the shape of the dataframe (rows and columns) and then for each column we see the name, dtype, and first five values. We can see a bit more from that built-in dataset we loaded in earlier.

      df

      You will also see grouping information there, but we'll get to that later. You can get the info yourself directly:

      DataFrame.names(df)
      DataFrame.dtypes(df)
      DataFrame.shape(df)
      {DataFrame.n_rows(df), DataFrame.n_columns(df)}

      We can grab the head.

      DataFrame.head(df)

      Or the tail. Let's get a few more values from the tail.

      DataFrame.tail(df, 10)

      Verbs and macros @@ -168,103 +168,103 @@

      Select

      -

      Let's jump right into it. We can select columns pretty simply.

      DF.select(df, ["year", "country"])

      But Elixir gives us some superpowers. In R there's tidy-select. I don't think we need that in Elixir. Anywhere in Explorer where you need to pass a list of column names, you can also execute a filtering callback on the column names. It's just an anonymous function passed to df |> DataFrame.names() |> Enum.filter(callback_here).

      DF.select(df, &String.ends_with?(&1, "fuel"))

      Want all but some columns? discard/2 performs the opposite of select/2.

      DF.discard(df, &String.ends_with?(&1, "fuel"))

      +

      Let's jump right into it. We can select columns pretty simply.

      DF.select(df, ["year", "country"])

      But Elixir gives us some superpowers. In R there's tidy-select. I don't think we need that in Elixir. Anywhere in Explorer where you need to pass a list of column names, you can also execute a filtering callback on the column names. It's just an anonymous function passed to df |> DataFrame.names() |> Enum.filter(callback_here).

      DF.select(df, &String.ends_with?(&1, "fuel"))

      Want all but some columns? discard/2 performs the opposite of select/2.

      DF.discard(df, &String.ends_with?(&1, "fuel"))

      Filter

      The next verb we'll look at is filter.

      This is implemented using a macro, so it's possible to use expressions -like you would if comparing variables in Elixir:

      DF.filter(df, country == "BRAZIL")

      Using complex filters is also possible:

      DF.filter(df, country == "ALGERIA" and year > 2012)

      You can also write the same filter without the macro, by using the callback version function which is filter_with/2:

      DF.filter_with(df, fn ldf ->
      -  ldf["country"]
      -  |> Series.equal("ALGERIA")
      -  |> Series.and(Series.greater(ldf["year"], 2012))
      -end)

      By the way, all the Explorer.DataFrame macros have a correspondent function that accepts a callback. +like you would if comparing variables in Elixir:

      DF.filter(df, country == "BRAZIL")

      Using complex filters is also possible:

      DF.filter(df, country == "ALGERIA" and year > 2012)

      You can also write the same filter without the macro, by using the callback version function which is filter_with/2:

      DF.filter_with(df, fn ldf ->
      +  ldf["country"]
      +  |> Series.equal("ALGERIA")
      +  |> Series.and(Series.greater(ldf["year"], 2012))
      +end)

      By the way, all the Explorer.DataFrame macros have a correspondent function that accepts a callback. In fact, our macros are implemented using those functions.

      The filter_with/2 function is going to use a virtual representation of the dataframe that we call a "lazy frame". With lazy frames you canĀ“t access the -series contents, but every operation will be optimized and run only once.

      Remember those helpful error messages?

      DF.filter(df, cuontry == "BRAZIL")

      +series contents, but every operation will be optimized and run only once.

      Remember those helpful error messages?

      DF.filter(df, cuontry == "BRAZIL")

      Mutate

      -

      A common task in data analysis is to add columns or change existing ones. Mutate is a handy verb.

      DF.mutate(df, new_column: solid_fuel + cement)

      Did you catch that? You can pass in new columns as keyword arguments. It also works to transform existing columns.

      DF.mutate(df,
      -  gas_fuel: Series.cast(gas_fuel, :float),
      +

      A common task in data analysis is to add columns or change existing ones. Mutate is a handy verb.

      DF.mutate(df, new_column: solid_fuel + cement)

      Did you catch that? You can pass in new columns as keyword arguments. It also works to transform existing columns.

      DF.mutate(df,
      +  gas_fuel: Series.cast(gas_fuel, :float),
         gas_and_liquid_fuel: gas_fuel + liquid_fuel
      -)

      DataFrame.mutate/2 is flexible though. You may not always want to use keyword arguments. Given that column names are String.t(), it may make more sense to use a map.

      DF.mutate(df, %{"gas_fuel" => gas_fuel - 10})

      DF.transmute/2, which is DF.mutate/2 that only retains the specified columns, is forthcoming.

      +)

      DataFrame.mutate/2 is flexible though. You may not always want to use keyword arguments. Given that column names are String.t(), it may make more sense to use a map.

      DF.mutate(df, %{"gas_fuel" => gas_fuel - 10})

      DF.transmute/2, which is DF.mutate/2 that only retains the specified columns, is forthcoming.

      Arrange

      -

      Sorting the dataframe is pretty straightforward.

      DF.arrange(df, year)

      But it comes with some tricks up its sleeve.

      DF.arrange(df, asc: total, desc: year)

      As the examples show, arrange/2 is a macro, and therefore you can use some functions to arrange your dataframe:

      DF.arrange(df, asc: Series.window_sum(total, 2))

      Sort operations happen left to right. And keyword list args permit specifying the direction.

      +

      Sorting the dataframe is pretty straightforward.

      DF.arrange(df, year)

      But it comes with some tricks up its sleeve.

      DF.arrange(df, asc: total, desc: year)

      As the examples show, arrange/2 is a macro, and therefore you can use some functions to arrange your dataframe:

      DF.arrange(df, asc: Series.window_sum(total, 2))

      Sort operations happen left to right. And keyword list args permit specifying the direction.

      Distinct

      -

      Okay, as expected here too. Very straightforward.

      DF.distinct(df, ["year", "country"])

      You can specify whether to keep the other columns as well, so the first row of each distinct value is kept:

      DF.distinct(df, ["country"], keep_all: true)

      +

      Okay, as expected here too. Very straightforward.

      DF.distinct(df, ["year", "country"])

      You can specify whether to keep the other columns as well, so the first row of each distinct value is kept:

      DF.distinct(df, ["country"], keep_all: true)

      Rename

      -

      Rename can take either a list of new names or a callback that is passed to Enum.map/2 against the names. You can also use a map or keyword args to rename specific columns.

      DF.rename(df, year: "year_test")
      DF.rename_with(df, &(&1 <> "_test"))

      +

      Rename can take either a list of new names or a callback that is passed to Enum.map/2 against the names. You can also use a map or keyword args to rename specific columns.

      DF.rename(df, year: "year_test")
      DF.rename_with(df, &(&1 <> "_test"))

      Dummies

      -

      This is fun! We can get dummy variables for unique values.

      DF.dummies(df, ["year"])
      DF.dummies(df, ["country"])

      +

      This is fun! We can get dummy variables for unique values.

      DF.dummies(df, ["year"])
      DF.dummies(df, ["country"])

      Sampling

      -

      Random samples can give us a percent or a specific number of samples, with or without replacement, and the function is seedable.

      DF.sample(df, 10)
      DF.sample(df, 0.4)

      Trying for those helpful error messages again.

      DF.sample(df, 10000)
      DF.sample(df, 10000, replacement: true)

      +

      Random samples can give us a percent or a specific number of samples, with or without replacement, and the function is seedable.

      DF.sample(df, 10)
      DF.sample(df, 0.4)

      Trying for those helpful error messages again.

      DF.sample(df, 10000)
      DF.sample(df, 10000, replacement: true)

      Pull and slice

      -

      Slicing and dicing can be done with the Access protocol or with explicit pull/slice/take functions.

      df["year"]
      DF.pull(df, "year")
      df[["year", "country"]]
      DF.slice(df, [1, 20, 50])

      Negative offsets work for slice!

      DF.slice(df, -10, 5)
      DF.slice(df, 10, 5)

      Slice also works with ranges:

      DF.slice(df, 12..42)

      +

      Slicing and dicing can be done with the Access protocol or with explicit pull/slice/take functions.

      df["year"]
      DF.pull(df, "year")
      df[["year", "country"]]
      DF.slice(df, [1, 20, 50])

      Negative offsets work for slice!

      DF.slice(df, -10, 5)
      DF.slice(df, 10, 5)

      Slice also works with ranges:

      DF.slice(df, 12..42)

      Pivot

      -

      We can pivot_longer/3 and pivot_wider/4. These are inspired by tidyr.

      There are some shortcomings in pivot_wider/4 related to polars. The select option must select only columns of numeric type.

      DF.pivot_longer(df, ["year", "country"], select: &String.ends_with?(&1, "fuel"))
      DF.pivot_wider(df, "country", "total", id_columns: ["year"])

      Let's make those names look nicer!

      tidy_names = fn name ->
      +

      We can pivot_longer/3 and pivot_wider/4. These are inspired by tidyr.

      There are some shortcomings in pivot_wider/4 related to polars. The select option must select only columns of numeric type.

      DF.pivot_longer(df, ["year", "country"], select: &String.ends_with?(&1, "fuel"))
      DF.pivot_wider(df, "country", "total", id_columns: ["year"])

      Let's make those names look nicer!

      tidy_names = fn name ->
         name
      -  |> String.downcase()
      -  |> String.replace(~r/\s/, " ")
      -  |> String.replace(~r/[^A-Za-z\s]/, "")
      -  |> String.replace(" ", "_")
      -end
      +  |> String.downcase()
      +  |> String.replace(~r/\s/, " ")
      +  |> String.replace(~r/[^A-Za-z\s]/, "")
      +  |> String.replace(" ", "_")
      +end
       
       df
      -|> DF.pivot_wider("country", "total", id_columns: ["year"])
      -|> DF.rename_with(tidy_names)

      +|> DF.pivot_wider("country", "total", id_columns: ["year"]) +|> DF.rename_with(tidy_names)

      Joins

      -

      Joining is fast and easy. You can specify the columns to join on and how to join. Polars even supports cartesian (cross) joins, so Explorer does too.

      df1 = DF.select(df, ["year", "country", "total"])
      -df2 = DF.select(df, ["year", "country", "cement"])
      +

      Joining is fast and easy. You can specify the columns to join on and how to join. Polars even supports cartesian (cross) joins, so Explorer does too.

      df1 = DF.select(df, ["year", "country", "total"])
      +df2 = DF.select(df, ["year", "country", "cement"])
       
      -DF.join(df1, df2)
      df3 = df |> DF.select(["year", "cement"]) |> DF.slice(0, 500)
      +DF.join(df1, df2)
      df3 = df |> DF.select(["year", "cement"]) |> DF.slice(0, 500)
       
      -DF.join(df1, df3, how: :left)

      +DF.join(df1, df3, how: :left)

      Grouping

      -

      Explorer supports groupby operations. They're limited based on what's possible in Polars, but they do most of what you need to do.

      grouped = DF.group_by(df, ["country"])

      Notice that the Inspect call now shows groups as well as rows and columns. You can, of course, get them explicitly.

      DF.groups(grouped)

      And you can ungroup explicitly.

      DF.ungroup(grouped)

      But what we care about the most is aggregating! Let's see which country has the max per_capita value.

      grouped
      -|> DF.summarise(max_per_capita: max(per_capita))
      -|> DF.arrange(desc: max_per_capita)

      Qatar it is.

      You may noticed that we are using max/1 inside the summarise macro. This is possible because we expose all functions from the Series module. You can use the following aggregations inside summarise:

      The API is similar to mutate: you can use keyword args or a map and specify aggregations to use.

      DF.summarise(grouped, min_per_capita: min(per_capita), min_total: min(total))

      Speaking of mutate, it's 'group-aware'. As are arrange, distinct, and n_rows.

      DF.mutate(grouped, total_window_sum: window_sum(total, 3), rows_in_group: count(country))

      It's also possible to use aggregations inside other functions:

      grouped
      -|> DF.summarise(greater_than_9: greater(max(per_capita), 9.0), per_capita_max: max(per_capita))
      -|> DataFrame.arrange(desc: per_capita_max)

      +

      Explorer supports groupby operations. They're limited based on what's possible in Polars, but they do most of what you need to do.

      grouped = DF.group_by(df, ["country"])

      Notice that the Inspect call now shows groups as well as rows and columns. You can, of course, get them explicitly.

      DF.groups(grouped)

      And you can ungroup explicitly.

      DF.ungroup(grouped)

      But what we care about the most is aggregating! Let's see which country has the max per_capita value.

      grouped
      +|> DF.summarise(max_per_capita: max(per_capita))
      +|> DF.arrange(desc: max_per_capita)

      Qatar it is.

      You may noticed that we are using max/1 inside the summarise macro. This is possible because we expose all functions from the Series module. You can use the following aggregations inside summarise:

      The API is similar to mutate: you can use keyword args or a map and specify aggregations to use.

      DF.summarise(grouped, min_per_capita: min(per_capita), min_total: min(total))

      Speaking of mutate, it's 'group-aware'. As are arrange, distinct, and n_rows.

      DF.mutate(grouped, total_window_sum: window_sum(total, 3), rows_in_group: count(country))

      It's also possible to use aggregations inside other functions:

      grouped
      +|> DF.summarise(greater_than_9: greater(max(per_capita), 9.0), per_capita_max: max(per_capita))
      +|> DataFrame.arrange(desc: per_capita_max)

      That's it! diff --git a/search.html b/search.html index c25d0ab15..b539b0953 100644 --- a/search.html +++ b/search.html @@ -13,7 +13,7 @@ - + @@ -105,7 +105,7 @@

      - +