Spec-Zone.ru › Nushell

polars for dataframe

Operate with data in a dataframe format.

Signature

> polars {flags}

Input/output types:

input output
nothing string

Notes

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.

Subcommands:

name description type
polars agg Performs a series of aggregations from a group-by. plugin
polars agg-groups Creates an agg_groups expression. plugin
polars all-false Returns true if all values are false. plugin
polars all-true Returns true if all values are true. plugin
polars append Appends a new dataframe. plugin
polars arg-max Return index for max value in series. plugin
polars arg-min Return index for min value in series. plugin
polars arg-sort Returns indexes for a sorted series. plugin
polars arg-true Returns indexes where values are true. plugin
polars arg-unique Returns indexes for unique values. plugin
polars arg-where Creates an expression that returns the arguments where expression is true. plugin
polars as Creates an alias expression. plugin
polars as-date Converts string to date. plugin
polars as-datetime Converts string to datetime. plugin
polars cache Caches operations in a new LazyFrame. plugin
polars cast Cast a column to a different dtype. plugin
polars col Creates a named column expression. plugin
polars collect Collect lazy dataframe into eager dataframe. plugin
polars columns Show dataframe columns. plugin
polars concat Concatenate two or more dataframes. plugin
polars concat-str Creates a concat string expression. plugin
polars contains Checks if a pattern is contained in a string. plugin
polars convert-time-zone Convert datetime to target timezone. plugin
polars count Returns the number of non-null values in the column. plugin
polars count-null Counts null values. plugin
polars cumulative Cumulative calculation for a column or series. plugin
polars cut Bin continuous values into discrete categories for a series. plugin
polars datepart Creates an expression for capturing the specified datepart in a column. plugin
polars decimal Converts a string column into a decimal column plugin
polars drop Creates a new dataframe by dropping the selected columns. plugin
polars drop-duplicates Drops duplicate values in dataframe. plugin
polars drop-nulls Drops null values in dataframe. plugin
polars dummies Creates a new dataframe with dummy variables. plugin
polars entropy Compute the entropy as -sum(pk * log(pk)) where pk are discrete probabilities. plugin
polars explode Explodes a dataframe or creates a explode expression. plugin
polars expr-not Creates a not expression. plugin
polars fill-nan Replaces NaN values with the given expression. plugin
polars fill-null Replaces NULL values with the given expression. plugin
polars filter Filter dataframe based in expression. plugin
polars filter-with Filters dataframe using a mask or expression as reference. plugin
polars first Show only the first number of rows or create a first expression plugin
polars flatten An alias for polars explode. plugin
polars get Creates dataframe with the selected columns. plugin
polars get-day Gets day from date. plugin
polars get-hour Gets hour from datetime. plugin
polars get-minute Gets minute from date. plugin
polars get-month Gets month from date. plugin
polars get-nanosecond Gets nanosecond from date. plugin
polars get-ordinal Gets ordinal from date. plugin
polars get-second Gets second from date. plugin
polars get-week Gets week from date. plugin
polars get-weekday Gets weekday from date. plugin
polars get-year Gets year from date. plugin
polars group-by Creates a group-by object that can be used for other aggregations. plugin
polars horizontal Horizontal calculation across multiple columns. plugin
polars implode Aggregates values into a list. plugin
polars integer Converts a string column into a integer column plugin
polars into-df Converts a list, table or record into a dataframe. plugin
polars into-dtype Convert a string to a specific datatype. plugin
polars into-lazy Converts a dataframe into a lazy dataframe. plugin
polars into-nu Converts a dataframe or an expression into nushell value for access and exploration. plugin
polars into-repr Display a dataframe in its repr format. plugin
polars into-schema Convert a value to a polars schema object plugin
polars is-duplicated Creates mask indicating duplicated values. plugin
polars is-in Creates an is-in expression or checks to see if the elements are contained in the right series plugin
polars is-not-null Creates mask where value is not null. plugin
polars is-null Creates mask where value is null. plugin
polars is-unique Creates mask indicating unique values. plugin
polars join Joins a lazy frame with other lazy frame. plugin
polars join-where Joins a lazy frame with other lazy frame based on conditions. plugin
polars last Creates new dataframe with tail rows or creates a last expression. plugin
polars len Return the number of rows in the context. This is similar to COUNT(*) in SQL. plugin
polars list-contains Checks if an element is contained in a list. plugin
polars lit Creates a literal expression. plugin
polars lowercase Lowercase the strings in the column. plugin
polars math Collection of math functions to be applied on one or more column expressions plugin
polars max Creates a max expression or aggregates columns to their max value. plugin
polars mean Creates a mean expression for an aggregation or aggregates columns to their mean value. plugin
polars median Median value from columns in a dataframe or creates expression for an aggregation plugin
polars min Creates a min expression or aggregates columns to their min value. plugin
polars n-unique Counts unique values. plugin
polars not Inverts boolean mask. plugin
polars open Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. plugin
polars otherwise Completes a when expression. plugin
polars over Compute expressions over a window group defined by partition expressions. plugin
polars pivot Pivot a DataFrame from long to wide format. plugin
polars profile Profile a lazy dataframe. plugin
polars qcut Bin continuous values into discrete categories based on their quantiles for a series. plugin
polars quantile Aggregates the columns to the selected quantile. plugin
polars query Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. plugin
polars rename Rename a dataframe column. plugin
polars replace Create an expression that replaces old values with new values plugin
polars replace-time-zone Replace the timezone information in a datetime column. plugin
polars reverse Reverses the LazyFrame plugin
polars rolling Rolling calculation for a series. plugin
polars sample Create sample dataframe. plugin
polars save 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). plugin
polars schema Show schema for a dataframe. plugin
polars select Selects columns from lazyframe. plugin
polars selector Create column selectors for use in polars commands. plugin
polars selector all Creates a selector that selects all columns. plugin
polars selector alpha 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. plugin
polars selector alphanumeric 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. plugin
polars selector array Select all array columns. Optionally filter by fixed width. plugin
polars selector binary Select all binary columns. plugin
polars selector boolean Select all boolean columns. plugin
polars selector by-dtype Creates a selector that selects columns by data type. plugin
polars selector by-index Select columns by their index position. Supports negative indices (e.g., -1 for the last column). plugin
polars selector by-name Creates a selector that selects columns by name. plugin
polars selector categorical Select all categorical columns. plugin
polars selector contains Select columns whose names contain the given literal substring(s). plugin
polars selector date Select all date columns. plugin
polars selector datetime Select all datetime columns. Optionally filter by time unit (ns, us, ms) and/or timezone. plugin
polars selector decimal Select all decimal columns. plugin
polars selector digit Select columns whose names consist entirely of digit characters. By default uses Unicode decimal digits; use --ascii-only to restrict to ASCII 0-9. plugin
polars selector duration Select all duration columns. Optionally filter by time unit (ns, us, ms). plugin
polars selector empty Create an empty selector that matches no columns. Useful as a base for selector composition. plugin
polars selector ends-with Select columns that end with the given substring(s). plugin
polars selector enum Select all enum columns. plugin
polars selector exclude Select all columns except those with the given name(s). This is the inverse of polars selector by-name. plugin
polars selector first Creates a selector that selects the first column(s) by index. plugin
polars selector float Select all float columns. plugin
polars selector integer Select all integer columns. plugin
polars selector last Creates a selector that selects the last column(s) by index. plugin
polars selector list Select all list columns. plugin
polars selector matches Select all columns that match the given regex pattern. plugin
polars selector nested Select all nested columns (list, array, or struct). plugin
polars selector not Inverts selector. plugin
polars selector numeric Select all numeric columns. plugin
polars selector object Select all object columns. plugin
polars selector signed-integer Select all signed integer columns. plugin
polars selector starts-with Select columns that start with the given substring(s). plugin
polars selector string Select all string columns. Use --include-categorical to also select categorical columns. plugin
polars selector struct Select all struct columns. plugin
polars selector temporal Select all temporal columns (date, datetime, duration, and time). plugin
polars selector unsigned-integer Select all unsigned integer columns. plugin
polars set Sets value where given mask is true. plugin
polars set-with-idx Sets value in the given index. plugin
polars shape Shows column and row size for a dataframe. plugin
polars shift Shifts the values by a given period. plugin
polars slice Creates new dataframe from a slice of rows. plugin
polars sort-by Sorts a lazy dataframe based on expression(s). plugin
polars std Creates a std expression for an aggregation of std value from columns in a dataframe. plugin
polars store-get Gets a Dataframe or other object from the plugin cache. plugin
polars store-ls Lists stored polars objects. plugin
polars store-rm Removes a stored Dataframe or other object from the plugin cache. plugin
polars str-join Concatenates strings within a column or dataframes plugin
polars str-lengths Get lengths of all strings. plugin
polars str-replace Replace the leftmost (sub)string by a regex pattern. plugin
polars str-replace-all Replace all (sub)strings by a regex pattern. plugin
polars str-slice Slices the string from the start position until the selected length. plugin
polars str-split Split the string by a substring. The resulting dtype is list\<str\>. plugin
polars str-strip-chars Strips specified characters from strings in a column plugin
polars strftime Formats date based on string rule. plugin
polars struct-json-encode Convert this struct to a string column with json values. plugin
polars sum Creates a sum expression for an aggregation or aggregates columns to their sum value. plugin
polars summary For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. plugin
polars take Creates new dataframe using the given indices. plugin
polars truncate Divide the date/datetime range into buckets. plugin
polars unique Returns unique values from a dataframe. plugin
polars unnest 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. plugin
polars unpivot Unpivot a DataFrame from wide to long format. plugin
polars uppercase Uppercase the strings in the column. plugin
polars value-counts Returns a dataframe with the counts for unique values in series. plugin
polars var Create a var expression for an aggregation. plugin
polars when Creates and modifies a when expression. plugin
polars with-column Adds a series to the dataframe. plugin

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/polars.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API