class_docstr: Create Polars column expressions.
  
  Notes
  -----
  An instance of this class is exported under the name `col`. It can be used as
  though it were a function by calling, for example, `pl.col("foo")`.
  See the :func:`__call__` method for further documentation.
  
  This helper class enables an alternative syntax for creating a column expression
  through attribute lookup. For example `col.foo` creates an expression equal to
  `col("foo")`.
  See the :func:`__getattr__` method for further documentation.
  
  The function call syntax is considered the idiomatic way of constructing a column
  expression. The alternative attribute syntax can be useful for quick prototyping as
  it can save some keystrokes, but has drawbacks in both expressiveness and
  readability.
  
  Examples
  --------
  >>> from polars import col
  >>> df = pl.DataFrame(
  ...     {
  ...         "foo": [1, 2],
  ...         "bar": [3, 4],
  ...     }
  ... )
  
  Create a new column expression using the standard syntax:
  
  >>> df.with_columns(baz=(col("foo") * col("bar")) / 2)
  shape: (2, 3)
  ┌─────┬─────┬─────┐
  │ foo ┆ bar ┆ baz │
  │ --- ┆ --- ┆ --- │
  │ i64 ┆ i64 ┆ f64 │
  ╞═════╪═════╪═════╡
  │ 1   ┆ 3   ┆ 1.5 │
  │ 2   ┆ 4   ┆ 4.0 │
  └─────┴─────┴─────┘
  
  Use attribute lookup to create a new column expression:
  
  >>> df.with_columns(baz=(col.foo + col.bar))
  shape: (2, 3)
  ┌─────┬─────┬─────┐
  │ foo ┆ bar ┆ baz │
  │ --- ┆ --- ┆ --- │
  │ i64 ┆ i64 ┆ i64 │
  ╞═════╪═════╪═════╡
  │ 1   ┆ 3   ┆ 4   │
  │ 2   ┆ 4   ┆ 6   │
  └─────┴─────┴─────┘
