Skip to content

Commit 7267328

Browse files
committed
Input, Pandas
1 parent 3d17eeb commit 7267328

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ pprint(<collection>, width=80, depth=None, compact=False, sort_dicts=True)
15311531
Input
15321532
-----
15331533
```python
1534-
<str> = input([<obj>])
1534+
<str> = input()
15351535
```
15361536
* **Reads a line from the user input or pipe if present (trailing newline gets stripped).**
15371537
* **If argument is passed, it gets printed to the standard output before input is read.**
@@ -3193,9 +3193,9 @@ Name: a, dtype: int64
31933193
```python
31943194
<S>.plot.line/area/bar/pie/hist() # Generates a plot. `plt.show()` displays it.
31953195
```
3196-
* **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!**
3196+
* **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`.**
31973197
* **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.**
3198-
* **Series will silently overflow if we run `'pd.Series([100], dtype="int8") + 100'`.**
3198+
* **Series will silently overflow if we run `'pd.Series([100], dtype="int8") + 100'`!**
31993199

32003200
#### Series — Aggregate, Transform, Map:
32013201
```python
@@ -3407,7 +3407,7 @@ z
34073407

34083408
```python
34093409
<RS/RDF/RGB> = <S/DF/GB>.rolling(win_size) # Also: `min_periods=None, center=False`.
3410-
<RS/RDF/RGB> = <RDF/RGB>[col_key/s] # Or: <RDF/RGB>.col_key
3410+
<RS/RDF/RGB> = <RDF/RGB>[col_key/s] # Or: <RDF/RGB>.<col_key>
34113411
<S/DF> = <R>.mean/sum/max() # Or: <R>.apply/agg(<agg_func/str>)
34123412
```
34133413

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<body>
5757
<header>
58-
<aside>December 24, 2024</aside>
58+
<aside>December 25, 2024</aside>
5959
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
6060
</header>
6161

@@ -1294,7 +1294,7 @@
12941294
<li><strong>Each item is printed on its own line if collection exceeds 'width' characters.</strong></li>
12951295
<li><strong>Nested collections that are 'depth' levels deep get printed as '…'.</strong></li>
12961296
</ul>
1297-
<div><h2 id="input"><a href="#input" name="input">#</a>Input</h2><pre><code class="python language-python hljs">&lt;str&gt; = input([&lt;obj&gt;])
1297+
<div><h2 id="input"><a href="#input" name="input">#</a>Input</h2><pre><code class="python language-python hljs">&lt;str&gt; = input()
12981298
</code></pre></div>
12991299

13001300
<ul>
@@ -2601,9 +2601,9 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
26012601
<pre><code class="python language-python hljs">&lt;S&gt;.plot.line/area/bar/pie/hist() <span class="hljs-comment"># Generates a plot. `plt.show()` displays it.</span>
26022602
</code></pre>
26032603
<ul>
2604-
<li><strong>Indexing objects can't be tuples because <code class="python hljs"><span class="hljs-string">'obj[x, y]'</span></code> is converted to <code class="python hljs"><span class="hljs-string">'obj[(x, y)]'</span></code>!</strong></li>
2604+
<li><strong>Indexing objects can't be tuples because <code class="python hljs"><span class="hljs-string">'obj[x, y]'</span></code> is converted to <code class="python hljs"><span class="hljs-string">'obj[(x, y)]'</span></code>.</strong></li>
26052605
<li><strong>Pandas uses NumPy types like <code class="python hljs"><span class="hljs-string">'np.int64'</span></code>. Series is converted to <code class="python hljs"><span class="hljs-string">'float64'</span></code> if we assign np.nan to any item. Use <code class="python hljs"><span class="hljs-string">'&lt;S&gt;.astype(&lt;str/type&gt;)'</span></code> to get converted Series.</strong></li>
2606-
<li><strong>Series will silently overflow if we run <code class="python hljs"><span class="hljs-string">'pd.Series([100], dtype="int8") + 100'</span></code>.</strong></li>
2606+
<li><strong>Series will silently overflow if we run <code class="python hljs"><span class="hljs-string">'pd.Series([100], dtype="int8") + 100'</span></code>!</strong></li>
26072607
</ul>
26082608
<div><h4 id="seriesaggregatetransformmap">Series — Aggregate, Transform, Map:</h4><pre><code class="python language-python hljs">&lt;el&gt; = &lt;S&gt;.sum/max/mean/idxmax/all() <span class="hljs-comment"># Or: &lt;S&gt;.agg(lambda &lt;S&gt;: &lt;el&gt;)</span>
26092609
&lt;S&gt; = &lt;S&gt;.rank/diff/cumsum/ffill/interpol…() <span class="hljs-comment"># Or: &lt;S&gt;.agg/transform(lambda &lt;S&gt;: &lt;S&gt;)</span>
@@ -2772,7 +2772,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
27722772
<span class="hljs-number">6</span> <span class="hljs-number">11</span> <span class="hljs-number">13</span></code></pre></div>
27732773

27742774
<div><h3 id="rolling">Rolling</h3><p><strong>Object for rolling window calculations.</strong></p><pre><code class="python language-python hljs">&lt;RS/RDF/RGB&gt; = &lt;S/DF/GB&gt;.rolling(win_size) <span class="hljs-comment"># Also: `min_periods=None, center=False`.</span>
2775-
&lt;RS/RDF/RGB&gt; = &lt;RDF/RGB&gt;[col_key/s] <span class="hljs-comment"># Or: &lt;RDF/RGB&gt;.col_key</span>
2775+
&lt;RS/RDF/RGB&gt; = &lt;RDF/RGB&gt;[col_key/s] <span class="hljs-comment"># Or: &lt;RDF/RGB&gt;.&lt;col_key&gt;</span>
27762776
&lt;S/DF&gt; = &lt;R&gt;.mean/sum/max() <span class="hljs-comment"># Or: &lt;R&gt;.apply/agg(&lt;agg_func/str&gt;)</span>
27772777
</code></pre></div>
27782778

@@ -2934,7 +2934,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29342934

29352935

29362936
<footer>
2937-
<aside>December 24, 2024</aside>
2937+
<aside>December 25, 2024</aside>
29382938
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29392939
</footer>
29402940

0 commit comments

Comments
 (0)