Processing polars DataFrame row-wise

I'm looking for an efficient way to process polars DataFrame row-wise in rust.

In general I need two types of operations:

  • conversion from a DataFrame to Vec<MyStruct>
  • conversion from a DataFrame to Vec<String> with a given std::fmt; Here I could print directly to a buffer

Currently I'm extracting columns from a DataFrame, zipping them and then use map() on the resulting iterator. Is there anything better?

Row-wise processing will never be efficient when using column-wise storage. Instead of zipping columns you could try DataFrame::into_struct instead, but I don't know if this is better or not. Example.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.