From 8bf7bece10be9b70b752d2d2798751337d7612bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 4 Feb 2022 15:03:29 +0100 Subject: [PATCH] Pandas --- README.md | 111 +++++++++++++++++++++++++------------------------ index.html | 119 ++++++++++++++++++++++++++--------------------------- parse.js | 94 +++++++++++++++++++++--------------------- 3 files changed, 161 insertions(+), 163 deletions(-) diff --git a/README.md b/README.md index a822351..34e688f 100644 --- a/README.md +++ b/README.md @@ -3142,11 +3142,11 @@ Name: a, dtype: int64 #### Aggregate, Transform, Map: ```python - = .sum/max/mean/idxmax/all() # Or: .aggregate() - = .rank/diff/cumsum/ffill/interpl() # Or: .agg/transform() - = .fillna() # Or: .apply/agg/transform/map() + = .sum/max/mean/idxmax/all() # Or: .agg(lambda : ) + = .rank/diff/cumsum/ffill/interpl() # Or: .agg/transform(lambda : ) + = .fillna() # Or: .agg/transform/map(lambda : ) ``` -* **The way `'aggregate()'` and `'transform()'` find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series.** +* **The way `'agg()'` and `'transform()'` find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series. `'agg()'` only accepts Attribute/Type/ValueError.** ```python >>> sr = Series([1, 2], index=['x', 'y']) @@ -3155,22 +3155,22 @@ y 2 ``` ```text -+-------------+-------------+-------------+---------------+ -| | 'sum' | ['sum'] | {'s': 'sum'} | -+-------------+-------------+-------------+---------------+ -| sr.apply(…) | 3 | sum 3 | s 3 | -| sr.agg(…) | | | | -+-------------+-------------+-------------+---------------+ ++-----------------+-------------+-------------+---------------+ +| | 'sum' | ['sum'] | {'s': 'sum'} | ++-----------------+-------------+-------------+---------------+ +| sr.apply(…) | 3 | sum 3 | s 3 | +| sr.agg(…) | | | | ++-----------------+-------------+-------------+---------------+ ``` ```text -+-------------+-------------+-------------+---------------+ -| | 'rank' | ['rank'] | {'r': 'rank'} | -+-------------+-------------+-------------+---------------+ -| sr.apply(…) | | rank | | -| sr.agg(…) | x 1 | x 1 | r x 1 | -| sr.trans(…) | y 2 | y 2 | y 2 | -+-------------+-------------+-------------+---------------+ ++-----------------+-------------+-------------+---------------+ +| | 'rank' | ['rank'] | {'r': 'rank'} | ++-----------------+-------------+-------------+---------------+ +| sr.apply(…) | | rank | | +| sr.agg(…) | x 1 | x 1 | r x 1 | +| sr.transform(…) | y 2 | y 2 | y 2 | ++-----------------+-------------+-------------+---------------+ ``` * **Last result has a hierarchical index. Use `'[key_1, key_2]'` to get its values.** @@ -3260,11 +3260,11 @@ c 6 7 #### Aggregate, Transform, Map: ```python - = .sum/max/mean/idxmax/all() # Or: .apply/agg/transform() - = .rank/diff/cumsum/ffill/interpl() # Or: .apply/agg/transform() - = .fillna() # Or: .applymap() + = .sum/max/mean/idxmax/all() # Or: .apply/agg(lambda : ) + = .rank/diff/cumsum/ffill/interpl() # Or: .apply/agg/transform(lambda : ) + = .fillna() # Or: .applymap(lambda : ) ``` -* **All operations operate on columns by default. Use `'axis=1'` parameter to process the rows instead.** +* **All operations operate on columns by default. Use `'axis=1'` parameter to process the rows instead. Transform passes DF to a function if it rases an error after receiving a Sr.** ```python >>> df = DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y']) @@ -3274,24 +3274,24 @@ b 3 4 ``` ```text -+-------------+-------------+-------------+---------------+ -| | 'sum' | ['sum'] | {'x': 'sum'} | -+-------------+-------------+-------------+---------------+ -| df.apply(…) | | x y | | -| df.agg(…) | x 4 | sum 4 6 | x 4 | -| | y 6 | | | -+-------------+-------------+-------------+---------------+ ++-----------------+-------------+-------------+---------------+ +| | 'sum' | ['sum'] | {'x': 'sum'} | ++-----------------+-------------+-------------+---------------+ +| df.apply(…) | | x y | | +| df.agg(…) | x 4 | sum 4 6 | x 4 | +| | y 6 | | | ++-----------------+-------------+-------------+---------------+ ``` ```text -+-------------+-------------+-------------+---------------+ -| | 'rank' | ['rank'] | {'x': 'rank'} | -+-------------+-------------+-------------+---------------+ -| df.apply(…) | x y | x y | x | -| df.agg(…) | a 1 1 | rank rank | a 1 | -| df.trans(…) | b 2 2 | a 1 1 | b 2 | -| | | b 2 2 | | -+-------------+-------------+-------------+---------------+ ++-----------------+-------------+-------------+---------------+ +| | 'rank' | ['rank'] | {'x': 'rank'} | ++-----------------+-------------+-------------+---------------+ +| df.apply(…) | x y | x y | x | +| df.agg(…) | a 1 1 | rank rank | a 1 | +| df.transform(…) | b 2 2 | a 1 1 | b 2 | +| | | b 2 2 | | ++-----------------+-------------+-------------+---------------+ ``` * **Use `'[col_key_1, col_key_2][row_key]'` to get the fifth result's values.** @@ -3315,9 +3315,6 @@ b 3 4 ```python >>> df = DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 6]], index=list('abc'), columns=list('xyz')) ->>> df.groupby('z').get_group(3) - x y -a 1 2 >>> df.groupby('z').get_group(6) x y b 4 5 @@ -3327,13 +3324,15 @@ c 7 8 ```python = .groupby(column_key/s) # DF is split into groups based on passed column. = .get_group(group_key/s) # Selects a group by value of grouping column. + = .apply() # Maps each group. Func can return DF, Sr or el. + = [column_key] # A single column GB. All operations return a Sr. ``` #### Aggregate, Transform, Map: ```python - = .sum/max/mean/idxmax/all() # Or: .apply/agg() - = .rank/diff/cumsum/ffill() # Or: .aggregate() - = .fillna() # Or: .transform() + = .sum/max/mean/idxmax/all() # Or: .agg(lambda : ) + = .rank/diff/cumsum/ffill() # Or: .transform(lambda : ) + = .fillna() # Or: .transform(lambda : ) ``` ```python @@ -3345,20 +3344,20 @@ c 7 8 ``` ```text -+-------------+-------------+-------------+-------------+---------------+ -| | 'sum' | 'rank' | ['rank'] | {'x': 'rank'} | -+-------------+-------------+-------------+-------------+---------------+ -| gb.agg(…) | x y | x y | x y | x | -| | z | a 1 1 | rank rank | a 1 | -| | 3 1 2 | b 1 1 | a 1 1 | b 1 | -| | 6 11 13 | c 2 2 | b 1 1 | c 2 | -| | | | c 2 2 | | -+-------------+-------------+-------------+-------------+---------------+ -| gb.trans(…) | x y | x y | | | -| | a 1 2 | a 1 1 | | | -| | b 11 13 | b 1 1 | | | -| | c 11 13 | c 1 1 | | | -+-------------+-------------+-------------+-------------+---------------+ ++-----------------+-------------+-------------+-------------+---------------+ +| | 'sum' | 'rank' | ['rank'] | {'x': 'rank'} | ++-----------------+-------------+-------------+-------------+---------------+ +| gb.agg(…) | x y | x y | x y | x | +| | z | a 1 1 | rank rank | a 1 | +| | 3 1 2 | b 1 1 | a 1 1 | b 1 | +| | 6 11 13 | c 2 2 | b 1 1 | c 2 | +| | | | c 2 2 | | ++-----------------+-------------+-------------+-------------+---------------+ +| gb.transform(…) | x y | x y | | | +| | a 1 2 | a 1 1 | | | +| | b 11 13 | b 1 1 | | | +| | c 11 13 | c 2 2 | | | ++-----------------+-------------+-------------+-------------+---------------+ ``` ### Rolling diff --git a/index.html b/index.html index 278a4f5..90ad9fd 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -2549,32 +2549,32 @@ Name: a, dtype: int64 <Sr> = <Sr>.combine_first(<Sr>) # Adds items that are not yet present. <Sr>.update(<Sr>) # Updates items that are already present. -

