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
版权声明:本文标题:Printing Polars dataframe in RUST - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283848a1927103.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论