1.7 KiB
Vendored
1.7 KiB
Vendored
CSV / TSV
Work with CSV and TSV files — read, analyze, and export tabular data using Kotlin DataFrame. Seamlessly load and write CSV or TSV files in Kotlin — perfect for common tabular data workflows. Kotlin DataFrame support for reading and writing CSV and TSV files with simple, type-safe APIs.Kotlin DataFrame supports reading from and writing to CSV and TSV files.
Requires the dataframe-csv module,
which is included by default in the general dataframe
artifact and in %use dataframe for Kotlin Notebook.
Read
You can read a DataFrame from a CSV or TSV file (via a file path or URL)
using the readCsv() or readTsv() methods:
val df = DataFrame.readCsv("example.csv")
val df = DataFrame.readCsv("https://kotlin.github.io/dataframe/resources/example.csv")
Write
You can write a DataFrame to a CSV file using the writeCsv() method:
df.writeCsv("example.csv")
Deephaven CSV
The dataframe-csv module uses the high-performance
Deephaven CSV library under the hood
for fast and efficient CSV reading and writing.
If you're working with large CSV files, you can adjust the parser manually by configuring Deephaven-specific parameters to get the best performance for your use case.