polars query
For dataframe.
Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause.
warning This command requires a plugin The
polars querycommand resides in thepolarsplugin. To use this command, you must install and registernu_plugin_polars. See the Plugins chapter in the book for more information.
Command Type
plugin
Signature
> polars query {flags} (sql)
Parameters
sql: Sql query.
Input/output types:
| input | output |
|---|---|
| polars_dataframe | polars_dataframe |
| polars_lazyframe | polars_lazyframe |
Examples
Query dataframe using SQL
> [[a b]; [1 2] [3 4]] | polars into-df | polars query 'select a from df'
╭───┬───╮
│ # │ a │
├───┼───┤
│ 0 │ 1 │
│ 1 │ 3 │
╰───┴───╯
Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.