What is the difference between save a pandas dataframe to pickle and to csv?
csv

✅human readable
✅cross platform
⛔slower
⛔more disk space
⛔doesn't preserve types in some cases

pickle

✅fast saving/loading
✅less disk space
⛔non human readable
⛔python only

Also take a look at parquet format (to_parquet, read_parquet)

✅fast saving/loading
✅less disk space than pickle
✅supported by many platforms
⛔non human readable
I am learning python pandas.
I see a tutorial which shows two ways to save a pandas dataframe.

pd.to_csv('sub.csv') and to open pd.read_csv('sub.csv')
pd.to_pickle('sub.pkl') and to open pd.read_pickle('sub.pkl')

The tutorial says to_pickle is to save the dataframe to disk. I am confused about this. Because when I use to_csv, I did see a csv file appears in the folder, which I assume is also save to disk right?
In general, why we want to save a dataframe using to_pickle rather than save it to csv or txt or other format?