Aggregate, Transform, Map:

<el> = <Sr>.sum/max/mean/idxmax/all()         # Or: <Sr>.aggregate(<agg_func>)
-<Sr> = <Sr>.rank/diff/cumsum/ffill/interpl()  # Or: <Sr>.agg/transform(<trans_func>)
-<Sr> = <Sr>.fillna(<el>)                      # Or: <Sr>.apply/agg/transform/map(<map_func>)
+

Aggregate, Transform, Map:

<el> = <Sr>.sum/max/mean/idxmax/all()         # Or: <Sr>.agg(lambda <Sr>: <el>)
+<Sr> = <Sr>.rank/diff/cumsum/ffill/interpl()  # Or: <Sr>.agg/transform(lambda <Sr>: <Sr>)
+<Sr> = <Sr>.fillna(<el>)                      # Or: <Sr>.agg/transform/map(lambda <el>: <el>)
 
    -
  • The way 'aggregate()' and 'transform()' find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series.
  • +
  • The way 'agg()' and 'transform()' find out whether the passed function accepts an element or the whole Series is by passing it a single value at first and if it raises an error, then they pass it the whole Series. 'agg()' only accepts Attribute/Type/ValueError.
>>> sr = Series([1, 2], index=['x', 'y'])
 x    1
 y    2
 
