class_docstr: Namespace for expressions that operate on expression names.
docstr: Keep the original root name of the expression.
  
  Notes
  -----
  Due to implementation constraints, this method can only be called as the last
  expression in a chain.
  
  See Also
  --------
  Expr.alias
  map
  
  Examples
  --------
  Prevent errors due to potential duplicate column names.
  
  >>> df = pl.DataFrame(
  ...     {
  ...         "a": [1, 2],
  ...         "b": [3, 4],
  ...     }
  ... )
  >>> df.select((pl.lit(10) / pl.all()).name.keep())
  shape: (2, 2)
  ┌──────┬──────────┐
  │ a    ┆ b        │
  │ ---  ┆ ---      │
  │ f64  ┆ f64      │
  ╞══════╪══════════╡
  │ 10.0 ┆ 3.333333 │
  │ 5.0  ┆ 2.5      │
  └──────┴──────────┘
  
  Undo an alias operation.
  
  >>> df.with_columns((pl.col("a") * 9).alias("c").name.keep())
  shape: (2, 2)
  ┌─────┬─────┐
  │ a   ┆ b   │
  │ --- ┆ --- │
  │ i64 ┆ i64 │
  ╞═════╪═════╡
  │ 9   ┆ 3   │
  │ 18  ┆ 4   │
  └─────┴─────┘
docstr_tok: ["Keep","the","original","root","name","of","the","expression",".","Notes","--","--","-","Due","to","implementation","constraints",",","this","method","can","only","be","called","as","the","last","expression","in","a","chain",".","See","Also","--","--","--","--","Expr.alias","map","Examples","--","--","--","--","Prevent","errors","due","to","potential","duplicate","column","names",".",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","a","''",":","[","1",",","2","]",",","...","``","b","''",":","[","3",",","4","]",",","...","}","...",")",">",">",">","df.select","(","(","pl.lit","(","10",")","\/","pl.all","(",")",")",".name.keep","(",")",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","a","\u2506","b","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","f64","\u2506","f64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","10.0","\u2506","3.333333","\u2502","\u2502","5.0","\u2506","2.5","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518","Undo","an","alias","operation",".",">",">",">","df.with_columns","(","(","pl.col","(","``","a","''",")","*","9",")",".alias","(","``","c","''",")",".name.keep","(",")",")","shape",":","(","2",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","a","\u2506","b","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","9","\u2506","3","\u2502","\u2502","18","\u2506","4","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def keep(self) -> Expr:
      """
      Keep the original root name of the expression.
  
      Notes
      -----
      Due to implementation constraints, this method can only be called as the last
      expression in a chain.
  
      See Also
      --------
      Expr.alias
      map
  
      Examples
      --------
      Prevent errors due to potential duplicate column names.
  
      >>> df = pl.DataFrame(
      ...     {
      ...         "a": [1, 2],
      ...         "b": [3, 4],
      ...     }
      ... )
      >>> df.select((pl.lit(10) / pl.all()).name.keep())
      shape: (2, 2)
      ┌──────┬──────────┐
      │ a    ┆ b        │
      │ ---  ┆ ---      │
      │ f64  ┆ f64      │
      ╞══════╪══════════╡
      │ 10.0 ┆ 3.333333 │
      │ 5.0  ┆ 2.5      │
      └──────┴──────────┘
  
      Undo an alias operation.
  
      >>> df.with_columns((pl.col("a") * 9).alias("c").name.keep())
      shape: (2, 2)
      ┌─────┬─────┐
      │ a   ┆ b   │
      │ --- ┆ --- │
      │ i64 ┆ i64 │
      ╞═════╪═════╡
      │ 9   ┆ 3   │
      │ 18  ┆ 4   │
      └─────┴─────┘
  
      """
      return self._from_pyexpr(self._pyexpr.name_keep())
  
file_path: polars/py-polars/polars/expr/name.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Callable
label_desc: Use image node_id 2 for calling the ExprNameNameSpace obj's underlying member method code with example usage: obj.keep() and returns: self