Browse Source

Coroutines, Pandas

pull/177/head
Jure Šorn 1 year ago
parent
commit
ee436bd9eb
2 changed files with 6 additions and 6 deletions
  1. 4
      README.md
  2. 8
      index.html

4
README.md

@ -2318,7 +2318,7 @@ import asyncio as aio
<coro> = <async_func>(<args>) # Creates a coroutine.
<obj> = await <coroutine> # Starts the coroutine and returns result.
<task> = aio.create_task(<coroutine>) # Schedules coroutine for execution.
<obj> = await <task> # Returns result.
<obj> = await <task> # Returns result. Also <task>.cancel().
```
```python
@ -3346,7 +3346,7 @@ plt.show() # Displays the plot. Also plt.sav
```python
<DF> = pd.read_json/html('<str/path/url>') # Run `$ pip3 install beautifulsoup4 lxml`.
<DF> = pd.read_csv('<path/url>') # Also `names=<list>, parse_dates=False`.
<DF> = pd.read_csv('<path/url>') # `header/index_col/dtype/parse_dates=<obj>`.
<DF> = pd.read_pickle/excel('<path/url>') # Use `sheet_name=None` to get all Excel sheets.
<DF> = pd.read_sql('<table/query>', <conn.>) # SQLite3/SQLAlchemy connection (see #SQLite).
```

8
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>February 19, 2024</aside>
<aside>February 20, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -1909,7 +1909,7 @@ delattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>)
<pre><code class="python language-python hljs">&lt;coro&gt; = &lt;async_func&gt;(&lt;args&gt;) <span class="hljs-comment"># Creates a coroutine.</span>
&lt;obj&gt; = <span class="hljs-keyword">await</span> &lt;coroutine&gt; <span class="hljs-comment"># Starts the coroutine and returns result.</span>
&lt;task&gt; = aio.create_task(&lt;coroutine&gt;) <span class="hljs-comment"># Schedules coroutine for execution.</span>
&lt;obj&gt; = <span class="hljs-keyword">await</span> &lt;task&gt; <span class="hljs-comment"># Returns result.</span>
&lt;obj&gt; = <span class="hljs-keyword">await</span> &lt;task&gt; <span class="hljs-comment"># Returns result. Also &lt;task&gt;.cancel().</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;coro&gt; = aio.gather(&lt;coro/task&gt;, ...) <span class="hljs-comment"># Schedules coroutines. Returns results when awaited.</span>
&lt;coro&gt; = aio.wait(&lt;tasks&gt;, …) <span class="hljs-comment"># `aio.ALL/FIRST_COMPLETED`. Returns (done, pending).</span>
@ -2741,7 +2741,7 @@ plt.show() <span class="hljs-comment"># Disp
</code></pre></div>
<pre><code class="python language-python hljs">&lt;DF&gt; = pd.read_json/html(<span class="hljs-string">'&lt;str/path/url&gt;'</span>) <span class="hljs-comment"># Run `$ pip3 install beautifulsoup4 lxml`.</span>
&lt;DF&gt; = pd.read_csv(<span class="hljs-string">'&lt;path/url&gt;'</span>) <span class="hljs-comment"># Also `names=&lt;list&gt;, parse_dates=False`.</span>
&lt;DF&gt; = pd.read_csv(<span class="hljs-string">'&lt;path/url&gt;'</span>) <span class="hljs-comment"># `header/index_col/dtype/parse_dates=&lt;obj&gt;`.</span>
&lt;DF&gt; = pd.read_pickle/excel(<span class="hljs-string">'&lt;path/url&gt;'</span>) <span class="hljs-comment"># Use `sheet_name=None` to get all Excel sheets.</span>
&lt;DF&gt; = pd.read_sql(<span class="hljs-string">'&lt;table/query&gt;'</span>, &lt;conn.&gt;) <span class="hljs-comment"># SQLite3/SQLAlchemy connection (see #SQLite).</span>
</code></pre>
@ -2933,7 +2933,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the activ
<footer>
<aside>February 19, 2024</aside>
<aside>February 20, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Loading…
Cancel
Save