-
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃             │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃
-┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ sr.apply(…) │      3      │    sum  3   │     s  3      ┃
-┃ sr.agg(…)   │             │             │               ┃
-┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
-
-
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃             │    'rank'   │   ['rank']  │ {'r': 'rank'} ┃
-┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ sr.apply(…) │             │      rank   │               ┃
-┃ sr.agg(…)   │     x  1    │   x     1   │    r  x  1    ┃
-┃ sr.trans(…) │     y  2    │   y     2   │       y  2    ┃
-┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃                 │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃
+┠─────────────────┼─────────────┼─────────────┼───────────────┨
+┃ sr.apply(…)     │      3      │    sum  3   │     s  3      ┃
+┃ sr.agg(…)       │             │             │               ┃
+┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
+
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃                 │    'rank'   │   ['rank']  │ {'r': 'rank'} ┃
+┠─────────────────┼─────────────┼─────────────┼───────────────┨
+┃ sr.apply(…)     │             │      rank   │               ┃
+┃ sr.agg(…)       │     x  1    │   x     1   │    r  x  1    ┃
+┃ sr.transform(…) │     y  2    │   y     2   │       y  2    ┃
+┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
  • Last result has a hierarchical index. Use '<Sr>[key_1, key_2]' to get its values.
  • @@ -2646,35 +2646,35 @@ c 6 7 ┃ │ c . 6 7 │ │ │ R must be a DataFrame. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛
-

Aggregate, Transform, Map:

<Sr> = <DF>.sum/max/mean/idxmax/all()         # Or: <DF>.apply/agg/transform(<agg_func>)
-<DF> = <DF>.rank/diff/cumsum/ffill/interpl()  # Or: <DF>.apply/agg/transform(<trans_func>)
-<DF> = <DF>.fillna(<el>)                      # Or: <DF>.applymap(<map_func>)
+

Aggregate, Transform, Map:

<Sr> = <DF>.sum/max/mean/idxmax/all()         # Or: <DF>.apply/agg(lambda <Sr>: <el>)
+<DF> = <DF>.rank/diff/cumsum/ffill/interpl()  # Or: <DF>.apply/agg/transform(lambda <Sr>: <Sr>)
+<DF> = <DF>.fillna(<el>)                      # Or: <DF>.applymap(lambda <el>: <el>)
 
    -
  • All operations operate on columns by default. Use 'axis=1' parameter to process the rows instead.
  • +
  • All operations operate on columns by default. Use 'axis=1' parameter to process the rows instead. Transform passes DF to a function if it rases an error after receiving a Sr.
>>> df = DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y'])
    x  y
 a  1  2
 b  3  4
 
-
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃             │    'sum'    │   ['sum']   │ {'x': 'sum'}  ┃
-┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ df.apply(…) │             │       x  y  │               ┃
-┃ df.agg(…)   │     x  4    │  sum  4  6  │     x  4      ┃
-┃             │     y  6    │             │               ┃
-┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
-
-
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃             │    'rank'   │   ['rank']  │ {'x': 'rank'} ┃
-┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ df.apply(…) │      x  y   │      x    y │        x      ┃
-┃ df.agg(…)   │   a  1  1   │   rank rank │     a  1      ┃
-┃ df.trans(…) │   b  2  2   │ a    1    1 │     b  2      ┃
-┃             │             │ b    2    2 │               ┃
-┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃                 │    'sum'    │   ['sum']   │ {'x': 'sum'}  ┃
+┠─────────────────┼─────────────┼─────────────┼───────────────┨
+┃ df.apply(…)     │             │       x  y  │               ┃
+┃ df.agg(…)       │     x  4    │  sum  4  6  │     x  4      ┃
+┃                 │     y  6    │             │               ┃
+┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
+
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃                 │    'rank'   │   ['rank']  │ {'x': 'rank'} ┃
+┠─────────────────┼─────────────┼─────────────┼───────────────┨
+┃ df.apply(…)     │      x  y   │      x    y │        x      ┃
+┃ df.agg(…)       │   a  1  1   │   rank rank │     a  1      ┃
+┃ df.transform(…) │   b  2  2   │ a    1    1 │     b  2      ┃
+┃                 │             │ b    2    2 │               ┃
+┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
  • Use '<DF>[col_key_1, col_key_2][row_key]' to get the fifth result's values.
  • @@ -2691,9 +2691,6 @@ b 3 4 <DF>.to_sql('<table_name>', <connection>)

GroupBy

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

>>> df = DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 6]], index=list('abc'), columns=list('xyz'))
->>> df.groupby('z').get_group(3)
-   x  y
-a  1  2
 >>> df.groupby('z').get_group(6)
    x  y
 b  4  5
@@ -2703,10 +2700,12 @@ c  7  8
 
 
<GB> = <DF>.groupby(column_key/s)             # DF is split into groups based on passed column.
 <DF> = <GB>.get_group(group_key/s)            # Selects a group by value of grouping column.
+<DF> = <GB>.apply(<func>)                     # Maps each group. Func can return DF, Sr or el.
+<GB> = <GB>[column_key]                       # A single column GB. All operations return a Sr.
 
-

Aggregate, Transform, Map:

<DF> = <GB>.sum/max/mean/idxmax/all()         # Or: <GB>.apply/agg(<agg_func>)
-<DF> = <GB>.rank/diff/cumsum/ffill()          # Or: <GB>.aggregate(<trans_func>)
-<DF> = <GB>.fillna(<el>)                      # Or: <GB>.transform(<map_func>)
+

Aggregate, Transform, Map:

<DF> = <GB>.sum/max/mean/idxmax/all()         # Or: <GB>.agg(lambda <Sr>: <el>)
+<DF> = <GB>.rank/diff/cumsum/ffill()          # Or: <GB>.transform(lambda <Sr>: <Sr>)
+<DF> = <GB>.fillna(<el>)                      # Or: <GB>.transform(lambda <Sr>: <Sr>)
 
