Modules§
- _csv_
read_ internal polars-io
- _internal
polars-io
- array
polars-ops
anddtype-array
- binary
lazy
- buffer
polars-io
- byte_
source polars-io
andcloud
- cat
lazy
anddtype-categorical
- chunkedarray
temporal
Traits and utilities for temporal data. - cloud
polars-io
Interface with cloud storage through the object_store crate. - compression
polars-io
- concat_
arr polars-ops
anddtype-array
- Data types supported by Polars.
- datetime
polars-ops
andtimezones
- dt
lazy
andtemporal
- file
polars-io
- fixed_
size_ list dtype-array
- function_
expr lazy
- interpolate
polars-ops
andinterpolate
- interpolate_
by polars-ops
andinterpolate_by
- mode
polars-ops
andmode
- nan_
propagating_ aggregate polars-ops
andpropagate_nans
- replace
temporal
and (dtype-date
ordtype-datetime
) - schema_
inference polars-io
- series
temporal
- strings
polars-ops
- udf
lazy
- zip
zip_with
Macros§
Structs§
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Array
Name Space lazy
Specialized expressions forSeries
ofDataType::Array
. - Represents Arrow’s metadata of a “column”.
- AsOf
Options polars-ops
- Batched
CsvReader polars-io
- Batched
Parquet Reader polars-io
- Bounds
temporal
- Bounds
Iter temporal
- Brotli
Level polars-io
A valid Brotli compression level. - Specialized expressions for Categorical dtypes.
- Chained
Then lazy
Utility struct for thewhen-then-otherwise
expression. - Chained
When lazy
Utility struct for thewhen-then-otherwise
expression. - ChunkedArray
- CsvParse
Options polars-io
- CsvRead
Options polars-io
- CsvReader
polars-io
Create a new DataFrame by reading a csv file. - CsvWriter
polars-io
Write a DataFrame to csv. - CsvWriter
Options polars-io
Options for writing CSV files. - A contiguous growable collection of
Series
that have the same length. - Datetime
Args lazy
Arguments used bydatetime
in order to produce anExpr
of Datetime - Duration
lazy
- Duration
Args lazy
- Specialized expressions for modifying the name of existing expressions.
- Characterizes the name and the
DataType
of a column. - Fields
Mapper lazy
- File
Metadata polars-io
Metadata for a Parquet file. - Fixed
Size List Type dtype-array
- Returned by a group_by operation on a DataFrame. This struct supports several aggregations.
- Indexes of the groups, the first index is stored separately. this make sorting fast.
- Gzip
Level polars-io
A valid Gzip compression level. - IEJoin
Options polars-ops
- InProcess
Query lazy
- IpcRead
Options polars-io
- IpcReader
polars-io
Read Arrows IPC format into a DataFrame - IpcReader
Async polars-io
An Arrow IPC reader implemented on top of PolarsObjectStore. - IpcScan
Options polars-io
- IpcStream
Reader polars-io
Read Arrows Stream IPC format into a DataFrame - IpcStream
Writer polars-io
Write a DataFrame to Arrow’s Streaming IPC format - IpcStream
Writer Option polars-io
- IpcWriter
polars-io
Write a DataFrame to Arrow’s IPC format - IpcWriter
Options polars-io
- Join
Args lazy
- Join
Builder lazy
- Join
Options lazy
- Json
Line Reader polars-io
- Json
Reader polars-io
Reads JSON in one of the formats inJsonFormat
into a DataFrame. - Json
Writer polars-io
Writes a DataFrame to JSON. - Json
Writer Options polars-io
- Lazy
CsvReader lazy
andcsv
- Lazy
Frame lazy
Lazy abstraction over an eagerDataFrame
. - Lazy
Group By lazy
Utility struct for lazy group_by operation. - List
Name Space lazy
Specialized expressions forSeries
ofDataType::List
. - Maps a logical type to a chunked array implementation of the physical type. This saves a lot of compiler bloat and allows us to reuse functionality.
- Just a wrapper structure which is useful for certain impl specializations.
- Null
lazy
The literal Null - Object
Type object
- OptFlags
lazy
Allowed optimizations. - Owned
Batched CsvReader polars-io
- Owned
Object object
- Parquet
Async Reader polars-io
andcloud
A Parquet reader on top of the async object_store API. Only the batch reader is implemented since parquet files on cloud storage tend to be big and slow to access. - Parquet
Options polars-io
- Parquet
Reader polars-io
Read Apache parquet format into a DataFrame. - Parquet
Statistics polars-io
Arrow-deserialized parquet Statistics of a file - Parquet
Write Options polars-io
- Parquet
Writer polars-io
Write a DataFrame to Parquet format. - String type that inlines small strings.
- Rank
Options lazy
- Rolling
Options Dynamic Window temporal
- Scan
Args Ipc lazy
- Scan
Args Parquet lazy
- Serialize
Options polars-io
Options to serialize logical types to CSV. - Series
- Sort options for multi-series sorting.
- Options for single series sorting.
- Special
Eq lazy
Wrapper type that has special equality properties depending on the inner type specialization - SplitN
Chars polars-ops
- Statistics
Options polars-io
The statistics to write - Enable the global string cache as long as the object is alive (RAII).
- Strptime
Options lazy
- Struct
Array polars-io
AStructArray
is a nested [Array
] with an optional validity representing multiple [Array
] with the same number of rows. - Struct
Name Space lazy
Specialized expressions for Struct dtypes. - Struct
Type dtype-struct
- Then
lazy
Utility struct for thewhen-then-otherwise
expression. - Union
Args lazy
- Unpivot
ArgsDSL lazy
- Arguments for
LazyFrame::unpivot
function - Represents a user-defined function
- When
lazy
Utility struct for thewhen-then-otherwise
expression. - Window
temporal
Represents a window in time - Zstd
Level polars-io
A valid Zstandard compression level.
Enums§
- AggExpr
lazy
- The set of supported logical types in this crate.
- The time units defined in Arrow.
- Asof
Strategy polars-ops
- Boolean
Function lazy
- Closed
Interval polars-ops
- Closed
Window temporal
- A column within a
DataFrame
. - Comment
Prefix polars-io
- CsvEncoding
polars-io
- DslPlan
lazy
- Excluded
lazy
- Expr
lazy
Expressions that can be used in various contexts. - Function
Expr lazy
- Inequality
Operator polars-ops
- Interpolation
Method polars-ops
- IpcCompression
polars-io
Compression codec - Join
Coalesce polars-ops
- Join
Type lazy
- Join
Validation lazy
- Json
Format polars-io
The format to use to write the DataFrame to JSON:Json
(a JSON array) orJsonLines
(each row output on a separate line). - Label
temporal
- Lazy
Serde lazy
- Literal
Value lazy
- Maintain
Order Join polars-ops
- Nested
Type lazy
- Null
Strategy polars-ops
- Null
Values polars-io
- Operator
lazy
- Parallel
Strategy polars-io
- Parquet
Compression polars-io
The compression strategy to use for writing Parquet files. - PowFunction
lazy
- Quote
Style polars-io
Quote style indicating when to insert quotes around a field. - Rank
Method lazy
- A dimension in a reshape.
- Search
Sorted Side polars-ops
- Selector
lazy
- StartBy
temporal
- String
Function lazy
- Struct
Function lazy
- Temporal
Function lazy
- Window
Mapping lazy
- Window
Type lazy
Constants§
- IDX_
DTYPE Non- bigidx
- NULL
lazy
- URL_
ENCODE_ CHAR_ SET polars-io
Statics§
- BOOLEAN_
RE polars-io
- FLOAT_
RE polars-io
- FLOAT_
RE_ DECIMAL polars-io
- INTEGER_
RE polars-io
- POLARS_
TEMP_ DIR_ BASE_ PATH polars-io
Traits§
- Anonymous
Scan lazy
- ArgAgg
polars-ops
Argmin/ Argmax - AsBinary
polars-ops
- AsList
polars-ops
- AsString
polars-ops
- Asof
Join polars-ops
- Asof
Join By polars-ops
- Binary
Name Space Impl polars-ops
- Aggregation operations.
- Aggregations that return
Series
of unit length. Those can be used in broadcasting operations. - Fastest way to do elementwise operations on a
ChunkedArray<T>
when the operation is cheaper than branching due to null checking. - Apply kernels on the arrow array chunks in a ChunkedArray.
- Chunk
ApproxN Unique approx_unique
- Cast
ChunkedArray<T>
toChunkedArray<N>
- Compare
Series
andChunkedArray
’s using inequality operators (<
,>=
, etc.) and get aboolean
mask that can be used to filter rows. - Create a new ChunkedArray filled with values at that index.
- Explode/flatten a List or String Series
- Replace None values with a value
- Filter values by a boolean mask.
- Fill a ChunkedArray with one value.
- Quantile and median aggregation.
- Reverse a
ChunkedArray<T>
- Chunk
Roll Apply rolling_window
This differs from ChunkWindowCustom and ChunkWindow by not using a fold aggregator, but reusing aSeries
wrapper and callingSeries
aggregators. This likely is a bit slower than ChunkWindow - Create a
ChunkedArray
with new values by index or by boolean mask. - Shift the values of a
ChunkedArray
by a number of periods. - Sort operations on
ChunkedArray
. - Get unique values in a
ChunkedArray
- Variance and standard deviation aggregation.
- Combine two
ChunkedArray
based on some predicate. - Chunked
Set polars-ops
- Column
Binary Udf lazy
A wrapper trait for any binary closureFn(Column, Column) -> PolarsResult<Column>
- Columns
Udf lazy
A wrapper trait for any closureFn(Vec<Series>) -> PolarsResult<Series>
- Cross
Join polars-ops
- Data
Frame Join Ops polars-ops
- Data
Frame Ops polars-ops
- Date
Methods temporal
- Datetime
Methods temporal
- Duration
Methods temporal
- Convert
Self
into aColumn
- Used to create the tuples for a group_by operation.
- Into
Lazy lazy
- Convenience for
x.into_iter().map(Into::into).collect()
using aninto_vec()
function. - IsFirst
Distinct is_first_distinct
Mask the first unique values astrue
- IsLast
Distinct is_last_distinct
Mask the last unique values astrue
- Join
Dispatch polars-ops
- Reads LazyFrame from a filesystem or a cloud storage. Supports glob patterns.
- List
Name Space Impl polars-ops
- Literal
lazy
- MinMax
Horizontal polars-ops
- Safety
- A
PolarsIterator
is an iterator over aChunkedArray
which contains polars types. APolarsIterator
must implementExactSizeIterator
andDoubleEndedIterator
. - Values need to implement this so that they can be stored into a Series and DataFrame
- Polars
Round temporal
- Polars
Truncate temporal
- Polars
Upsample temporal
- Reinterpret
reinterpret
- Rename
Alias Fn lazy
- Rolling
Series polars-ops
- Round
Series polars-ops
- SerReader
polars-io
- SerWriter
polars-io
- Series
Join polars-ops
- Series
Methods polars-ops
- Series
OpsTime temporal
- Series
Rank polars-ops
- Series
Sealed polars-ops
- Utility trait to slice concrete arrow arrays whilst keeping their concrete type. E.g. don’t return
Box<dyn Array>
. - String
Methods temporal
- String
Name Space Impl polars-ops
- SumMean
Horizontal polars-ops
- Take
Chunked polars-ops
Gather byChunkId
- Take
Chunked HorPar polars-ops
- Temporal
Methods temporal
- Time
Methods temporal
- ToDummies
polars-ops
- UdfSchema
lazy
Functions§
- _coalesce_
full_ join polars-ops
- _join_
suffix_ name polars-ops
- Meant for internal use. In very rare conditions this can be turned off.
- abs
polars-ops
Convert numerical values to their absolute value. - all
lazy
Selects all columns. Shorthand forcol("*")
. - all_
horizontal lazy
Create a new column with the bitwise-and of the elements in each row. - any_
horizontal lazy
Create a new column with the bitwise-or of the elements in each row. - apply_
binary lazy
Likemap_binary
, but used in a group_by-aggregation context. - apply_
multiple lazy
Apply a function/closure over the groups of multiple columns. This should only be used in a group_by aggregation. - apply_
projection polars-io
and (ipc
oripc_streaming
orparquet
oravro
) - arange
lazy
Generate a range of integers. - arg_
sort_ by lazy
andrange
Find the indexes that would sort these series in order of appearance. - arg_
where lazy
andarg_where
Get the indices wherecondition
evaluatestrue
. - as_
struct lazy
Take several expressions and collect them into aStructChunked
. - avg
lazy
Find the mean of all the values in the column namedname
. Alias formean
. - base_
utc_ offset temporal
andtimezones
- binary_
expr lazy
Computeop(l, r)
(or equivalentlyl op r
).l
andr
must have types compatible with the Operator. - cast
lazy
Casts the column given byExpr
to a different type. - clip
polars-ops
Set values outside the given boundaries to the boundary value. - clip_
max polars-ops
Set values above the given maximum to the maximum value. - clip_
min polars-ops
Set values below the given minimum to the minimum value. - coalesce
lazy
Folds the expressions from left to right keeping the first non-null values. - coalesce_
columns polars-ops
- col
lazy
Create a Column Expression based on a column name. - collect_
all lazy
Collect allLazyFrame
computations. - cols
lazy
Select multiple columns by name. - columns_
to_ projection polars-io
and (ipc
oripc_streaming
oravro
orparquet
) - concat
lazy
Concat multipleLazyFrame
s vertically. - concat_
arr lazy
Horizontally concatenate columns into a single array-type column. - concat_
expr lazy
- concat_
lf_ diagonal lazy
anddiagonal_concat
- Concat LazyFrames horizontally.
- concat_
list lazy
Concat lists entries. - concat_
str concat_str
andstrings
andlazy
Horizontally concat string columns in linear time - Cast null arrays to inner type and ensure that all offsets remain correct
- convert_
to_ unsigned_ index polars-ops
- count_
ones polars-ops
- count_
rows polars-io
Read the number of rows without parsing columns useful for count(*) queries - count_
rows_ from_ slice polars-io
Read the number of rows without parsing columns useful for count(*) queries - count_
zeros polars-ops
- create_
enum_ dtype dtype-categorical
- create_
sorting_ map polars-io
- cum_
count polars-ops
- cum_
fold_ exprs lazy
anddtype-struct
Accumulate over multiple columns horizontally / row wise. - cum_max
polars-ops
Get an array with the cumulative max computed at every element. - cum_min
polars-ops
Get an array with the cumulative min computed at every element. - cum_
prod polars-ops
Get an array with the cumulative product computed at every element. - cum_
reduce_ exprs lazy
anddtype-struct
Accumulate over multiple columns horizontally / row wise. - cum_sum
polars-ops
Get an array with the cumulative sum computed at every element - date_
ranges lazy
andtemporal
Create a column of date ranges from astart
andstop
expression. - datetime
lazy
Construct a column ofDatetime
from the providedDatetimeArgs
. - datetime_
range lazy
anddtype-datetime
Create a datetime range from astart
andstop
expression. - datetime_
ranges lazy
anddtype-datetime
Create a column of datetime ranges from astart
andstop
expression. - default_
join_ ids polars-ops
- deserialize
polars-io
Deserializes the statistics in the column chunks from a singlerow_group
intoStatistics
associated fromfield
’s name. - diff
polars-ops
- dst_
offset temporal
andtimezones
- dtype_
col lazy
Select multiple columns by dtype. - dtype_
cols lazy
Select multiple columns by dtype. - duration
lazy
Construct a column ofDuration
from the providedDurationArgs
- ensure_
duration_ matches_ dtype temporal
- ensure_
is_ constant_ duration temporal
- escape_
regex polars-ops
- escape_
regex_ str polars-ops
- expand_
paths polars-io
Recursively traverses directories and expands globs ifglob
istrue
. - expand_
paths_ hive polars-io
Recursively traverses directories and expands globs ifglob
istrue
. Returns the expanded paths and the index at which to start parsing hive partitions from the path. - expanded_
from_ single_ directory polars-io
Returnstrue
ifexpanded_paths
were expanded from a single directory - first
lazy
First column in a DataFrame. - floor_
div_ series polars-ops
- fold_
exprs lazy
Accumulate over multiple columns horizontally / row wise. - format_
str concat_str
andstrings
andlazy
Format the results of an array of expressions using a format string - get_
glob_ start_ idx polars-io
Get the index of the first occurrence of a glob symbol. - get_
reader_ bytes polars-io
- group_
by_ values temporal
Different fromgroup_by_windows
, where define window buckets and search which values fit that pre-defined bucket. - group_
by_ windows temporal
Window boundaries are created based on the givenWindow
, which is defined by: - hor_
str_ concat polars-ops
Horizontally concatenate all strings. - impl_
duration polars-ops
- impl_
replace_ time_ zone polars-ops
- impl_
replace_ time_ zone_ fast polars-ops
Ifambiguous
is length-1 and not equal to “null”, we can take a slightly faster path. - in_
nanoseconds_ window temporal
- index_
cols lazy
Select multiple columns by index. - infer_
file_ schema polars-io
Infer the schema of a CSV file by reading through the first n rows of the file, withmax_read_rows
controlling the maximum number of rows to read. - infer_
schema polars-io
Infers aArrowSchema
from parquet’sFileMetadata
. - int_
range lazy
Generate a range of integers. - int_
ranges lazy
Generate a range of integers for each row of the input columns. - interpolate
polars-ops
- interpolate_
by polars-ops
- is_
between polars-ops
- is_
cloud_ url polars-io
Check if the path is a cloud url. - is_
first_ distinct polars-ops
- is_in
polars-ops
- is_
last_ distinct polars-ops
- is_
not_ null lazy
A column which isfalse
whereverexpr
is null,true
elsewhere. - is_null
lazy
A column which istrue
whereverexpr
is null,false
elsewhere. - is_
positive_ idx_ uncertain polars-ops
May give false negatives because it ignores the null values. - is_
positive_ idx_ uncertain_ col polars-ops
May give false negatives because it ignores the null values. - last
lazy
Last column in a DataFrame. - leading_
ones polars-ops
- leading_
zeros polars-ops
- len
lazy
Return the number of rows in the context. - lit
lazy
Create a Literal Expression fromL
. A literal expression behaves like a column that contains a single distinct value. - map_
binary lazy
- Apply a function/closure over multiple columns once the logical plan get executed.
- map_
multiple lazy
Apply a function/closure over multiple columns once the logical plan get executed. - materialize_
empty_ df polars-io
- materialize_
projection polars-io
- max
lazy
Find the maximum of all the values in the column namedname
. Shorthand forcol(name).max()
. - mean
lazy
Find the mean of all the values in the column namedname
. Shorthand forcol(name).mean()
. - median
lazy
Find the median of all the values in the column namedname
. Shorthand forcol(name).median()
. - min
lazy
Find the minimum of all the values in the column namedname
. Shorthand forcol(name).min()
. - negate
polars-ops
- negate_
bitwise polars-ops
- new_
int_ range polars-ops
- not
lazy
Negates a boolean column. - nth
lazy
Nth column in a DataFrame. - overwrite_
schema polars-io
andjson
- Prepare the given
DslPlan
for execution on Polars Cloud. - private_
left_ join_ multiple_ keys polars-ops
- quantile
lazy
Find a specific quantile of all the values in the column namedname
. - reduce_
exprs lazy
Analogous toIterator::reduce
. - remove_
bom polars-io
- repeat
lazy
Create a column of lengthn
containingn
copies of the literalvalue
. - repeat_
by polars-ops
- replace
polars-ops
Replace values by different values of the same data type. - replace_
date temporal
anddtype-date
Replace specific time component of aDateChunked
with a specified value. - replace_
datetime temporal
anddtype-datetime
Replace specific time component of aDatetimeChunked
with a specified value. - replace_
or_ default polars-ops
Replace all values by different values. - replace_
strict polars-ops
Replace all values by different values. - replace_
time_ zone polars-ops
- resolve_
homedir polars-io
Replaces a “~” in the Path with the home directory. - split_
helper polars-ops
- split_
to_ struct polars-ops
anddtype-struct
- str_
join polars-ops
- strip_
chars polars-ops
- strip_
chars_ end polars-ops
- strip_
chars_ start polars-ops
- strip_
prefix polars-ops
- strip_
suffix polars-ops
- sum
lazy
Sum all the values in the column namedname
. Shorthand forcol(name).sum()
. - ternary_
expr lazy
- time_
ranges lazy
anddtype-time
Create a column of time ranges from astart
andstop
expression. - trailing_
ones polars-ops
- trailing_
zeros polars-ops
- try_
set_ sorted_ flag polars-io
- unique_
counts polars-ops
Returns a count of the unique values in the order of appearance. - when
lazy
Start awhen-then-otherwise
expression. - write_
partitioned_ dataset polars-io
Write a partitioned parquet dataset. This functionality is unstable.
Type Aliases§
- AllowedOptimizations
- Array
Chunked dtype-array
- An ordered sequence of
Field
s - Chunk
Join OptIds polars-ops
andchunked_ids
- Fields
Name Mapper lazy
anddtype-struct
- File
Metadata Ref polars-io
- GetOutput
lazy
- Every group is indicated by an array where the
- IdxCa
Non- bigidx
- IdxSize
Non- bigidx
- IdxType
Non- bigidx
- Inner
Join Ids polars-ops
- Int128
Chunked dtype-i128
- Left
Join Ids polars-ops
- Object
Chunked object
- Opaque
Column Udf lazy
- This hashmap uses an IdHasher
- Quantile
Interpol Options Deprecated - RowGroup
Iter Columns polars-io