Skip to content

Commit a65694b

Browse files
committed
Regex, Numpy Plotly, Index
1 parent 3194abe commit a65694b

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ import re
390390
```
391391

392392
* **By default, decimal characters, alphanumerics and whitespaces from all alphabets are matched unless `'flags=re.ASCII'` argument is used.**
393-
* **It restricts special sequence matches to `'[\x00-\x7f]'` (the first 128 characters) and also prevents `'\s'` from accepting `'[\x1c-\x1f]'` (the so-called separator characters).**
393+
* **It restricts special sequence matches to `'[\x00-\x7f]'` (the first 128 characters) and also prevents `'\s'` from accepting `'[\x1c-\x1f]'` (file, table, row, and field separators).**
394394
* **Use a capital letter for negation (all non-ASCII characters will be matched when used in combination with ASCII flag).**
395395

396396

@@ -627,7 +627,7 @@ import zoneinfo, dateutil.tz
627627
<Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>) # Changes object's timezone without conversion.
628628
```
629629
* **Timezones returned by tzlocal(), ZoneInfo() and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the base offset.**
630-
* **To get zoneinfo module to work on Windows run `'> pip3 install tzdata'`.**
630+
* **To get ZoneInfo() to work on Windows run `'> pip3 install tzdata'`.**
631631

632632
### Encode
633633
```python
@@ -1675,7 +1675,7 @@ from pathlib import Path
16751675

16761676
### Path Object
16771677
```python
1678-
<Path> = Path(<path> [, ...]) # Accepts strings, Paths and DirEntry objects.
1678+
<Path> = Path(<path> [, ...]) # Accepts strings, Paths, and DirEntry objects.
16791679
<Path> = <path> / <path> [/ ...] # First or second path must be a Path object.
16801680
<Path> = <Path>.resolve() # Returns absolute path with resolved symlinks.
16811681
```
@@ -2716,7 +2716,7 @@ import numpy as np
27162716
* **Any value that is broadcastable to the indexed shape can be assigned to the selection.**
27172717

27182718
### Broadcasting
2719-
**Set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.**
2719+
**A set of rules by which NumPy functions operate on arrays of different shapes.**
27202720

27212721
```python
27222722
left = [ 0.1 , 0.6 , 0.8 ] # Shape: (3,)
@@ -3420,8 +3420,8 @@ z
34203420
Plotly
34213421
------
34223422
```python
3423-
# $ pip3 install pandas plotly kaleido
3424-
import pandas as pd, plotly.express as px
3423+
# $ pip3 install plotly kaleido pandas
3424+
import plotly.express as px, pandas as pd
34253425
```
34263426

