Created
June 28, 2021 14:49
-
-
Save Steboss89/778947940c7a9665a474e61681286900 to your computer and use it in GitHub Desktop.
Check a dataframe column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn deal_with_columns<P: AsRef<Path>>(path: P) -> () { | |
/* Examples to deal with column and column names and enumerate */ | |
let df = read_csv(&path).unwrap(); | |
// column functions | |
let columns = df.get_columns(); // you can do for column in columns{} | |
let columname = df.get_column_names(); | |
// example like Python for i, val in enumerate(list, 0): | |
for (i, column) in columns.iter().enumerate(){ | |
println!("{}, {}", column, columname[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment