In Polars, it is simple enough to serialize a DataFrame
to a json string: JsonWriter::new(dest).finish(&df)?
.
Is it possible to serialize to a json Value — a serde_json::Value
— that is the Value::Array
of records? Obviously, I could write the json to an in-memory string, then deserialize it into a serde_json::Value
. But I'm wondering if there is a direct path from DataFrame
to serde_json::Value
.
This would be the rough equivalent of pandas df.to_dict(orient="records")
.