CSV is universal but slow and lossy (everything is text). For real pipelines, pandas reads and writes efficient binary formats and talks to databases directly.
Parquet over CSV
df.to_parquet("data.parquet") # columnar, compressed, keeps dtypesdf = pd.read_parquet("data.parquet") # much faster than CSV to reload
Databases
df = pd.read_sql("SELECT * FROM students WHERE package > 7", conn)df.to_sql("results", conn, if_exists="replace", index=False)
Key takeaways
- 01Parquet is columnar, compressed, typed and much faster than CSV to reload.
- 02read_sql / to_sql move data between pandas and databases.
- 03CSV is universal but slow and loses dtypes; prefer Parquet for your own pipelines.
- 04Choose the format by audience: Parquet for pipelines, CSV for interchange.