class_docstr_tok: ["Create","Polars","column","expressions",".","Notes","--","--","-","An","instance","of","this","class","is","exported","under","the","name","`","col","`",".","It","can","be","used","as","though","it","were","a","function","by","calling",",","for","example",",","`","pl.col","(","``","foo","''",")","`",".","See","the",":","func",":","`","__call__","`","method","for","further","documentation",".","This","helper","class","enables","an","alternative","syntax","for","creating","a","column","expression","through","attribute","lookup",".","For","example","`","col.foo","`","creates","an","expression","equal","to","`","col","(","``","foo","''",")","`",".","See","the",":","func",":","`","__getattr__","`","method","for","further","documentation",".","The","function","call","syntax","is","considered","the","idiomatic","way","of","constructing","a","column","expression",".","The","alternative","attribute","syntax","can","be","useful","for","quick","prototyping","as","it","can","save","some","keystrokes",",","but","has","drawbacks","in","both","expressiveness","and","readability",".","Examples","--","--","--","--",">",">",">","from","polars","import","col",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","foo","''",":","[","1",",","2","]",",","...","``","bar","''",":","[","3",",","4","]",",","...","}","...",")","Create","a","new","column","expression","using","the","standard","syntax",":",">",">",">","df.with_columns","(","baz=","(","col","(","``","foo","''",")","*","col","(","``","bar","''",")",")","\/","2",")","shape",":","(","2",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","foo","\u2506","bar","\u2506","baz","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2506","f64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1","\u2506","3","\u2506","1.5","\u2502","\u2502","2","\u2506","4","\u2506","4.0","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518","Use","attribute","lookup","to","create","a","new","column","expression",":",">",">",">","df.with_columns","(","baz=","(","col.foo","+","col.bar",")",")","shape",":","(","2",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","foo","\u2506","bar","\u2506","baz","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1","\u2506","3","\u2506","4","\u2502","\u2502","2","\u2506","4","\u2506","6","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518"]
docstr: Create one or more column expressions representing column(s) in a DataFrame.
  
  Parameters
  ----------
  name
      The name or datatype of the column(s) to represent.
      Accepts regular expression input.
      Regular expressions should start with `^` and end with `$`.
  *more_names
      Additional names or datatypes of columns to represent,
      specified as positional arguments.
  
  Examples
  --------
  Pass a single column name to represent that column.
  
  >>> df = pl.DataFrame(
  ...     {
  ...         "ham": [1, 2],
  ...         "hamburger": [11, 22],
  ...         "foo": [2, 1],
  ...         "bar": ["a", "b"],
  ...     }
  ... )
  >>> df.select(pl.col("foo"))
  shape: (2, 1)
  ┌─────┐
  │ foo │
  │ --- │
  │ i64 │
  ╞═════╡
  │ 2   │
  │ 1   │
  └─────┘
  
  Use dot syntax to save keystrokes for quick prototyping.
  
  >>> from polars import col as c
  >>> df.select(c.foo + c.ham)
  shape: (2, 1)
  ┌─────┐
  │ foo │
  │ --- │
  │ i64 │
  ╞═════╡
  │ 3   │
  │ 3   │
  └─────┘
  
  Use the wildcard `*` to represent all columns.
  
  >>> df.select(pl.col("*"))
  shape: (2, 4)
  ┌─────┬───────────┬─────┬─────┐
  │ ham ┆ hamburger ┆ foo ┆ bar │
  │ --- ┆ ---       ┆ --- ┆ --- │
  │ i64 ┆ i64       ┆ i64 ┆ str │
  ╞═════╪═══════════╪═════╪═════╡
  │ 1   ┆ 11        ┆ 2   ┆ a   │
  │ 2   ┆ 22        ┆ 1   ┆ b   │
  └─────┴───────────┴─────┴─────┘
  >>> df.select(pl.col("*").exclude("ham"))
  shape: (2, 3)
  ┌───────────┬─────┬─────┐
  │ hamburger ┆ foo ┆ bar │
  │ ---       ┆ --- ┆ --- │
  │ i64       ┆ i64 ┆ str │
  ╞═══════════╪═════╪═════╡
  │ 11        ┆ 2   ┆ a   │
  │ 22        ┆ 1   ┆ b   │
  └───────────┴─────┴─────┘
  
  Regular expression input is supported.
  
  >>> df.select(pl.col("^ham.*$"))
  shape: (2, 2)
  ┌─────┬───────────┐
  │ ham ┆ hamburger │
  │ --- ┆ ---       │
  │ i64 ┆ i64       │
  ╞═════╪═══════════╡
  │ 1   ┆ 11        │
  │ 2   ┆ 22        │
  └─────┴───────────┘
  
  Multiple columns can be represented by passing a list of names.
  
  >>> df.select(pl.col(["hamburger", "foo"]))
  shape: (2, 2)
  ┌───────────┬─────┐
  │ hamburger ┆ foo │
  │ ---       ┆ --- │
  │ i64       ┆ i64 │
  ╞═══════════╪═════╡
  │ 11        ┆ 2   │
  │ 22        ┆ 1   │
  └───────────┴─────┘
  
  Or use positional arguments to represent multiple columns in the same way.
  
  >>> df.select(pl.col("hamburger", "foo"))
  shape: (2, 2)
  ┌───────────┬─────┐
  │ hamburger ┆ foo │
  │ ---       ┆ --- │
  │ i64       ┆ i64 │
  ╞═══════════╪═════╡
  │ 11        ┆ 2   │
  │ 22        ┆ 1   │
  └───────────┴─────┘
  
  Easily select all columns that match a certain data type by passing that
  datatype.
  
  >>> df.select(pl.col(pl.String))
  shape: (2, 1)
  ┌─────┐
  │ bar │
  │ --- │
  │ str │
  ╞═════╡
  │ a   │
  │ b   │
  └─────┘
  >>> df.select(pl.col(pl.Int64, pl.Float64))
  shape: (2, 3)
  ┌─────┬───────────┬─────┐
  │ ham ┆ hamburger ┆ foo │
  │ --- ┆ ---       ┆ --- │
  │ i64 ┆ i64       ┆ i64 │
  ╞═════╪═══════════╪═════╡
  │ 1   ┆ 11        ┆ 2   │
  │ 2   ┆ 22        ┆ 1   │
  └─────┴───────────┴─────┘
docstr_tok: ["Create","one","or","more","column","expressions","representing","column","(","s",")","in","a","DataFrame",".","Parameters","--","--","--","--","--","name","The","name","or","datatype","of","the","column","(","s",")","to","represent",".","Accepts","regular","expression","input",".","Regular","expressions","should","start","with","`","^","`","and","end","with","`","$","`",".","*","more_names","Additional","names","or","datatypes","of","columns","to","represent",",","specified","as","positional","arguments",".","Examples","--","--","--","--","Pass","a","single","column","name","to","represent","that","column",".",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","ham","''",":","[","1",",","2","]",",","...","``","hamburger","''",":","[","11",",","22","]",",","...","``","foo","''",":","[","2",",","1","]",",","...","``","bar","''",":","[","``","a","''",",","``","b","''","]",",","...","}","...",")",">",">",">","df.select","(","pl.col","(","``","foo","''",")",")","shape",":","(","2",",","1",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","foo","\u2502","\u2502","--","-","\u2502","\u2502","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","2","\u2502","\u2502","1","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2518","Use","dot","syntax","to","save","keystrokes","for","quick","prototyping",".",">",">",">","from","polars","import","col","as","c",">",">",">","df.select","(","c.foo","+","c.ham",")","shape",":","(","2",",","1",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","foo","\u2502","\u2502","--","-","\u2502","\u2502","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","3","\u2502","\u2502","3","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2518","Use","the","wildcard","`","*","`","to","represent","all","columns",".",">",">",">","df.select","(","pl.col","(","``","*","''",")",")","shape",":","(","2",",","4",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","ham","\u2506","hamburger","\u2506","foo","\u2506","bar","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2506","i64","\u2506","str","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1","\u2506","11","\u2506","2","\u2506","a","\u2502","\u2502","2","\u2506","22","\u2506","1","\u2506","b","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518",">",">",">","df.select","(","pl.col","(","``","*","''",")",".exclude","(","``","ham","''",")",")","shape",":","(","2",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","hamburger","\u2506","foo","\u2506","bar","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2506","str","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","11","\u2506","2","\u2506","a","\u2502","\u2502","22","\u2506","1","\u2506","b","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518","Regular","expression","input","is","supported",".",">",">",">","df.select","(","pl.col","(","``","^ham",".","*","$","''",")",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","ham","\u2506","hamburger","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1","\u2506","11","\u2502","\u2502","2","\u2506","22","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518","Multiple","columns","can","be","represented","by","passing","a","list","of","names",".",">",">",">","df.select","(","pl.col","(","[","``","hamburger","''",",","``","foo","''","]",")",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","hamburger","\u2506","foo","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","11","\u2506","2","\u2502","\u2502","22","\u2506","1","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518","Or","use","positional","arguments","to","represent","multiple","columns","in","the","same","way",".",">",">",">","df.select","(","pl.col","(","``","hamburger","''",",","``","foo","''",")",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","hamburger","\u2506","foo","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","11","\u2506","2","\u2502","\u2502","22","\u2506","1","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518","Easily","select","all","columns","that","match","a","certain","data","type","by","passing","that","datatype",".",">",">",">","df.select","(","pl.col","(","pl.String",")",")","shape",":","(","2",",","1",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","bar","\u2502","\u2502","--","-","\u2502","\u2502","str","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","a","\u2502","\u2502","b","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2518",">",">",">","df.select","(","pl.col","(","pl.Int64",",","pl.Float64",")",")","shape",":","(","2",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","ham","\u2506","hamburger","\u2506","foo","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1","\u2506","11","\u2506","2","\u2502","\u2502","2","\u2506","22","\u2506","1","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def __new__(  # type: ignore[misc]
      cls,
      name: str
      | PolarsDataType
      | Iterable[str]
      | Iterable[PolarsDataType],
      *more_names: str | PolarsDataType,
  ) -> Expr:
      """
      Create one or more column expressions representing column(s) in a DataFrame.
  
      Parameters
      ----------
      name
          The name or datatype of the column(s) to represent.
          Accepts regular expression input.
          Regular expressions should start with `^` and end with `$`.
      *more_names
          Additional names or datatypes of columns to represent,
          specified as positional arguments.
  
      Examples
      --------
      Pass a single column name to represent that column.
  
      >>> df = pl.DataFrame(
      ...     {
      ...         "ham": [1, 2],
      ...         "hamburger": [11, 22],
      ...         "foo": [2, 1],
      ...         "bar": ["a", "b"],
      ...     }
      ... )
      >>> df.select(pl.col("foo"))
      shape: (2, 1)
      ┌─────┐
      │ foo │
      │ --- │
      │ i64 │
      ╞═════╡
      │ 2   │
      │ 1   │
      └─────┘
  
      Use dot syntax to save keystrokes for quick prototyping.
  
      >>> from polars import col as c
      >>> df.select(c.foo + c.ham)
      shape: (2, 1)
      ┌─────┐
      │ foo │
      │ --- │
      │ i64 │
      ╞═════╡
      │ 3   │
      │ 3   │
      └─────┘
  
      Use the wildcard `*` to represent all columns.
  
      >>> df.select(pl.col("*"))
      shape: (2, 4)
      ┌─────┬───────────┬─────┬─────┐
      │ ham ┆ hamburger ┆ foo ┆ bar │
      │ --- ┆ ---       ┆ --- ┆ --- │
      │ i64 ┆ i64       ┆ i64 ┆ str │
      ╞═════╪═══════════╪═════╪═════╡
      │ 1   ┆ 11        ┆ 2   ┆ a   │
      │ 2   ┆ 22        ┆ 1   ┆ b   │
      └─────┴───────────┴─────┴─────┘
      >>> df.select(pl.col("*").exclude("ham"))
      shape: (2, 3)
      ┌───────────┬─────┬─────┐
      │ hamburger ┆ foo ┆ bar │
      │ ---       ┆ --- ┆ --- │
      │ i64       ┆ i64 ┆ str │
      ╞═══════════╪═════╪═════╡
      │ 11        ┆ 2   ┆ a   │
      │ 22        ┆ 1   ┆ b   │
      └───────────┴─────┴─────┘
  
      Regular expression input is supported.
  
      >>> df.select(pl.col("^ham.*$"))
      shape: (2, 2)
      ┌─────┬───────────┐
      │ ham ┆ hamburger │
      │ --- ┆ ---       │
      │ i64 ┆ i64       │
      ╞═════╪═══════════╡
      │ 1   ┆ 11        │
      │ 2   ┆ 22        │
      └─────┴───────────┘
  
      Multiple columns can be represented by passing a list of names.
  
      >>> df.select(pl.col(["hamburger", "foo"]))
      shape: (2, 2)
      ┌───────────┬─────┐
      │ hamburger ┆ foo │
      │ ---       ┆ --- │
      │ i64       ┆ i64 │
      ╞═══════════╪═════╡
      │ 11        ┆ 2   │
      │ 22        ┆ 1   │
      └───────────┴─────┘
  
      Or use positional arguments to represent multiple columns in the same way.
  
      >>> df.select(pl.col("hamburger", "foo"))
      shape: (2, 2)
      ┌───────────┬─────┐
      │ hamburger ┆ foo │
      │ ---       ┆ --- │
      │ i64       ┆ i64 │
      ╞═══════════╪═════╡
      │ 11        ┆ 2   │
      │ 22        ┆ 1   │
      └───────────┴─────┘
  
      Easily select all columns that match a certain data type by passing that
      datatype.
  
      >>> df.select(pl.col(pl.String))
      shape: (2, 1)
      ┌─────┐
      │ bar │
      │ --- │
      │ str │
      ╞═════╡
      │ a   │
      │ b   │
      └─────┘
      >>> df.select(pl.col(pl.Int64, pl.Float64))
      shape: (2, 3)
      ┌─────┬───────────┬─────┐
      │ ham ┆ hamburger ┆ foo │
      │ --- ┆ ---       ┆ --- │
      │ i64 ┆ i64       ┆ i64 │
      ╞═════╪═══════════╪═════╡
      │ 1   ┆ 11        ┆ 2   │
      │ 2   ┆ 22        ┆ 1   │
      └─────┴───────────┴─────┘
  
      """
      return _create_col(name, *more_names)
  
file_path: polars/py-polars/polars/functions/col.py
imports: from __future__ import annotations
  import contextlib
  from typing import TYPE_CHECKING, Any, Iterable, Protocol, cast
  from polars.datatypes import is_polars_dtype
  from polars.utils._wrap import wrap_expr
label_desc: Use image node_id 1 for calling the ColumnFactory obj's underlying member method code with example usage: obj.__new__(cls, name) and returns: _create_col