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 selector exclude for expression

Select all columns except those with the given name(s). This is the inverse of `polars selector by-name`.

Signature

> polars selector exclude {flags} ...rest

Parameters

  • ...rest: Column name(s) to exclude from the selection.

Input/output types:

inputoutput
anypolars_selector

Examples

Select all columns except 'a' and 'b'

> {
    "a": [1.0, 2.0],
    "b": [3.0, 4.0],
    "c": [5, 6],
} |
polars into-df --as-columns |
polars select (polars selector exclude a b) |
polars collect
╭───┬───╮
│ # │ c │
├───┼───┤
│ 0 │ 5 │
│ 1 │ 6 │
╰───┴───╯

Select all columns except 'c'

> [[a b c]; [1 2 3] [4 5 6]]
    | polars into-df
    | polars select (polars selector exclude c)
    | polars collect