pub fn rename(&mut self, column: &str, name: &str) -> Result<&mut Self> {
        self.select_mut(column)
            .ok_or_else(|| PolarsError::NotFound(name.to_string()))
            .map(|s| s.rename(name))?;
        Ok(self)
    }
/// Rename a column in the DataFrame
///
/// # Example
///
/// ```
/// use polars::prelude::*;
/// fn example(df: &mut DataFrame) -> Result<&mut DataFrame> {
///     let original_name = "foo";
///     let new_name = "bar";
///     df.rename(original_name, new_name)
/// }
/// ```
Rename a column in the DataFrame
Rename a column in the DataFrame
pub fn rename(&mut self, column: &str, name: &str) -> Result<&mut Self> {
        self.select_mut(column)
            .ok_or_else(|| PolarsError::NotFound(name.to_string()))
            .map(|s| s.rename(name))?;
        Ok(self)
    }
pub fn rename ( & mut self , column : & str , name : & str ) -> Result < & mut Self > { self . select_mut ( column ) . ok_or_else ( | | PolarsError :: NotFound ( name . to_string ( ) ) ) . map ( | s | s . rename ( name ) ) ? ; Ok ( self ) }
Rename a column in the DataFrame
Rename a column in the DataFrame
&mut self
column
&str
name
&str
&mut self
column
&str
name
&str
example
```
use polars::prelude::*;
fn example(df: &mut DataFrame) -> Result<&mut DataFrame> {
let original_name = "foo";
let new_name = "bar";
df.rename(original_name, new_name)
}
```
` ` ` use polars :: prelude :: * ; fn example ( df : &mut DataFrame ) - > Result<&mut DataFrame > { let original_name = " foo " ; let new_name = " bar " ; df . rename ( original_name new_name ) } ` ` `