From c2c7ca22c0fef41549700ca827ad5c1be71b6698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 7 Nov 2024 19:18:11 +0100 Subject: [PATCH] Pandas --- README.md | 26 +++++++++++++------------- index.html | 28 ++++++++++++++-------------- parse.js | 30 +++++++++++++++--------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index ba71056..eaf4779 100644 --- a/README.md +++ b/README.md @@ -3207,22 +3207,22 @@ plt.show() # Displays the plot. Also plt.sav ``` ```text -+---------------+-------------+-------------+---------------+ -| | 'sum' | ['sum'] | {'s': 'sum'} | -+---------------+-------------+-------------+---------------+ -| s.apply(…) | 3 | sum 3 | s 3 | -| s.agg(…) | | | | -+---------------+-------------+-------------+---------------+ ++--------------+-------------+-------------+---------------+ +| | 'sum' | ['sum'] | {'s': 'sum'} | ++--------------+-------------+-------------+---------------+ +| s.apply(…) | 3 | sum 3 | s 3 | +| s.agg(…) | | | | ++--------------+-------------+-------------+---------------+ ``` ```text -+---------------+-------------+-------------+---------------+ -| | 'rank' | ['rank'] | {'r': 'rank'} | -+---------------+-------------+-------------+---------------+ -| s.apply(…) | | rank | | -| s.agg(…) | x 1.0 | x 1.0 | r x 1.0 | -| | y 2.0 | y 2.0 | y 2.0 | -+---------------+-------------+-------------+---------------+ ++--------------+-------------+-------------+---------------+ +| | 'rank' | ['rank'] | {'r': 'rank'} | ++--------------+-------------+-------------+---------------+ +| s.apply(…) | | rank | | +| s.agg(…) | x 1.0 | x 1.0 | r x 1.0 | +| | y 2.0 | y 2.0 | y 2.0 | ++--------------+-------------+-------------+---------------+ ``` * **Methods ffill(), interpolate(), fillna() and dropna() accept `'inplace=True'`.** * **Last result has a multi-index. Use `'[key_1, key_2]'` to get its values.** diff --git a/index.html b/index.html index 21263f3..5321090 100644 --- a/index.html +++ b/index.html @@ -2611,20 +2611,20 @@ plt.show() # Disp <S> = <S>.isna/fillna/isin([<el/coll>]) # Or: <S>.agg/transform/map(lambda <el>: <el>) -
┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃               │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃
-┠───────────────┼─────────────┼─────────────┼───────────────┨
-┃ s.apply(…)    │      3      │    sum  3   │     s  3      ┃
-┃ s.agg(…)      │             │             │               ┃
-┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
-
-┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃               │    'rank'   │   ['rank']  │ {'r': 'rank'} ┃
-┠───────────────┼─────────────┼─────────────┼───────────────┨
-┃ s.apply(…)    │             │      rank   │               ┃
-┃ s.agg(…)      │    x  1.0   │   x   1.0   │   r  x  1.0   ┃
-┃               │    y  2.0   │   y   2.0   │      y  2.0   ┃
-┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃              │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃
+┠──────────────┼─────────────┼─────────────┼───────────────┨
+┃ s.apply(…)   │      3      │    sum  3   │     s  3      ┃
+┃ s.agg(…)     │             │             │               ┃
+┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
+┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃              │    'rank'   │   ['rank']  │ {'r': 'rank'} ┃
+┠──────────────┼─────────────┼─────────────┼───────────────┨
+┃ s.apply(…)   │             │      rank   │               ┃
+┃ s.agg(…)     │    x  1.0   │   x   1.0   │   r  x  1.0   ┃
+┃              │    y  2.0   │   y   2.0   │      y  2.0   ┃
+┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
    diff --git a/parse.js b/parse.js index 9128106..50c4790 100755 --- a/parse.js +++ b/parse.js @@ -582,26 +582,26 @@ const DIAGRAM_12_B = '┗━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━┛\n'; const DIAGRAM_13_A = - '| s.apply(…) | 3 | sum 3 | s 3 |'; + '| s.apply(…) | 3 | sum 3 | s 3 |'; const DIAGRAM_13_B = - "┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" + - "┠───────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ s.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" + - "┃ s.agg(…) │ │ │ ┃\n" + - "┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n" + + "┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" + + "┠──────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ s.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" + + "┃ s.agg(…) │ │ │ ┃\n" + + "┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n" + "\n" + - "┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" + - "┠───────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ s.apply(…) │ │ rank │ ┃\n" + - "┃ s.agg(…) │ x 1.0 │ x 1.0 │ r x 1.0 ┃\n" + - "┃ │ y 2.0 │ y 2.0 │ y 2.0 ┃\n" + - "┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" + + "┠──────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ s.apply(…) │ │ rank │ ┃\n" + + "┃ s.agg(…) │ x 1.0 │ x 1.0 │ r x 1.0 ┃\n" + + "┃ │ y 2.0 │ y 2.0 │ y 2.0 ┃\n" + + "┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_14_A = - "| | 'rank' | ['rank'] | {'r': 'rank'} |"; + "| | 'rank' | ['rank'] | {'r': 'rank'} |"; const DIAGRAM_15_A = '+------------------------+---------------+------------+------------+--------------------------+';