|
55 | 55 |
|
56 | 56 | <body> |
57 | 57 | <header> |
58 | | - <aside>October 26, 2024</aside> |
| 58 | + <aside>October 28, 2024</aside> |
59 | 59 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
60 | 60 | </header> |
61 | 61 |
|
|
360 | 360 |
|
361 | 361 | <ul> |
362 | 362 | <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> |
364 | 364 | <li><strong>Use a capital letter for negation (all non-ASCII characters will be matched when used in combination with ASCII flag).</strong></li> |
365 | 365 | </ul> |
366 | 366 | <div><h2 id="format"><a href="#format" name="format">#</a>Format</h2><pre><code class="python hljs"><str> = <span class="hljs-string">f'<span class="hljs-subst">{<el_1>}</span>, <span class="hljs-subst">{<el_2>}</span>'</span> <span class="hljs-comment"># Curly brackets can also contain expressions.</span> |
|
549 | 549 |
|
550 | 550 | <ul> |
551 | 551 | <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">'> 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">'> pip3 install tzdata'</span></code>.</strong></li> |
553 | 553 | </ul> |
554 | 554 | <div><h3 id="encode">Encode</h3><pre><code class="python language-python apache hljs"><D/T/DT> = D/T/DT.fromisoformat(<str>) <span class="hljs-comment"># Object from ISO string. Raises ValueError.</span> |
555 | 555 | <DT> = DT.strptime(<str>, <span class="hljs-string">'<format>'</span>) <span class="hljs-comment"># Datetime from str, according to format.</span> |
|
1407 | 1407 | </code></pre></div> |
1408 | 1408 |
|
1409 | 1409 |
|
1410 | | -<div><h3 id="pathobject">Path Object</h3><pre><code class="python language-python hljs"><Path> = Path(<path> [, ...]) <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"><Path> = Path(<path> [, ...]) <span class="hljs-comment"># Accepts strings, Paths, and DirEntry objects.</span> |
1411 | 1411 | <Path> = <path> / <path> [/ ...] <span class="hljs-comment"># First or second path must be a Path object.</span> |
1412 | 1412 | <Path> = <Path>.resolve() <span class="hljs-comment"># Returns absolute path with resolved symlinks.</span> |
1413 | 1413 | </code></pre></div> |
@@ -2216,7 +2216,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2216 | 2216 | <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> |
2217 | 2217 | <li><strong>Any value that is broadcastable to the indexed shape can be assigned to the selection.</strong></li> |
2218 | 2218 | </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> |
2220 | 2220 | 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> |
2221 | 2221 | </code></pre></div> |
2222 | 2222 |
|
@@ -2781,8 +2781,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2781 | 2781 | </code></pre></div> |
2782 | 2782 |
|
2783 | 2783 |
|
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 |
2786 | 2786 | </code></pre></div> |
2787 | 2787 |
|
2788 | 2788 | <pre><code class="python language-python hljs"><Fig> = px.line(<DF>, x=col_key, y=col_key) <span class="hljs-comment"># Or: px.line(x=<list>, y=<list>)</span> |
@@ -2923,11 +2923,12 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2923 | 2923 | <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> |
2924 | 2924 | <li><strong>Ctrl+F / ⌘F is usually sufficient.</strong></li> |
2925 | 2925 | <li><strong>Searching <code class="python hljs"><span class="hljs-string">'#<title>'</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> |
2926 | 2927 | </ul></div> |
2927 | 2928 |
|
2928 | 2929 |
|
2929 | 2930 | <footer> |
2930 | | - <aside>October 26, 2024</aside> |
| 2931 | + <aside>October 28, 2024</aside> |
2931 | 2932 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
2932 | 2933 | </footer> |
2933 | 2934 |
|
|
0 commit comments