Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/docs/source/user-guide/io/csv.md
6940 views

CSV

Read & write

Reading a CSV file should look familiar:

{{code_block('user-guide/io/csv','read',['read_csv'])}}

Writing a CSV file is similar with the write_csv function:

{{code_block('user-guide/io/csv','write',['write_csv'])}}

Scan

Polars allows you to scan a CSV input. Scanning delays the actual parsing of the file and instead returns a lazy computation holder called a LazyFrame.

{{code_block('user-guide/io/csv','scan',['scan_csv'])}}

If you want to know why this is desirable, you can read more about these Polars optimizations here.