0

I got my file be a varible data_batch that is Vec now I want to convert to to polars DataFrame(df). I have no idea how to do this. There are no examples of this ...

I expect a way to convert to polars dataframe to be possible as I have properly formatted batches with schema applied.

works up to here for now

        let batches = Reader::new(cursor, S3File::get_schema().into(), DecoderOptions::new())
            .into_iter()
            .collect::<Result<Vec<_>, _>>()
            .unwrap();

        println!("{:?}", batches);

// how to make batches a dataframe in polars?
andy8203
  • 51
  • 2
  • https://pola-rs.github.io/polars/src/polars_core/datatypes/field.rs.html#113-158, [`impl FromIterator for Schema`](https://docs.rs/polars/latest/polars/chunked_array/object/struct.Schema.html#impl-FromIterator%3CJ%3E-for-Schema), [`impl From for DataFrame`](https://docs.rs/polars/latest/polars/chunked_array/object/struct.Schema.html#impl-From%3C%26Schema%3E-for-DataFrame), [`DataFrame::vstack`](https://docs.rs/polars/latest/polars/frame/struct.DataFrame.html#method.vstack), [`DataFrame::new`](https://docs.rs/polars/latest/polars/frame/struct.DataFrame.html#method.new), etc. – Solomon Ucko Feb 20 '23 at 19:51

0 Answers0