>>> gb = df.groupby('z')
@@ -2715,20 +2714,20 @@ c  7  8
 6: b  4  5  6
    c  7  8  6
 
-
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
-┃             │    'sum''rank'   │   ['rank']  │ {'x': 'rank'} ┃
-┠─────────────┼─────────────┼─────────────┼─────────────┼───────────────┨
-┃ gb.agg(…)   │      x   y  │      x  y   │      x    y │        x      ┃
-┃             │  z          │   a  1  1   │   rank rank │     a  1      ┃
-┃             │  3   1   2  │   b  1  1   │ a    1    1 │     b  1      ┃
-┃             │  6  11  13  │   c  2  2   │ b    1    1 │     c  2      ┃
-┃             │             │             │ c    2    2 │               ┃
-┠─────────────┼─────────────┼─────────────┼─────────────┼───────────────┨
-┃ gb.trans(…) │      x   y  │      x  y   │             │               ┃
-┃             │  a   1   2  │   a  1  1   │             │               ┃
-┃             │  b  11  13  │   b  1  1   │             │               ┃
-┃             │  c  11  13  │   c  1  1   │             │               ┃
-┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
+
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
+┃                 │    'sum''rank'   │   ['rank']  │ {'x': 'rank'} ┃
+┠─────────────────┼─────────────┼─────────────┼─────────────┼───────────────┨
+┃ gb.agg(…)       │      x   y  │      x  y   │      x    y │        x      ┃
+┃                 │  z          │   a  1  1   │   rank rank │     a  1      ┃
+┃                 │  3   1   2  │   b  1  1   │ a    1    1 │     b  1      ┃
+┃                 │  6  11  13  │   c  2  2   │ b    1    1 │     c  2      ┃
+┃                 │             │             │ c    2    2 │               ┃
+┠─────────────────┼─────────────┼─────────────┼─────────────┼───────────────┨
+┃ gb.transform(…) │      x   y  │      x  y   │             │               ┃
+┃                 │  a   1   2  │   a  1  1   │             │               ┃
+┃                 │  b  11  13  │   b  1  1   │             │               ┃
+┃                 │  c  11  13  │   c  2  2   │             │               ┃
+┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 

Rolling

Object for rolling window calculations.

<R_Sr/R_DF/R_GB> = <Sr/DF/GB>.rolling(window_size)  # Also: `min_periods=None, center=False`.
 <R_Sr/R_DF>      = <R_DF/R_GB>[column_key/s]        # Or: <R>.column_key
@@ -2882,7 +2881,7 @@ $ pyinstaller script.py --add-data '<path>:.'  
  
 
   
