Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

polars save for lazyframe

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).

This command requires a plugin

The polars save command resides in the polars plugin. To use this command, you must install and register nu_plugin_polars. See the Plugins chapter in the book for more information.

Signature

> polars save {flags} (path)

Flags

  • --type, -t {string}: File type: csv, json, parquet, arrow/ipc. If omitted, derive from file extension
  • --avro-compression {string}: Compression for avro supports deflate or snappy
  • --csv-delimiter {string}: file delimiter character
  • --csv-no-header: Indicates to exclude a header row for CSV files.

Parameters

  • path: Path or cloud url to write to

Input/output types:

inputoutput
anystring

Examples

Performs a streaming collect and save the output to the specified file

> [[a b];[1 2] [3 4]] | polars into-lazy | polars save test.parquet

Saves dataframe to parquet file

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.parquet

Saves dataframe to arrow file

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.arrow

Saves dataframe to NDJSON file

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.ndjson

Saves dataframe to avro file

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.avro

Saves dataframe to CSV file

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.csv

Saves dataframe to CSV file using other delimiter

> [[a b]; [1 2] [3 4]] | polars into-df | polars save test.csv --csv-delimiter '|'