From 12fe5a0de6dc0ef23ec21c60e6a63cfc1f10c9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 28 Nov 2024 17:01:48 +0100 Subject: [PATCH] Pandas --- README.md | 8 ++++---- index.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 804ed19..55517d8 100644 --- a/README.md +++ b/README.md @@ -3164,8 +3164,8 @@ Name: a, dtype: int64 ``` ```python - = pd.Series() # Assigns RangeIndex starting at 0. - = pd.Series() # Takes dictionary's keys for index. + = pd.Series() # Creates index from list's indices. + = pd.Series() # Creates index from dictionary's keys. = pd.Series(, index=) # Only keeps items with keys specified in index. ``` @@ -3193,7 +3193,7 @@ Name: a, dtype: int64 ``` ```python -.plot.line/area/bar/pie/hist() # Generates a Matplotlib plot. +.plot.line/area/bar/pie/hist() # Generates a plot. Accepts `title=`. plt.show() # Displays the plot. Also plt.savefig(). ``` * **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!** @@ -3269,7 +3269,7 @@ b 3 4 ```python = .head/tail/sample() # Returns first, last, or random n rows. - = .describe() # Describes columns. Also shape, info(), corr(). + = .describe() # Describes columns. Also info(), corr(), shape. = .query('') # Filters rows with e.g. 'col_1 == val_1 and …'. ``` diff --git a/index.html b/index.html index c2f9bfa..53ccff7 100644 --- a/index.html +++ b/index.html @@ -2580,8 +2580,8 @@ Name: a, dtype: int64 -
<S>  = pd.Series(<list>)                       # Assigns RangeIndex starting at 0.
-<S>  = pd.Series(<dict>)                       # Takes dictionary's keys for index.
+
<S>  = pd.Series(<list>)                       # Creates index from list's indices.
+<S>  = pd.Series(<dict>)                       # Creates index from dictionary's keys.
 <S>  = pd.Series(<dict/Series>, index=<list>)  # Only keeps items with keys specified in index.
 
<el> = <S>.loc[key]                            # Or: <S>.iloc[i]
@@ -2599,7 +2599,7 @@ Name: a, dtype: int64
 <S> = <S>.combine_first(<S>)                   # Adds items that are not yet present.
 <S>.update(<S>)                                # Updates items that are already present.
 
-
<S>.plot.line/area/bar/pie/hist()              # Generates a Matplotlib plot.
+
<S>.plot.line/area/bar/pie/hist()              # Generates a plot. Accepts `title=<str>`.
 plt.show()                                     # Displays the plot. Also plt.savefig(<path>).
 
    @@ -2659,7 +2659,7 @@ b 3 4 <DF> = <DF>.sort_values(col_key/s) # Sorts rows by passed column/s. Also `axis=1`.
<DF>   = <DF>.head/tail/sample(<int>)          # Returns first, last, or random n rows.
-<DF>   = <DF>.describe()                       # Describes columns. Also shape, info(), corr().
+<DF>   = <DF>.describe()                       # Describes columns. Also info(), corr(), shape.
 <DF>   = <DF>.query('<query>')                 # Filters rows with e.g. 'col_1 == val_1 and …'.
 
<DF>.plot.line/area/bar/scatter(x=col_key, …)  # `y=col_key/s`. Also hist/box(by=col_key).