Browse Source

SQLite, Pandas

pull/192/head
Jure Šorn 5 months ago
parent
commit
730877a7b3
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -1918,7 +1918,7 @@ with <conn>: # Exits the block with commit() o
<conn>.execute('<query>', <dict/namedtuple>) # Replaces ':<key>'s with values. <conn>.execute('<query>', <dict/namedtuple>) # Replaces ':<key>'s with values.
<conn>.executemany('<query>', <coll_of_coll>) # Runs execute() multiple times. <conn>.executemany('<query>', <coll_of_coll>) # Runs execute() multiple times.
``` ```
* **Passed values can be of type str, int, float, bytes, None, or bool (stored as 0 or 1).**
* **Passed values can be of type str, int, float, bytes, None, or bool (stored as 1 or 0).**
### Example ### Example
**Values are not actually saved in this example because `'conn.commit()'` is omitted!** **Values are not actually saved in this example because `'conn.commit()'` is omitted!**
@ -3182,7 +3182,7 @@ Name: a, dtype: int64
``` ```
```python ```python
<S> = <S> > <el/S> # Returns a Series of bools.
<S> = <S> > <el/S> # Returns S of bools. Pairs items by keys.
<S> = <S> + <el/S> # Items with non-matching keys get value NaN. <S> = <S> + <el/S> # Items with non-matching keys get value NaN.
``` ```

4
index.html

@ -1587,7 +1587,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
</code></pre></div> </code></pre></div>
<ul> <ul>
<li><strong>Passed values can be of type str, int, float, bytes, None, or bool (stored as 0 or 1).</strong></li>
<li><strong>Passed values can be of type str, int, float, bytes, None, or bool (stored as 1 or 0).</strong></li>
</ul> </ul>
<div><h3 id="example-1">Example</h3><p><strong>Values are not actually saved in this example because <code class="python hljs"><span class="hljs-string">'conn.commit()'</span></code> is omitted!</strong></p><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span>conn = sqlite3.connect(<span class="hljs-string">'test.db'</span>) <div><h3 id="example-1">Example</h3><p><strong>Values are not actually saved in this example because <code class="python hljs"><span class="hljs-string">'conn.commit()'</span></code> is omitted!</strong></p><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span>conn = sqlite3.connect(<span class="hljs-string">'test.db'</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>conn.execute(<span class="hljs-string">'CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)'</span>) <span class="hljs-meta">&gt;&gt;&gt; </span>conn.execute(<span class="hljs-string">'CREATE TABLE person (person_id INTEGER PRIMARY KEY, name, height)'</span>)
@ -2592,7 +2592,7 @@ Name: a, dtype: int64
&lt;S&gt; = &lt;S&gt;[coll_of_keys/coll_of_i] <span class="hljs-comment"># Or: &lt;S&gt;[key/i : key/i]</span> &lt;S&gt; = &lt;S&gt;[coll_of_keys/coll_of_i] <span class="hljs-comment"># Or: &lt;S&gt;[key/i : key/i]</span>
&lt;S&gt; = &lt;S&gt;[bools] <span class="hljs-comment"># Or: &lt;S&gt;.loc/iloc[bools]</span> &lt;S&gt; = &lt;S&gt;[bools] <span class="hljs-comment"># Or: &lt;S&gt;.loc/iloc[bools]</span>
</code></pre> </code></pre>
<pre><code class="python language-python hljs">&lt;S&gt; = &lt;S&gt; &gt; &lt;el/S&gt; <span class="hljs-comment"># Returns a Series of bools.</span>
<pre><code class="python language-python hljs">&lt;S&gt; = &lt;S&gt; &gt; &lt;el/S&gt; <span class="hljs-comment"># Returns S of bools. Pairs items by keys.</span>
&lt;S&gt; = &lt;S&gt; + &lt;el/S&gt; <span class="hljs-comment"># Items with non-matching keys get value NaN.</span> &lt;S&gt; = &lt;S&gt; + &lt;el/S&gt; <span class="hljs-comment"># Items with non-matching keys get value NaN.</span>
</code></pre> </code></pre>
<pre><code class="python language-python hljs">&lt;S&gt; = pd.concat(&lt;coll_of_S&gt;) <span class="hljs-comment"># Concats multiple series into one long Series.</span> <pre><code class="python language-python hljs">&lt;S&gt; = pd.concat(&lt;coll_of_S&gt;) <span class="hljs-comment"># Concats multiple series into one long Series.</span>

Loading…
Cancel
Save