docs.pola.rs Open in urlscan Pro
2606:50c0:8001::153  Public Scan

Submitted URL: https://docs.pola.rs/user-guide/
Effective URL: https://docs.pola.rs/
Submission: On June 21 via manual from US — Scanned from DE

Form analysis 2 forms found in the DOM

<form class="md-header__option" data-md-component="palette">
  <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette"
    id="__palette_0">
  <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"></path>
    </svg>
  </label>
  <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
  <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden="">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path
        d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12c0-2.42-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z">
      </path>
    </svg>
  </label>
</form>

Name: search

<form class="md-search__form" name="search">
  <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required="">
  <label class="md-search__icon md-icon" for="__search">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"></path>
    </svg>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"></path>
    </svg>
  </label>
  <nav class="md-search__options" aria-label="Search">
    <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
        <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"></path>
      </svg>
    </button>
  </nav>
</form>

Text Content

Skip to content

Polars user guide
Index

Type to start searching
pola-rs/polars
 * py-0.20.31
 * 27.3k
 * 1.7k

 * User guide
 * API reference
 * Development
 * Releases

Polars user guide
pola-rs/polars
 * py-0.20.31
 * 27.3k
 * 1.7k

 * User guide
   User guide
    * Getting started
    * Installation
    * Concepts
      Concepts
       * Data types
         Data types
          * Overview
          * Categorical data
      
       * Data structures
       * Contexts
       * Expressions
       * Lazy / eager API
       * Streaming API
   
    * Expressions
      Expressions
       * Basic operators
       * Column selections
       * Functions
       * Casting
       * Strings
       * Aggregation
       * Missing data
       * Window functions
       * Folds
       * Lists and Arrays
       * Expression plugins
       * User-defined functions (Python)
       * The Struct datatype
       * Numpy
   
    * Transformations
      Transformations
       * Joins
       * Concatenation
       * Pivots
       * Melts
       * Time series
         Time series
          * Parsing
          * Filtering
          * Grouping
          * Resampling
          * Time zones
   
    * Lazy API
      Lazy API
       * Usage
       * Optimizations
       * Schema
       * Query plan
       * Query execution
       * Streaming
   
    * IO
      IO
       * CSV
       * Excel
       * Parquet
       * JSON files
       * Multiple
       * Databases
       * Cloud storage
       * Google BigQuery
   
    * SQL
      SQL
       * Introduction
       * SHOW TABLES
       * SELECT
       * CREATE
       * Common Table Expressions
   
    * Migrating
      Migrating
       * Coming from Pandas
       * Coming from Apache Spark
   
    * Ecosystem
    * Misc
      Misc
       * Multiprocessing
       * Visualization
       * Styling
       * Comparison with other tools

 * API reference
 * Development
   Development
    * Contributing
      Contributing
       * IDE configuration
       * Test suite
       * Continuous integration
       * Code style
   
    * Versioning

 * Releases
   Releases
    * Changelog
    * Upgrade guides
      Upgrade guides
       * Version 1
       * Version 0.20
       * Version 0.19

Table of contents
 * Key features
 * Philosophy
 * Example
 * Community
 * Contributing
 * License


BLAZINGLY FAST DATAFRAME LIBRARY



Polars is a blazingly fast DataFrame library for manipulating structured data.
The core is written in Rust, and available for Python, R and NodeJS.


KEY FEATURES

 * Fast: Written from scratch in Rust, designed close to the machine and without
   external dependencies.
 * I/O: First class support for all common data storage layers: local, cloud
   storage & databases.
 * Intuitive API: Write your queries the way they were intended. Polars,
   internally, will determine the most efficient way to execute using its query
   optimizer.
 * Out of Core: The streaming API allows you to process your results without
   requiring all your data to be in memory at the same time
 * Parallel: Utilises the power of your machine by dividing the workload among
   the available CPU cores without any additional configuration.
 * Vectorized Query Engine: Using Apache Arrow, a columnar data format, to
   process your queries in a vectorized manner and SIMD to optimize CPU usage.

Users new to DataFrames

A DataFrame is a 2-dimensional data structure that is useful for data
manipulation and analysis. With labeled axes for rows and columns, each column
can contain different data types, making complex data operations such as merging
and aggregation much easier. Due to their flexibility and intuitive way of
storing and working with data, DataFrames have become increasingly popular in
modern data analytics and engineering.


PHILOSOPHY

The goal of Polars is to provide a lightning fast DataFrame library that:

 * Utilizes all available cores on your machine.
 * Optimizes queries to reduce unneeded work/memory allocations.
 * Handles datasets much larger than your available RAM.
 * A consistent and predictable API.
 * Adheres to a strict schema (data-types should be known before running the
   query).

Polars is written in Rust which gives it C/C++ performance and allows it to
fully control performance critical parts in a query engine.


EXAMPLE

Python Rust

scan_csv · filter · group_by · collect

import polars as pl

q = (
    pl.scan_csv("docs/data/iris.csv")
    .filter(pl.col("sepal_length") > 5)
    .group_by("species")
    .agg(pl.all().sum())
)

df = q.collect()




LazyCsvReader · filter · group_by · collect · Available on feature streaming ·
Available on feature csv

use polars::prelude::*;

let q = LazyCsvReader::new("docs/data/iris.csv")
    .with_has_header(true)
    .finish()?
    .filter(col("sepal_length").gt(lit(5)))
    .group_by(vec![col("species")])
    .agg([col("*").sum()]);

let df = q.collect()?;







A more extensive introduction can be found in the next chapter.


COMMUNITY

Polars has a very active community with frequent releases (approximately
weekly). Below are some of the top contributors to the project:




CONTRIBUTING

We appreciate all contributions, from reporting bugs to implementing new
features. Read our contributing guide to learn more.


LICENSE

This project is licensed under the terms of the MIT license.

Next
Getting started

Made with Material for MkDocs