From 72673286e5e89f92fcc73337e270db5a198e9c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 25 Dec 2024 14:22:04 +0100 Subject: [PATCH] Input, Pandas --- README.md | 8 ++++---- index.html | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5ad71ad..33970c4 100644 --- a/README.md +++ b/README.md @@ -1531,7 +1531,7 @@ pprint(, width=80, depth=None, compact=False, sort_dicts=True) Input ----- ```python - = input([]) + = input() ``` * **Reads a line from the user input or pipe if present (trailing newline gets stripped).** * **If argument is passed, it gets printed to the standard output before input is read.** @@ -3193,9 +3193,9 @@ Name: a, dtype: int64 ```python .plot.line/area/bar/pie/hist() # Generates a plot. `plt.show()` displays it. ``` -* **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!** +* **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`.** * **Pandas uses NumPy types like `'np.int64'`. Series is converted to `'float64'` if we assign np.nan to any item. Use `'.astype()'` to get converted Series.** -* **Series will silently overflow if we run `'pd.Series([100], dtype="int8") + 100'`.** +* **Series will silently overflow if we run `'pd.Series([100], dtype="int8") + 100'`!** #### Series — Aggregate, Transform, Map: ```python @@ -3407,7 +3407,7 @@ z ```python = .rolling(win_size) # Also: `min_periods=None, center=False`. - = [col_key/s] # Or: .col_key + = [col_key/s] # Or: . = .mean/sum/max() # Or: .apply/agg() ``` diff --git a/index.html b/index.html index f83060f..7084bbf 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
- +
@@ -1294,7 +1294,7 @@ pprint(<collection>, width=80, depth=Each item is printed on its own line if collection exceeds 'width' characters.
  • Nested collections that are 'depth' levels deep get printed as '…'.
  • -

    #Input

    <str> = input([<obj>])
    +

    #Input

    <str> = input()
     
      @@ -2601,9 +2601,9 @@ Name: a, dtype: int64
      <S>.plot.line/area/bar/pie/hist()              # Generates a plot. `plt.show()` displays it.
       
        -
      • Indexing objects can't be tuples because 'obj[x, y]' is converted to 'obj[(x, y)]'!
      • +
      • Indexing objects can't be tuples because 'obj[x, y]' is converted to 'obj[(x, y)]'.
      • Pandas uses NumPy types like 'np.int64'. Series is converted to 'float64' if we assign np.nan to any item. Use '<S>.astype(<str/type>)' to get converted Series.
      • -
      • Series will silently overflow if we run 'pd.Series([100], dtype="int8") + 100'.
      • +
      • Series will silently overflow if we run 'pd.Series([100], dtype="int8") + 100'!

      Series — Aggregate, Transform, Map:

      <el> = <S>.sum/max/mean/idxmax/all()           # Or: <S>.agg(lambda <S>: <el>)
       <S>  = <S>.rank/diff/cumsum/ffill/interpol…()  # Or: <S>.agg/transform(lambda <S>: <S>)
      @@ -2772,7 +2772,7 @@ z
       6  11  13

      Rolling

      Object for rolling window calculations.

      <RS/RDF/RGB> = <S/DF/GB>.rolling(win_size)     # Also: `min_periods=None, center=False`.
      -<RS/RDF/RGB> = <RDF/RGB>[col_key/s]            # Or: <RDF/RGB>.col_key
      +<RS/RDF/RGB> = <RDF/RGB>[col_key/s]            # Or: <RDF/RGB>.<col_key>
       <S/DF>       = <R>.mean/sum/max()              # Or: <R>.apply/agg(<agg_func/str>)
       
      @@ -2934,7 +2934,7 @@ $ deactivate # Deactivates the active