From d7e95926713745cada4d776efab8ffcea8b8c528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 8 Mar 2025 13:31:12 +0100 Subject: [PATCH] Pandas csv bullets --- README.md | 5 +++-- index.html | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b4259e5..7a4b022 100644 --- a/README.md +++ b/README.md @@ -3365,8 +3365,9 @@ c 6 7 .to_sql('', ) # Also `if_exists='fail/replace/append'`. ``` * **`'$ pip3 install "pandas[excel]" odfpy lxml pyarrow'` installs dependencies.** -* **Read\_csv() only parses dates of columns that were specified by 'parse\_dates' argument. It automatically tries to detect the format, but it can be helped with 'date\_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.** -* **If 'parse\_dates' and 'index_col' are the same column, we get a DF with DatetimeIndex. Its `'resample("y/m/d/h")'` method returns a Resampler object that is similar to GroupBy.** +* **Csv functions use the same dialect as standard library's csv module (e.g. `'sep=","'`).** +* **Read\_csv() only parses dates of columns that are listed in 'parse\_dates'. It automatically tries to detect the format, but it can be helped with 'date\_format' or 'dayfirst' arguments.** +* **We get a dataframe with DatetimeIndex if 'parse_dates' argument includes 'index\_col'. Its `'resample("y/m/d/h")'` method returns Resampler object that is similar to GroupBy.** ### GroupBy **Object that groups together rows of a dataframe based on the value of the passed column.** diff --git a/index.html b/index.html index 06f1fca..b8998d7 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@
- +
@@ -2753,8 +2753,9 @@ c 6 7
  • '$ pip3 install "pandas[excel]" odfpy lxml pyarrow' installs dependencies.
  • -
  • Read_csv() only parses dates of columns that were specified by 'parse_dates' argument. It automatically tries to detect the format, but it can be helped with 'date_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.
  • -
  • If 'parse_dates' and 'index_col' are the same column, we get a DF with DatetimeIndex. Its 'resample("y/m/d/h")' method returns a Resampler object that is similar to GroupBy.
  • +
  • Csv functions use the same dialect as standard library's csv module (e.g. 'sep=","').
  • +
  • Read_csv() only parses dates of columns that are listed in 'parse_dates'. It automatically tries to detect the format, but it can be helped with 'date_format' or 'dayfirst' arguments.
  • +
  • We get a dataframe with DatetimeIndex if 'parse_dates' argument includes 'index_col'. Its 'resample("y/m/d/h")' method returns Resampler object that is similar to GroupBy.

GroupBy

Object that groups together rows of a dataframe based on the value of the passed column.

<GB> = <DF>.groupby(col_key/s)                 # Splits DF into groups based on passed column.
 <DF> = <GB>.apply/filter(<func>)               # Filter drops a group if func returns False.
@@ -2942,7 +2943,7 @@ $ deactivate                # Deactivates the active