Nushell Plugin Encoder: msgpack Version: 0.117.0 Plugin file path: /usr/bin/nu_plugin_polars Command: polars Description: > Operate with data in a dataframe format. Extra description: > You must use one of the subcommands below. Using this command as-is will only produce this help message. The following are the main datatypes (wrapped from Polars) that are used by these subcommands: Lazy and Strict dataframes (called `NuLazyFrame` and `NuDataFrame` in error messages) are the main data structure. Expressions, representing various column operations (called `NuExpression`), are passed to many commands such as `polars filter` or `polars with-column`. Most nushell operators are supported in these expressions, importantly arithmetic, comparison and boolean logical. Groupbys (`NuLazyGroupBy`), the output of a `polars group-by`, represent a grouped dataframe and are typically piped to the `polars agg` command with some column expressions for aggregation which then returns a dataframe. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars cumulative Description: > Cumulative calculation for a column or series. Flags: -h, --help: Display the help message for this command -r, --reverse: Reverse cumulative calculation. Parameters: type : Rolling operation. Values of min, max, and sum are accepted. ====================== Command: polars agg-groups Description: > Creates an agg_groups expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars count Description: > Returns the number of non-null values in the column. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars implode Description: > Aggregates values into a list. Flags: -h, --help: Display the help message for this command -o, --maintain-order: Maintains the order of the original values in the list Parameters: ====================== Command: polars max Description: > Creates a max expression or aggregates columns to their max value. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars mean Description: > Creates a mean expression for an aggregation or aggregates columns to their mean value. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars min Description: > Creates a min expression or aggregates columns to their min value. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars std Description: > Creates a std expression for an aggregation of std value from columns in a dataframe. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars sum Description: > Creates a sum expression for an aggregation or aggregates columns to their sum value. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars var Description: > Create a var expression for an aggregation. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars horizontal Description: > Horizontal calculation across multiple columns. Flags: -h, --help: Display the help message for this command -n, --nulls: If set, null value in the input will lead to null output. Parameters: type : Horizontal operation. Values of all, any, min, max, sum, and mean are accepted. ...Group-by expressions : Expression(s) that define the lazy group-by. ====================== Command: polars agg Description: > Performs a series of aggregations from a group-by. Flags: -h, --help: Display the help message for this command Parameters: ...Group-by expressions : Expression(s) that define the aggregations to be applied. ====================== Command: polars count-null Description: > Counts null values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars n-unique Description: > Counts unique values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars over Description: > Compute expressions over a window group defined by partition expressions. Flags: -h, --help: Display the help message for this command Parameters: ...partition by expressions : Expression(s) that define the partition window. ====================== Command: polars rolling Description: > Rolling calculation for a series or expression, or a rolling group-by for a lazyframe. Flags: -h, --help: Display the help message for this command -i, --index-column : Time or index column to roll over. Required for lazyframe input. -p, --period >: Rolling window width (e.g. 7day, "7d", 1wk, "1mo", "2i", ). Required for lazyframe input. -o, --offset >: Offset of the rolling window relative to the index column (default: 1ns). -c, --closed : Which boundary of the window is closed: left, right, both, none (default: left). -g, --group-by >: Additional expressions to group by within each rolling window. Parameters: (optional) type : Rolling operation (min, max, sum, mean). Required for dataframe and expression inputs. (optional) window : Window size for rolling. Required for dataframe and expression inputs. ====================== Command: polars value-counts Description: > Returns a dataframe with the counts for unique values in series. Flags: -h, --help: Display the help message for this command -c, --column : Provide a custom name for the count column. -s, --sort: Whether or not values should be sorted. -p, --parallel: Use multiple threads when processing. -n, --normalize : Normalize the counts. Parameters: ====================== Command: polars group-by Description: > Creates a group-by object that can be used for other aggregations. Flags: -h, --help: Display the help message for this command -m, --maintain-order: Ensure that the order of the groups is consistent with the input data. This is slower than a default group by and cannot be run on the streaming engine. Parameters: ...Group-by expressions : Expression(s) that define the lazy group-by. ====================== Command: polars median Description: > Median value from columns in a dataframe or creates expression for an aggregation Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars quantile Description: > Aggregates the columns to the selected quantile. Flags: -h, --help: Display the help message for this command Parameters: quantile : Quantile value for quantile operation. ====================== Command: polars all-false Description: > Returns true if all values are false. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars all-true Description: > Returns true if all values are true. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars arg-true Description: > Returns indexes where values are true. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars is-in Description: > Creates an is-in expression or checks to see if the elements are contained in the right series Flags: -h, --help: Display the help message for this command -o, --maintain-order: Maintains the order of the original values in the list Parameters: list : List to check if values are in. ====================== Command: polars otherwise Description: > Completes a when expression. Flags: -h, --help: Display the help message for this command Parameters: otherwise expression : Expression to apply when no when predicate matches. ====================== Command: polars when Description: > Creates and modifies a when expression. Flags: -h, --help: Display the help message for this command Parameters: when expression : When expression used for matching. then expression : Expression that will be applied when predicate is true. ====================== Command: polars expr-not Description: > Creates a not expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars is-duplicated Description: > Creates mask indicating duplicated values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars is-not-null Description: > Creates mask where value is not null. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars is-null Description: > Creates mask where value is null. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars is-unique Description: > Creates mask indicating unique values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars not Description: > Inverts boolean mask. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars set Description: > Sets value where given mask is true. Flags: -m, --mask (required parameter) : Mask indicating insertions. -h, --help: Display the help message for this command Parameters: value : Value to be inserted in series. ====================== Command: polars columns Description: > Show dataframe columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars cache Description: > Caches operations in a new LazyFrame. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars open Description: > Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. Flags: -h, --help: Display the help message for this command --eager: Open dataframe as an eager dataframe. -t, --type : File type: csv, tsv, json, parquet, arrow, avro. If omitted, derive from file extension. -d, --delimiter : File delimiter character. CSV file. --no-header: Indicates if file doesn't have header. CSV file. --infer-schema : Number of rows to infer the schema of the file. CSV file. --skip-rows : Number of rows to skip from file. CSV file. --columns >: Columns to be selected from csv file. CSV and Parquet file. -s, --schema : Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files. --hive-enabled: Enable hive support. Parquet and Arrow files. --hive-start-idx : Start index of hive partitioning. Parquet and Arrow files. --hive-schema : Hive schema in format [{name: str}]. Parquet and Arrow files. --hive-try-parse-dates: Try to parse dates in hive partitioning. Parquet and Arrow files. --truncate-ragged-lines: Truncate lines that are longer than the schema. CSV file. Parameters: file : File path or cloud url to load values from. ====================== Command: polars profile Description: > Profile a lazy dataframe. Extra description: > This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed. The units of the timings are microseconds. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars summary Description: > For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. Flags: -h, --help: Display the help message for this command -q, --quantiles >: Provide optional quantiles. Parameters: ====================== Command: polars shape Description: > Shows column and row size for a dataframe. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars schema Description: > Show schema for a dataframe. Flags: -h, --help: Display the help message for this command -l, --datatype-list: Creates a lazy dataframe. Parameters: ====================== Command: polars into-nu Description: > Converts a dataframe or an expression into nushell value for access and exploration. Flags: -h, --help: Display the help message for this command -n, --rows : Number of rows to be shown. -t, --tail: Shows tail rows. -i, --index: Add an index column. Parameters: ====================== Command: polars into-df Description: > Converts a list, table or record into a dataframe. Flags: -h, --help: Display the help message for this command -s, --schema : Polars Schema in format [{name: str}]. -c, --as-columns: When input shape is record of lists, treat each list as column values. Parameters: ====================== Command: polars save Description: > Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). Flags: -h, --help: Display the help message for this command -t, --type : File type: csv, json, parquet, arrow/ipc. If omitted, derive from file extension. --avro-compression : Compression for avro supports deflate or snappy. --csv-delimiter : File delimiter character. --csv-no-header: Indicates to exclude a header row for CSV files. Parameters: path : Path or cloud url to write to. ====================== Command: polars into-lazy Description: > Converts a dataframe into a lazy dataframe. Flags: -h, --help: Display the help message for this command -s, --schema : Polars Schema in format [{name: str}]. Parameters: ====================== Command: polars into-repr Description: > Display a dataframe in its repr format. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars into-dtype Description: > Convert a string to a specific datatype. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars into-schema Description: > Convert a value to a polars schema object Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math Description: > Collection of math functions to be applied on column expressions. Extra description: > You must use one of the subcommands below. Using this command as-is will only produce this help message. See https://docs.pola.rs/api/python/stable/reference/expressions/computation.html for more information. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math abs Description: > Compute the absolute values of a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-and Description: > Perform an aggregation of bitwise ANDs over a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-count-ones Description: > Compute the number of set bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-count-zeros Description: > Compute the number of unset bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-leading-ones Description: > Compute the number of leading set bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-leading-zeros Description: > Compute the number of leading unset bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-or Description: > Perform an aggregation of bitwise ORs over a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-trailing-ones Description: > Compute the number of trailing set bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-trailing-zeros Description: > Compute the number of trailing unset bits for each element in an integer column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math bitwise-xor Description: > Perform an aggregation of bitwise XORs over a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math cos Description: > Compute the element-wise cosine of a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math dot Description: > Compute the dot product of two column expressions. Flags: -h, --help: Display the help message for this command Parameters: other : Expression to compute dot product with. ====================== Command: polars math exp Description: > Compute element-wise e raised to the power of a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math log Description: > Compute the element-wise logarithm of a column expression. Flags: -h, --help: Display the help message for this command Parameters: (optional) base : Logarithm base (default: e, the natural logarithm). ====================== Command: polars math log1p Description: > Compute the element-wise natural log of 1 + x for a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math sign Description: > Compute the element-wise sign of a column expression, returning -1, 0, or 1. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math sin Description: > Compute the element-wise sine of a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars math sqrt Description: > Compute the element-wise square root of a column expression. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars append Description: > Appends a new dataframe. Flags: -h, --help: Display the help message for this command -c, --col: Append as new columns instead of rows. Parameters: other : Other dataframe to append. ====================== Command: polars cast Description: > Cast a column to a different dtype. Flags: -h, --help: Display the help message for this command Parameters: dtype : The dtype to cast the column to. (optional) column : The column to cast. Required when used with a dataframe. ====================== Command: polars cut Description: > Bin continuous values into discrete categories for a series. Flags: -h, --help: Display the help message for this command -l, --labels >: Names of the categories. The number of labels must be equal to the number of cut points plus one. -c, --left_closed: Set the intervals to be left-closed instead of right-closed. -b, --include_breaks: Include a column with the right endpoint of the bin each observation falls in. This will change the data type of the output from a Categorical to a Struct. Parameters: breaks : Dataframe that contains a series of unique cut points. ====================== Command: polars drop Description: > Creates a new dataframe by dropping the selected columns. Flags: -h, --help: Display the help message for this command Parameters: ...rest : Column names to be dropped. ====================== Command: polars concat Description: > Concatenate two or more dataframes. Flags: -h, --help: Display the help message for this command --no-parallel: Disable parallel execution. --rechunk: Rechunk the resulting dataframe. --to-supertypes: Cast to supertypes. --diagonal: Concatenate dataframes diagonally. --no-maintain-order: Do not maintain order. The default behavior is to maintain order. --from-partitioned-ds: Concatenate dataframes from a partitioned dataset. Parameters: ...dataframes : The dataframes to concatenate. ====================== Command: polars drop-duplicates Description: > Drops duplicate values in dataframe. Flags: -h, --help: Display the help message for this command -m, --maintain: Maintain order. -l, --last: Keeps last duplicate value (by default keeps first). Parameters: (optional) subset : Subset of columns to drop duplicates. ====================== Command: polars drop-nulls Description: > Drops null values in dataframe. Flags: -h, --help: Display the help message for this command Parameters: (optional) subset
: Subset of columns to drop nulls. ====================== Command: polars dummies Description: > Creates a new dataframe with dummy variables. Flags: -h, --help: Display the help message for this command -d, --drop-first: Drop first row. -n, --drop-nulls: Drop nulls. -s, --separator: Optional separator. Parameters: ====================== Command: polars filter-with Description: > Filters dataframe using a mask or expression as reference. Flags: -h, --help: Display the help message for this command Parameters: mask or expression : Boolean mask used to filter data. ====================== Command: polars entropy Description: > Compute the entropy as `-sum(pk * log(pk))` where `pk` are discrete probabilities. Flags: -h, --help: Display the help message for this command --base : Given base, defaults to e. --normalize : Normalize pk if it doesn’t sum to 1. Default to true. Parameters: ====================== Command: polars get Description: > Creates dataframe with the selected columns. Flags: -h, --help: Display the help message for this command Parameters: ...rest : Column names to sort dataframe. ====================== Command: polars pivot Description: > Pivot a DataFrame from long to wide format. Flags: -o, --on (required parameter) : Column names for pivoting. -h, --help: Display the help message for this command -c, --on-cols : column names used as value columns -i, --index : Selector or column names for indexes. --values : Selector or column names used as value columns. -a, --aggregate : Aggregation to apply when pivoting. The following are supported: first, sum, min, max, mean, median, count, last, or a custom expression. -p, --separator : Delimiter in generated column names in case of multiple `values` columns (default '_'). --maintain-order: Maintain Order. -t, --streamable: Whether or not to use the polars streaming engine. Only valid for lazy dataframes --stable: Perform a stable pivot. --always-combine-names: Always combine the values and on-column names. Parameters: ====================== Command: polars unpivot Description: > Unpivot a DataFrame from wide to long format. Flags: -i, --index (required parameter) >: Column names for unpivoting. -o, --on (required parameter) >: Column names used as value columns. -h, --help: Display the help message for this command -r, --variable-name : Optional name for variable column. -l, --value-name : Optional name for value column. Parameters: ====================== Command: polars first Description: > Show only the first number of rows or create a first expression Flags: -h, --help: Display the help message for this command Parameters: (optional) rows : Starting from the front, the number of rows to return. ====================== Command: polars last Description: > Creates new dataframe with tail rows or creates a last expression. Flags: -h, --help: Display the help message for this command Parameters: (optional) rows : Number of rows for tail. ====================== Command: polars len Description: > Return the number of rows in the context. This is similar to COUNT(*) in SQL. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars rename Description: > Rename a dataframe column. Flags: -h, --help: Display the help message for this command Parameters: columns : Column(s) to be renamed. A string or list of strings. new names : New names for the selected column(s). A string or list of strings. ====================== Command: polars sample Description: > Create sample dataframe. Flags: -h, --help: Display the help message for this command -n, --n-rows : Number of rows to be taken from dataframe. -f, --fraction : Fraction of dataframe to be taken. -s, --seed : Seed for the selection. -e, --replace: Sample with replace. -u, --shuffle: Shuffle sample. Parameters: ====================== Command: polars slice Description: > Creates new dataframe from a slice of rows. Flags: -h, --help: Display the help message for this command Parameters: offset : Start of slice. size : Size of slice. ====================== Command: polars take Description: > Creates new dataframe using the given indices. Flags: -h, --help: Display the help message for this command Parameters: indices : List of indices used to take data. ====================== Command: polars query Description: > Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. Flags: -h, --help: Display the help message for this command Parameters: sql : Sql query. ====================== Command: polars with-column Description: > Adds a series to the dataframe. Flags: -h, --help: Display the help message for this command -n, --name : New column name. For lazy dataframes and expressions syntax, use a `polars as` expression to name a column. Parameters: ...series or expressions : Series to be added or expressions used to define the new columns. ====================== Command: polars as Description: > Creates an alias expression. Flags: -h, --help: Display the help message for this command Parameters: Alias name : Alias name for the expression. ====================== Command: polars arg-where Description: > Creates an expression that returns the arguments where expression is true. Flags: -h, --help: Display the help message for this command Parameters: column name : Expression to evaluate. ====================== Command: polars lit Description: > Creates a literal expression. Flags: -h, --help: Display the help message for this command Parameters: literal : Literal to construct the expression. ====================== Command: polars col Description: > Creates a named column expression. Flags: -h, --help: Display the help message for this command -t, --type: Treat column names as type names. Parameters: column name : Name of column to be used. '*' can be used for all columns. Accepts regular expression input; regular expressions should start with ^ and end with $. ...more columns : Additional columns to be used. Cannot be '*'. ====================== Command: polars collect Description: > Collect lazy dataframe into eager dataframe. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars explode Description: > Explodes a dataframe or creates a explode expression. Flags: -h, --help: Display the help message for this command --empty-as-null: Explode an empty list into a `null` --keep-nulls: Explode a `null` into a `null` Parameters: ...columns : A polars selector or columns to explode, only applicable for dataframes ====================== Command: polars fill-nan Description: > Replaces NaN values with the given expression. Flags: -h, --help: Display the help message for this command Parameters: fill : Expression to use to fill the NAN values. ====================== Command: polars fill-null Description: > Replaces NULL values with the given expression. Flags: -h, --help: Display the help message for this command Parameters: fill : Expression to use to fill the null values. ====================== Command: polars flatten Description: > An alias for polars explode. Flags: -h, --help: Display the help message for this command Parameters: ...columns : Columns to flatten, only applicable for dataframes. ====================== Command: polars join Description: > Joins a lazy frame with other lazy frame. Flags: -h, --help: Display the help message for this command -i, --inner: Inner joining between lazyframes (default). -l, --left: Left join between lazyframes. -f, --full: Full join between lazyframes. -c, --cross: Cross join between lazyframes. --coalesce-columns: Sets the join coalesce strategy to colesce columns. Most useful when used with --full, which will not otherwise coalesce. --nulls-equal: Join on null values. By default null values will never produce matches. -s, --suffix : Suffix to use on columns with same name. Parameters: other : LazyFrame to join with. (optional) left_on : Left column(s) to join on. (optional) right_on : Right column(s) to join on. ====================== Command: polars join-where Description: > Joins a lazy frame with other lazy frame based on conditions. Flags: -h, --help: Display the help message for this command Parameters: other : LazyFrame to join with. condition : Condition. ====================== Command: polars map-batches Description: > Map a custom Nushell closure over one or more dataframe columns. Extra description: > The closure receives a list of single-column dataframes (one per named column) and must return a value that can be converted to a series — a single-column dataframe, a list, or a scalar. The result is returned as a single-column dataframe. The closure is invoked once with all columns at the time `polars map-batches` is run. Flags: -h, --help: Display the help message for this command -d, --return-dtype : Data type to cast the closure's result to. -n, --name : Name for the resulting column. Parameters: closure : Closure to apply. Receives a list of single-column dataframes. ...columns : Names of columns to pass to the closure. If omitted, all columns are used. ====================== Command: polars reverse Description: > Reverses the LazyFrame Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars select Description: > Selects columns from lazyframe. Flags: -h, --help: Display the help message for this command Parameters: ...select expressions : Expression(s) that define the column selection. ====================== Command: polars sort-by Description: > Sorts a lazy dataframe based on expression(s). Flags: -h, --help: Display the help message for this command -r, --reverse >: Reverse sorting. Default is false. -n, --nulls-last: Nulls are shown last in the dataframe. -m, --maintain-order: Maintains order during sort. Parameters: ...sort expression : Sort expression for the dataframe. ====================== Command: polars filter Description: > Filter dataframe based in expression. Flags: -h, --help: Display the help message for this command Parameters: filter expression : Expression that define the column selection. ====================== Command: polars replace Description: > Create an expression that replaces old values with new values Flags: -h, --help: Display the help message for this command -s, --strict: Require that all values must be replaced or throw an error (ignored if `old` or `new` are expressions). -d, --default : Set values that were not replaced to this value. If no default is specified, (default), an error is raised if any values were not replaced. Accepts expression input. Non-expression inputs are parsed as literals. -t, --return-dtype : Data type of the resulting expression. If set to `null` (default), the data type is determined automatically based on the other inputs. Parameters: old >>: Values to be replaced. (optional) new >: Values to replace by. ====================== Command: polars shift Description: > Shifts the values by a given period. Flags: -h, --help: Display the help message for this command -f, --fill : Expression used to fill the null values (lazy df). Parameters: period : Shift period. ====================== Command: polars struct-json-encode Description: > Convert this struct to a string column with json values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars qcut Description: > Bin continuous values into discrete categories based on their quantiles for a series. Flags: -h, --help: Display the help message for this command -l, --labels >: Names of the categories. The number of labels must be equal to the number of cut points plus one. -c, --left_closed: Set the intervals to be left-closed instead of right-closed. -b, --include_breaks: Include a column with the right endpoint of the bin each observation falls in. This will change the data type of the output from a Categorical to a Struct. -d, --allow_duplicates: If set, duplicates in the resulting quantiles are dropped, rather than raising an error. This can happen even with unique probabilities, depending on the data. Parameters: quantiles : Either a list of quantile probabilities between 0 and 1 or a positive integer determining the number of bins with uniform probability. ====================== Command: polars unique Description: > Returns unique values from a dataframe. Flags: -h, --help: Display the help message for this command -s, --subset : Subset of column(s) to use to maintain rows (lazy df). -l, --last: Keeps last unique value. Default keeps first value (lazy df). -k, --maintain-order: Keep the same order as the original DataFrame (lazy df). Parameters: ====================== Command: polars unnest Description: > Decompose struct columns into separate columns for each of their fields. The new columns will be inserted into the dataframe at the location of the struct column. Flags: -h, --help: Display the help message for this command -s, --separator : Optional separator to use when creating new column names. Parameters: ...cols : Columns to unnest. ====================== Command: polars as-date Description: > Converts string to date. Extra description: > Format example: "%Y-%m-%d" => 2021-12-31 "%d-%m-%Y" => 31-12-2021 "%Y%m%d" => 2021319 (2021-03-19) Flags: -h, --help: Display the help message for this command -n, --not-exact: The format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01). Parameters: format : Formatting date string. ====================== Command: polars as-datetime Description: > Converts string to datetime. Extra description: > Format example: "%y/%m/%d %H:%M:%S" => 21/12/31 12:54:98 "%y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 "%y/%m/%d %H:%M:%S" => 21/12/31 24:58:01 "%y%m%d %H:%M:%S" => 210319 23:58:50 "%Y/%m/%d %H:%M:%S" => 2021/12/31 12:54:98 "%Y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 "%Y/%m/%d %H:%M:%S" => 2021/12/31 24:58:01 "%Y%m%d %H:%M:%S" => 20210319 23:58:50 "%FT%H:%M:%S" => 2019-04-18T02:45:55 "%FT%H:%M:%S.%6f" => microseconds "%FT%H:%M:%S.%9f" => nanoseconds Flags: -h, --help: Display the help message for this command -n, --not-exact: The format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01). --naive: The input datetimes should be parsed as naive (i.e., not timezone-aware). Ignored if input is an expression. -a, --ambiguous >: Determine how to deal with ambiguous datetimes: `raise` (default): raise error `earliest`: use the earliest datetime `latest`: use the latest datetime `null`: set to null Used only when input is a lazyframe or expression and ignored otherwise --time-unit : Time unit for the output datetime. One of: ns, us, ms. Default is ns. --time-zone : Time zone for the output datetime. E.g. 'UTC', 'America/New_York'. Parameters: format : Formatting date time string. ====================== Command: polars convert-time-zone Description: > Convert datetime to target timezone. Flags: -h, --help: Display the help message for this command Parameters: time_zone : Timezone for the Datetime Series. Pass `null` to unset time zone. ====================== Command: polars date-range Description: > Create a date range expression. Flags: -h, --help: Display the help message for this command -s, --start : Start of the date range expression. This supports a string, date, or datetime expression. -e, --end : End of the date range expression. This supports a string, date, or datetime expression. -i, --interval : Interval of the date range expression. This supports a string or duration expression. -c, --closed : Closed window of the date range expression. This supports 'left', 'right', 'both', or 'none'. --eager: Eagerly collect the date range expression into a dataframe. Parameters: ====================== Command: polars date-ranges Description: > Create a column of date ranges. Flags: -h, --help: Display the help message for this command -s, --start : Start of the date range expression. This supports a string, date, or datetime expression. -e, --end : End of the date range expression. This supports a string, date, or datetime expression. -i, --interval : Interval of the date range expression. This supports a string or duration expression. -c, --closed : Closed window of the date range expression. This supports 'left', 'right', 'both', or 'none'. --eager: Eagerly collect the date range expression into a dataframe. Parameters: ====================== Command: polars datetime-range Description: > Create a datetime range expression. Flags: -h, --help: Display the help message for this command -s, --start : Start of the datetime range expression. This supports a string, date, or datetime expression. -e, --end : End of the datetime range expression. This supports a string, date, or datetime expression. -i, --interval : Interval of the datetime range expression. This supports a string or duration expression. -c, --closed : Closed window of the datetime range expression. This supports 'left', 'right', 'both', or 'none'. --time-unit : Time unit for the output datetime. One of: ns, us, ms. --time-zone : Time zone for the output datetime. E.g. 'UTC', 'America/New_York'. --eager: Eagerly collect the datetime range expression into a dataframe. Parameters: ====================== Command: polars datetime-ranges Description: > Create a column of datetime ranges. Flags: -h, --help: Display the help message for this command -s, --start : Start of the datetime range expression. This supports a string, date, or datetime expression. -e, --end : End of the datetime range expression. This supports a string, date, or datetime expression. -i, --interval : Interval of the datetime range expression. This supports a string or duration expression. -c, --closed : Closed window of the datetime range expression. This supports 'left', 'right', 'both', or 'none'. --time-unit : Time unit for the output datetime. One of: ns, us, ms. --time-zone : Time zone for the output datetime. E.g. 'UTC', 'America/New_York'. --eager: Eagerly collect the datetime range expression into a dataframe. Parameters: ====================== Command: polars datepart Description: > Creates an expression for capturing the specified datepart in a column. Flags: -h, --help: Display the help message for this command Parameters: Datepart name : Part of the date to capture. Possible values are year, quarter, month, week, weekday, day, hour, minute, second, millisecond, microsecond, nanosecond. ====================== Command: polars get-day Description: > Gets day from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-hour Description: > Gets hour from datetime. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-minute Description: > Gets minute from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-month Description: > Gets month from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-nanosecond Description: > Gets nanosecond from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-ordinal Description: > Gets ordinal from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-second Description: > Gets second from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-week Description: > Gets week from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-weekday Description: > Gets weekday from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars get-year Description: > Gets year from date. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars replace-time-zone Description: > Replace the timezone information in a datetime column. Flags: -h, --help: Display the help message for this command -a, --ambiguous >: Determine how to deal with ambiguous datetimes: `raise` (default): raise error `earliest`: use the earliest datetime `latest`: use the latest datetime `null`: set to null -n, --nonexistent >: Determine how to deal with non-existent datetimes: raise (default) or null. Parameters: time_zone : Timezone for the Datetime Series. Pass `null` to unset time zone. ====================== Command: polars strftime Description: > Formats date based on string rule. Flags: -h, --help: Display the help message for this command Parameters: fmt : Format rule. ====================== Command: polars truncate Description: > Divide the date/datetime range into buckets. Extra description: > Each date/datetime is mapped to the start of its bucket using the corresponding local datetime. Note that weekly buckets start on Monday. Ambiguous results are localised using the DST offset of the original timestamp - for example, truncating '2022-11-06 01:30:00 CST' by '1h' results in '2022-11-06 01:00:00 CST', whereas truncating '2022-11-06 01:30:00 CDT' by '1h' results in '2022-11-06 01:00:00 CDT'. See Notes in documentation for full list of compatible string values for `every`: https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.dt.truncate.html Flags: -h, --help: Display the help message for this command Parameters: every >: Period length for every interval (can be duration or str). ====================== Command: polars arg-max Description: > Return index for max value in series. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars arg-min Description: > Return index for min value in series. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars arg-sort Description: > Returns indexes for a sorted series. Flags: -h, --help: Display the help message for this command -r, --reverse: Reverse order. -n, --nulls-last: Nulls ordered last. -l, --limit : Limit a sort output, this is for optimization purposes and might be ignored. -m, --maintain-order: Maintain order on sorted items. Parameters: ====================== Command: polars arg-unique Description: > Returns indexes for unique values. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars set-with-idx Description: > Sets value in the given index. Flags: -i, --indices (required parameter) : List of indices indicating where to set the value. -h, --help: Display the help message for this command Parameters: value : Value to be inserted in series. ====================== Command: polars decimal Description: > Converts a string column into a decimal column Flags: -h, --help: Display the help message for this command Parameters: infer_length : Number of decimal points to infer. ====================== Command: polars integer Description: > Converts a string column into a integer column Flags: -h, --help: Display the help message for this command -s, --strict: Raises an error as opposed to converting to null. Parameters: (optional) base : An integer or expression representing the base (radix) of the number system (default is 10). (optional) dtype : Data type to cast to (defaults is i64). ====================== Command: polars selector all Description: > Creates a selector that selects all columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector alpha Description: > Select all columns with alphabetic names (eg: only letters). Matching column names cannot contain *any* non-alphabetic characters. Note that the definition of "alphabetic" consists of all valid Unicode alphabetic characters by default; this can be changed by setting `--ascii-only`. Flags: -h, --help: Display the help message for this command -a, --ascii-only: Indicate whether to consider only ASCII alphabetic characters, or the full Unicode range of valid letters (accented, idiographic, etc). -s, --ignore-spaces: Indicate whether to ignore the presence of spaces in column names; if so, only the other (non-space) characters are considered. Parameters: ====================== Command: polars selector alphanumeric Description: > Select all columns with alphanumeric names (eg: only letters). Matching column names cannot contain *any* non-alphanumeric characters. Note that the definition of "alphanumeric" consists of all valid Unicode alphanumeric characters by default; this can be changed by setting `ascii_only=true`. Flags: -h, --help: Display the help message for this command -a, --ascii-only: Indicate whether to consider only ASCII alphanumeric characters, or the full Unicode range of valid letters (accented, idiographic, etc). -s, --ignore-spaces: Indicate whether to ignore the presence of spaces in column names; if so, only the other (non-space) characters are considered. Parameters: ====================== Command: polars selector array Description: > Select all array columns. Optionally filter by fixed width. Flags: -h, --help: Display the help message for this command --width : Only select arrays with this fixed width. Parameters: ====================== Command: polars selector binary Description: > Select all binary columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector boolean Description: > Select all boolean columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector by-dtype Description: > Creates a selector that selects columns by data type. Flags: -h, --help: Display the help message for this command Parameters: ...dtypes : Data types to select (e.g., i64, f64, str, bool). ====================== Command: polars selector by-index Description: > Select columns by their index position. Supports negative indices (e.g., -1 for the last column). Flags: -h, --help: Display the help message for this command --not-strict: Allow out-of-range indices without error. Parameters: ...index : Column index positions to select (negative indices count from the end). ====================== Command: polars selector by-name Description: > Creates a selector that selects columns by name. Flags: -h, --help: Display the help message for this command --strict: If set, the selector will error if any specified column names do not exist. Parameters: ...column names : Names of columns to select. ====================== Command: polars selector categorical Description: > Select all categorical columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector contains Description: > Select columns whose names contain the given literal substring(s). Flags: -h, --help: Display the help message for this command Parameters: ...substring : Literal substring(s) to search for in column names. ====================== Command: polars selector date Description: > Select all date columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector datetime Description: > Select all datetime columns. Optionally filter by time unit (ns, us, ms) and/or timezone. Flags: -h, --help: Display the help message for this command --time-unit >: Filter by time unit(s): ns (nanoseconds), us (microseconds), ms (milliseconds). --time-zone >: Filter by timezone(s). Use "*" to match any set timezone, or "unset" to match columns without a timezone. Parameters: ====================== Command: polars selector decimal Description: > Select all decimal columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector digit Description: > Select columns whose names consist entirely of digit characters. By default uses Unicode decimal digits; use `--ascii-only` to restrict to ASCII 0-9. Flags: -h, --help: Display the help message for this command -a, --ascii-only: Restrict to ASCII digit characters (0-9) only. Parameters: ====================== Command: polars selector duration Description: > Select all duration columns. Optionally filter by time unit (ns, us, ms). Flags: -h, --help: Display the help message for this command --time-unit >: Filter by time unit(s): ns (nanoseconds), us (microseconds), ms (milliseconds). Parameters: ====================== Command: polars selector empty Description: > Create an empty selector that matches no columns. Useful as a base for selector composition. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector ends-with Description: > Select columns that end with the given substring(s). Flags: -h, --help: Display the help message for this command Parameters: ...prefix : Select columns that end with the given substring(s). ====================== Command: polars selector exclude Description: > Select all columns except those with the given name(s). This is the inverse of `polars selector by-name`. Flags: -h, --help: Display the help message for this command Parameters: ...column : Column name(s) to exclude from the selection. ====================== Command: polars selector first Description: > Creates a selector that selects the first column(s) by index. Flags: -h, --help: Display the help message for this command Parameters: (optional) n : Number of columns to select from the beginning (default: 1). ====================== Command: polars selector float Description: > Select all float columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector integer Description: > Select all integer columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector last Description: > Creates a selector that selects the last column(s) by index. Flags: -h, --help: Display the help message for this command Parameters: (optional) n : Number of columns to select from the end (default: 1). ====================== Command: polars selector list Description: > Select all list columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector matches Description: > Select all columns that match the given regex pattern. Flags: -h, --help: Display the help message for this command Parameters: pattern : A valid regular expression pattern, compatible with the rust `regex crate ====================== Command: polars selector nested Description: > Select all nested columns (list, array, or struct). Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector not Description: > Inverts selector. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector numeric Description: > Select all numeric columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector object Description: > Select all object columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector enum Description: > Select all enum columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector struct Description: > Select all struct columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector signed-integer Description: > Select all signed integer columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector starts-with Description: > Select columns that start with the given substring(s). Flags: -h, --help: Display the help message for this command Parameters: ...prefix : Select columns that start with the given substring(s). ====================== Command: polars selector string Description: > Select all string columns. Use `--include-categorical` to also select categorical columns. Flags: -h, --help: Display the help message for this command -c, --include-categorical: Also include categorical columns in the selection. Parameters: ====================== Command: polars selector Description: > Create column selectors for use in polars commands. Extra description: > You must use one of the subcommands below. Using this command as-is will only produce this help message. Selectors are expressions that can be used to select columns in dataframes based on various criteria. These selectors can be used with commands that accept column expressions, such as `polars select`, `polars with-column`, and others. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector temporal Description: > Select all temporal columns (date, datetime, duration, and time). Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars selector unsigned-integer Description: > Select all unsigned integer columns. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars concat-str Description: > Creates a concat string expression. Flags: -h, --help: Display the help message for this command Parameters: separator : Separator used during the concatenation. concat expressions >: Expression(s) that define the string concatenation. ====================== Command: polars contains Description: > Checks if a pattern is contained in a string. Flags: -h, --help: Display the help message for this command Parameters: pattern : Regex pattern to be searched. ====================== Command: polars str-replace Description: > Replace the leftmost (sub)string by a regex pattern. Flags: -p, --pattern (required parameter) : Regex pattern to be matched. -r, --replace (required parameter) : Replacing string. -h, --help: Display the help message for this command Parameters: ====================== Command: polars str-replace-all Description: > Replace all (sub)strings by a regex pattern. Flags: -p, --pattern (required parameter) : Regex pattern to be matched. -r, --replace (required parameter) : Replacing string. -h, --help: Display the help message for this command Parameters: ====================== Command: polars str-split Description: > Split the string by a substring. The resulting dtype is list. Flags: -h, --help: Display the help message for this command Parameters: expr : Separator expression. ====================== Command: polars str-strip-chars Description: > Strips specified characters from strings in a column Flags: -h, --help: Display the help message for this command -s, --start: Strip from start of strings only. -e, --end: Strip from end of strings only. Parameters: pattern : Characters to strip as either a string or polars expression. ====================== Command: polars str-join Description: > Concatenates strings within a column or dataframes Flags: -h, --help: Display the help message for this command -d, --delimiter : Delimiter to join strings within an expression. Other dataframe when used with a dataframe. -n, --ignore-nulls: Ignore null values. Only available when used as an expression. Parameters: (optional) other : Other dataframe with a single series of strings to be concatenated. Required when used with a dataframe, ignored when used as an expression. ====================== Command: polars str-lengths Description: > Get lengths of all strings. Flags: -h, --help: Display the help message for this command -b, --bytes: Get the length in bytes instead of chars. Parameters: ====================== Command: polars str-slice Description: > Slices the string from the start position until the selected length. Flags: -h, --help: Display the help message for this command -l, --length : Optional length. Parameters: start : Start of slice. ====================== Command: polars lowercase Description: > Lowercase the strings in the column. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars uppercase Description: > Uppercase the strings in the column. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars list-contains Description: > Checks if an element is contained in a list. Flags: -h, --help: Display the help message for this command Parameters: element : Element to search for in the list. ====================== Command: polars store-ls Description: > Lists stored polars objects. Flags: -h, --help: Display the help message for this command Parameters: ====================== Command: polars store-rm Description: > Removes a stored Dataframe or other object from the plugin cache. Flags: -h, --help: Display the help message for this command Parameters: ...keys : Keys of objects to remove. ====================== Command: polars store-get Description: > Gets a Dataframe or other object from the plugin cache. Flags: -h, --help: Display the help message for this command Parameters: key : Key of objects to get. ======================