polars.DataFrame.write_ndjson#

DataFrame.write_ndjson(file: None = None) str[source]#
DataFrame.write_ndjson(file: io.IOBase | str | pathlib.Path) None

Serialize to newline delimited JSON representation.

Parameters:
file

File path to which the result should be written. If set to None (default), the output is returned as a string instead.