- +
diff --git a/parse.js b/parse.js index 2a8e96f..acce349 100755 --- a/parse.js +++ b/parse.js @@ -308,27 +308,27 @@ const DIAGRAM_12_B = '┗━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━━━┛\n'; const DIAGRAM_13_A = - '| sr.apply(…) | 3 | sum 3 | s 3 |'; + '| sr.apply(…) | 3 | sum 3 | s 3 |'; const DIAGRAM_13_B = - "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" + - "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ sr.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" + - "┃ sr.agg(…) │ │ │ ┃\n" + - "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ sr.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" + + "┃ sr.agg(…) │ │ │ ┃\n" + + "┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_14_A = - '| sr.apply(…) | | rank | |'; + '| sr.apply(…) | | rank | |'; const DIAGRAM_14_B = - "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" + - "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ sr.apply(…) │ │ rank │ ┃\n" + - "┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃\n" + - "┃ sr.trans(…) │ y 2 │ y 2 │ y 2 ┃\n" + - "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ sr.apply(…) │ │ rank │ ┃\n" + + "┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃\n" + + "┃ sr.transform(…) │ y 2 │ y 2 │ y 2 ┃\n" + + "┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_15_A = '+------------------------+---------------+------------+------------+--------------------------+'; @@ -365,48 +365,48 @@ const DIAGRAM_15_B = "┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_16_A = - '| df.apply(…) | | x y | |'; + '| df.apply(…) | | x y | |'; const DIAGRAM_16_B = - "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'sum' │ ['sum'] │ {'x': 'sum'} ┃\n" + - "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ df.apply(…) │ │ x y │ ┃\n" + - "┃ df.agg(…) │ x 4 │ sum 4 6 │ x 4 ┃\n" + - "┃ │ y 6 │ │ ┃\n" + - "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'sum' │ ['sum'] │ {'x': 'sum'} ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ df.apply(…) │ │ x y │ ┃\n" + + "┃ df.agg(…) │ x 4 │ sum 4 6 │ x 4 ┃\n" + + "┃ │ y 6 │ │ ┃\n" + + "┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_17_A = - '| df.apply(…) | x y | x y | x |'; + '| df.apply(…) | x y | x y | x |'; const DIAGRAM_17_B = - "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'rank' │ ['rank'] │ {'x': 'rank'} ┃\n" + - "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ df.apply(…) │ x y │ x y │ x ┃\n" + - "┃ df.agg(…) │ a 1 1 │ rank rank │ a 1 ┃\n" + - "┃ df.trans(…) │ b 2 2 │ a 1 1 │ b 2 ┃\n" + - "┃ │ │ b 2 2 │ ┃\n" + - "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'rank' │ ['rank'] │ {'x': 'rank'} ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ df.apply(…) │ x y │ x y │ x ┃\n" + + "┃ df.agg(…) │ a 1 1 │ rank rank │ a 1 ┃\n" + + "┃ df.transform(…) │ b 2 2 │ a 1 1 │ b 2 ┃\n" + + "┃ │ │ b 2 2 │ ┃\n" + + "┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const DIAGRAM_18_A = - '| gb.agg(…) | x y | x y | x y | x |'; + '| gb.agg(…) | x y | x y | x y | x |'; const DIAGRAM_18_B = - "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + - "┃ │ 'sum' │ 'rank' │ ['rank'] │ {'x': 'rank'} ┃\n" + - "┠─────────────┼─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ gb.agg(…) │ x y │ x y │ x y │ x ┃\n" + - "┃ │ z │ a 1 1 │ rank rank │ a 1 ┃\n" + - "┃ │ 3 1 2 │ b 1 1 │ a 1 1 │ b 1 ┃\n" + - "┃ │ 6 11 13 │ c 2 2 │ b 1 1 │ c 2 ┃\n" + - "┃ │ │ │ c 2 2 │ ┃\n" + - "┠─────────────┼─────────────┼─────────────┼─────────────┼───────────────┨\n" + - "┃ gb.trans(…) │ x y │ x y │ │ ┃\n" + - "┃ │ a 1 2 │ a 1 1 │ │ ┃\n" + - "┃ │ b 11 13 │ b 1 1 │ │ ┃\n" + - "┃ │ c 11 13 │ c 1 1 │ │ ┃\n" + - "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; + "┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" + + "┃ │ 'sum' │ 'rank' │ ['rank'] │ {'x': 'rank'} ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ gb.agg(…) │ x y │ x y │ x y │ x ┃\n" + + "┃ │ z │ a 1 1 │ rank rank │ a 1 ┃\n" + + "┃ │ 3 1 2 │ b 1 1 │ a 1 1 │ b 1 ┃\n" + + "┃ │ 6 11 13 │ c 2 2 │ b 1 1 │ c 2 ┃\n" + + "┃ │ │ │ c 2 2 │ ┃\n" + + "┠─────────────────┼─────────────┼─────────────┼─────────────┼───────────────┨\n" + + "┃ gb.transform(…) │ x y │ x y │ │ ┃\n" + + "┃ │ a 1 2 │ a 1 1 │ │ ┃\n" + + "┃ │ b 11 13 │ b 1 1 │ │ ┃\n" + + "┃ │ c 11 13 │ c 2 2 │ │ ┃\n" + + "┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n"; const MENU = 'Download text file, Buy PDF, Fork me on GitHub, Check out FAQ or Switch to dark theme.\n';