34273427
```python
@@ -3590,3 +3590,4 @@ Index
35903590
* **Only available in the [PDF](https://transactions.sendowl.com/products/78175486/4422834F/view).**
35913591
* **Ctrl+F / ⌘F is usually sufficient.**
35923592
* **Searching `'#<title>'` on the [webpage](https://gto76.github.io/python-cheatsheet/) will limit the search to the titles.**
3593+
* **Click on the `'🔗'` symbol to get a link to specific section.**

index.html

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

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

@@ -360,7 +360,7 @@
360360

361361
<ul>
362362
<li><strong>By default, decimal characters, alphanumerics and whitespaces from all alphabets are matched unless <code class="python hljs"><span class="hljs-string">'flags=re.ASCII'</span></code> argument is used.</strong></li>
363-
<li><strong>It restricts special sequence matches to <code class="python hljs"><span class="hljs-string">'[\x00-\x7f]'</span></code> (the first 128 characters) and also prevents <code class="python hljs"><span class="hljs-string">'\s'</span></code> from accepting <code class="python hljs"><span class="hljs-string">'[\x1c-\x1f]'</span></code> (the so-called separator characters).</strong></li>
363+
<li><strong>It restricts special sequence matches to <code class="python hljs"><span class="hljs-string">'[\x00-\x7f]'</span></code> (the first 128 characters) and also prevents <code class="python hljs"><span class="hljs-string">'\s'</span></code> from accepting <code class="python hljs"><span class="hljs-string">'[\x1c-\x1f]'</span></code> (file, table, row, and field separators).</strong></li>
364364
<li><strong>Use a capital letter for negation (all non-ASCII characters will be matched when used in combination with ASCII flag).</strong></li>
365365
</ul>
366366
<div><h2 id="format"><a href="#format" name="format">#</a>Format</h2><pre><code class="python hljs">&lt;str&gt; = <span class="hljs-string">f'<span class="hljs-subst">{&lt;el_1&gt;}</span>, <span class="hljs-subst">{&lt;el_2&gt;}</span>'</span> <span class="hljs-comment"># Curly brackets can also contain expressions.</span>
@@ -549,7 +549,7 @@
549549

550550
<ul>
551551
<li><strong>Timezones returned by tzlocal(), ZoneInfo() and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the base offset.</strong></li>
552-
<li><strong>To get zoneinfo module to work on Windows run <code class="python hljs"><span class="hljs-string">'&gt; pip3 install tzdata'</span></code>.</strong></li>
552+
<li><strong>To get ZoneInfo() to work on Windows run <code class="python hljs"><span class="hljs-string">'&gt; pip3 install tzdata'</span></code>.</strong></li>
553553
</ul>
554554
<div><h3 id="encode">Encode</h3><pre><code class="python language-python apache hljs">&lt;D/T/DT&gt; = D/T/DT.fromisoformat(&lt;str&gt;) <span class="hljs-comment"># Object from ISO string. Raises ValueError.</span>
555555
&lt;DT&gt; = DT.strptime(&lt;str&gt;, <span class="hljs-string">'&lt;format&gt;'</span>) <span class="hljs-comment"># Datetime from str, according to format.</span>
@@ -1407,7 +1407,7 @@
14071407
</code></pre></div>
14081408

14091409

1410-
<div><h3 id="pathobject">Path Object</h3><pre><code class="python language-python hljs">&lt;Path&gt; = Path(&lt;path&gt; [, ...]) <span class="hljs-comment"># Accepts strings, Paths and DirEntry objects.</span>
1410+
<div><h3 id="pathobject">Path Object</h3><pre><code class="python language-python hljs">&lt;Path&gt; = Path(&lt;path&gt; [, ...]) <span class="hljs-comment"># Accepts strings, Paths, and DirEntry objects.</span>
14111411
&lt;Path&gt; = &lt;path&gt; / &lt;path&gt; [/ ...] <span class="hljs-comment"># First or second path must be a Path object.</span>
14121412
&lt;Path&gt; = &lt;Path&gt;.resolve() <span class="hljs-comment"># Returns absolute path with resolved symlinks.</span>
14131413
</code></pre></div>
@@ -2216,7 +2216,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
22162216
<li><strong><code class="python hljs"><span class="hljs-string">'ix_([1, 2], [3, 4])'</span></code> returns <code class="python hljs"><span class="hljs-string">'[[1], [2]]'</span></code> and <code class="python hljs"><span class="hljs-string">'[[3, 4]]'</span></code>. Due to broadcasting rules, this is the same as using <code class="python hljs"><span class="hljs-string">'[[1, 1], [2, 2]]'</span></code> and <code class="python hljs"><span class="hljs-string">'[[3, 4], [3, 4]]'</span></code>.</strong></li>
22172217
<li><strong>Any value that is broadcastable to the indexed shape can be assigned to the selection.</strong></li>
22182218
</ul>
2219-
<div><h3 id="broadcasting">Broadcasting</h3><p><strong>Set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.</strong></p><pre><code class="python language-python hljs">left = [ <span class="hljs-number">0.1</span> , <span class="hljs-number">0.6</span> , <span class="hljs-number">0.8</span> ] <span class="hljs-comment"># Shape: (3,)</span>
2219+
<div><h3 id="broadcasting">Broadcasting</h3><p><strong>A set of rules by which NumPy functions operate on arrays of different shapes.</strong></p><pre><code class="python language-python hljs">left = [ <span class="hljs-number">0.1</span> , <span class="hljs-number">0.6</span> , <span class="hljs-number">0.8</span> ] <span class="hljs-comment"># Shape: (3,)</span>
22202220
right = [[<span class="hljs-number">0.1</span>], [<span class="hljs-number">0.6</span>], [<span class="hljs-number">0.8</span>]] <span class="hljs-comment"># Shape: (3, 1)</span>
22212221
</code></pre></div>
22222222

@@ -2781,8 +2781,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
27812781
</code></pre></div>
27822782

27832783

2784-
<div><h2 id="plotly"><a href="#plotly" name="plotly">#</a>Plotly</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install pandas plotly kaleido</span>
2785-
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd, plotly.express <span class="hljs-keyword">as</span> px
2784+
<div><h2 id="plotly"><a href="#plotly" name="plotly">#</a>Plotly</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install plotly kaleido pandas</span>
2785+
<span class="hljs-keyword">import</span> plotly.express <span class="hljs-keyword">as</span> px, pandas <span class="hljs-keyword">as</span> pd
27862786
</code></pre></div>
27872787

27882788
<pre><code class="python language-python hljs">&lt;Fig&gt; = px.line(&lt;DF&gt;, x=col_key, y=col_key) <span class="hljs-comment"># Or: px.line(x=&lt;list&gt;, y=&lt;list&gt;)</span>
@@ -2923,11 +2923,12 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29232923
<div><h2 id="index"><a href="#index" name="index">#</a>Index</h2><ul><li><strong>Only available in the <a href="https://transactions.sendowl.com/products/78175486/4422834F/view">PDF</a>.</strong></li>
29242924
<li><strong>Ctrl+F / ⌘F is usually sufficient.</strong></li>
29252925
<li><strong>Searching <code class="python hljs"><span class="hljs-string">'#&lt;title&gt;'</span></code> will limit the search to the titles.</strong></li>
2926+
<li><strong>Click on the <code class="python hljs"><span class="hljs-string">'#'</span></code> symbol to get a link to specific section.</strong></li>
29262927
</ul></div>
29272928

29282929

29292930
<footer>
2930-
<aside>October 26, 2024</aside>
2931+
<aside>October 28, 2024</aside>
29312932
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29322933
</footer>
29332934

parse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ const CYTHON_3 =
335335
const INDEX =
336336
'<li><strong>Only available in the <a href="https://transactions.sendowl.com/products/78175486/4422834F/view">PDF</a>.</strong></li>\n' +
337337
'<li><strong>Ctrl+F / ⌘F is usually sufficient.</strong></li>\n' +
338-
'<li><strong>Searching <code class="python hljs"><span class="hljs-string">\'#&lt;title&gt;\'</span></code> will limit the search to the titles.</strong></li>\n';
338+
'<li><strong>Searching <code class="python hljs"><span class="hljs-string">\'#&lt;title&gt;\'</span></code> will limit the search to the titles.</strong></li>\n' +
339+
'<li><strong>Click on the <code class="python hljs"><span class="hljs-string">\'#\'</span></code> symbol to get a link to specific section.</strong></li>\n';
339340

340341

341342
const DIAGRAM_1_A =

0 commit comments

Comments
 (0)