admin管理员组

文章数量:1122832

I am trying to print a dataframe in rust. This is my code:

use polars_core::prelude::*;
use polars_io::prelude::*;

fn main() {
    let test_df = example();
    println!("{:?}", test_df);
}

fn example() -> DataFrame {
            CsvReadOptions::default()
            .with_has_header(true)
            .try_into_reader_with_file_path(Some("C://Rust_WS//test_dataframe//test.csv".into()))
            .unwrap()
            .finish()
            .unwrap()
}

Output of that 'cargo run' is:

PS C:\Rust_WS\test_dataframe> cargo run
   Compiling test_dataframe v0.1.0 (C:\Rust_WS\test_dataframe)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.16s
     Running `target\debug\test_dataframe.exe`
shape: (5, 3)
to see more, compile with the 'fmt' or 'fmt_no_tty' feature
PS C:\Rust_WS\test_dataframe> 

How to print the contents of the data frame?

本文标签: Printing Polars dataframe in RUSTStack Overflow