Skip to content

Commit

Permalink
Update pandas.md
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay authored Nov 19, 2023
1 parent d3ef5fe commit 6ec0b79
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions source/python/pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,21 @@ df = pd.read_csv(

## Load and Save as Parquet

- save to parquet: `df.to_parquet("file_name.parquet.gz", compression="gzip", index=False)`
- see <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_parquet.html>
- load from parquet: `df = read_parquet("file_name.parquet.gz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.read_parquet.html>
- save to parquet
- `df.to_parquet("file_name.parquet.gz", compression="gzip", index=False)`
- see <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_parquet.html>
- load from parquet
- `df = read_parquet("file_name.parquet.gz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.read_parquet.html>

## Load and Save with Pickle

- save to parquet: `df.to_pickle("file_name.pkl.xz", compression="xz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_pickle.html>
- load from parquet: `df = read_pickle("file_name.pkl.xz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.read_pickle.html>
- save with pickle
- `df.to_pickle("file_name.pkl.xz", compression="xz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_pickle.html>
- load with pickle
- `df = read_pickle("file_name.pkl.xz")`
- see <https://pandas.pydata.org/docs/reference/api/pandas.read_pickle.html>

## Display Data

Expand Down

0 comments on commit 6ec0b79

Please sign in to comment.