英文:
How do I get a column of a dataframe as a series
问题
如何将"start"作为一个序列获取?我看不到一个名为to_series或类似的方法。
英文:
I have the following code:
use polars::prelude::*;
use polars_lazy::prelude::*;
pub fn main() -> Result<(), PolarsError> {
let df = df! (
"start" => &[3, 8, 5],
"end" => &[6, 9, 7],
"idx" => &[0, 1, 2],
)?;
}
How do I get "start" as a series? I can't see a to_series or anything.
答案1
得分: 1
那很容易:
let s = df.column("start").unwrap();
print!("{}", s);
英文:
That was easy:
let s = df.column("start").unwrap();
print!("{}", s);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论