Skip to content

Commit 12fe5a0

Browse files
committed
Pandas
1 parent 381dc91 commit 12fe5a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,8 +3164,8 @@ Name: a, dtype: int64
31643164
```
31653165

31663166
```python
3167-
<S> = pd.Series(<list>) # Assigns RangeIndex starting at 0.
3168-
<S> = pd.Series(<dict>) # Takes dictionary's keys for index.
3167+
<S> = pd.Series(<list>) # Creates index from list's indices.
3168+
<S> = pd.Series(<dict>) # Creates index from dictionary's keys.
31693169
<S> = pd.Series(<dict/Series>, index=<list>) # Only keeps items with keys specified in index.
31703170
```
31713171

@@ -3193,7 +3193,7 @@ Name: a, dtype: int64
31933193
```
31943194

31953195
```python
3196-
<S>.plot.line/area/bar/pie/hist() # Generates a Matplotlib plot.
3196+
<S>.plot.line/area/bar/pie/hist() # Generates a plot. Accepts `title=<str>`.
31973197
plt.show() # Displays the plot. Also plt.savefig(<path>).
31983198
```
31993199
* **Indexing objects can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!**
@@ -3269,7 +3269,7 @@ b 3 4
32693269

32703270
```python
32713271
<DF> = <DF>.head/tail/sample(<int>) # Returns first, last, or random n rows.
3272-
<DF> = <DF>.describe() # Describes columns. Also shape, info(), corr().
3272+
<DF> = <DF>.describe() # Describes columns. Also info(), corr(), shape.
32733273
<DF> = <DF>.query('<query>') # Filters rows with e.g. 'col_1 == val_1 and …'.
32743274
```
32753275

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,8 +2580,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
25802580
</code></pre></div>
25812581

25822582

2583-
<pre><code class="python language-python hljs">&lt;S&gt; = pd.Series(&lt;list&gt;) <span class="hljs-comment"># Assigns RangeIndex starting at 0.</span>
2584-
&lt;S&gt; = pd.Series(&lt;dict&gt;) <span class="hljs-comment"># Takes dictionary's keys for index.</span>
2583+
<pre><code class="python language-python hljs">&lt;S&gt; = pd.Series(&lt;list&gt;) <span class="hljs-comment"># Creates index from list's indices.</span>
2584+
&lt;S&gt; = pd.Series(&lt;dict&gt;) <span class="hljs-comment"># Creates index from dictionary's keys.</span>
25852585
&lt;S&gt; = pd.Series(&lt;dict/Series&gt;, index=&lt;list&gt;) <span class="hljs-comment"># Only keeps items with keys specified in index.</span>
25862586
</code></pre>
25872587
<pre><code class="python language-python hljs">&lt;el&gt; = &lt;S&gt;.loc[key] <span class="hljs-comment"># Or: &lt;S&gt;.iloc[i]</span>
@@ -2599,7 +2599,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
25992599
&lt;S&gt; = &lt;S&gt;.combine_first(&lt;S&gt;) <span class="hljs-comment"># Adds items that are not yet present.</span>
26002600
&lt;S&gt;.update(&lt;S&gt;) <span class="hljs-comment"># Updates items that are already present.</span>
26012601
</code></pre>
2602-
<pre><code class="python language-python hljs">&lt;S&gt;.plot.line/area/bar/pie/hist() <span class="hljs-comment"># Generates a Matplotlib plot.</span>
2602+
<pre><code class="python language-python hljs">&lt;S&gt;.plot.line/area/bar/pie/hist() <span class="hljs-comment"># Generates a plot. Accepts `title=&lt;str&gt;`.</span>
26032603
plt.show() <span class="hljs-comment"># Displays the plot. Also plt.savefig(&lt;path&gt;).</span>
26042604
</code></pre>
26052605
<ul>
@@ -2659,7 +2659,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
26592659
&lt;DF&gt; = &lt;DF&gt;.sort_values(col_key/s) <span class="hljs-comment"># Sorts rows by passed column/s. Also `axis=1`.</span>
26602660
</code></pre>
26612661
<pre><code class="python language-python hljs">&lt;DF&gt; = &lt;DF&gt;.head/tail/sample(&lt;int&gt;) <span class="hljs-comment"># Returns first, last, or random n rows.</span>
2662-
&lt;DF&gt; = &lt;DF&gt;.describe() <span class="hljs-comment"># Describes columns. Also shape, info(), corr().</span>
2662+
&lt;DF&gt; = &lt;DF&gt;.describe() <span class="hljs-comment"># Describes columns. Also info(), corr(), shape.</span>
26632663
&lt;DF&gt; = &lt;DF&gt;.query(<span class="hljs-string">'&lt;query&gt;'</span>) <span class="hljs-comment"># Filters rows with e.g. 'col_1 == val_1 and …'.</span>
26642664
</code></pre>
26652665
<pre><code class="python language-python hljs">&lt;DF&gt;.plot.line/area/bar/scatter(x=col_key, …) <span class="hljs-comment"># `y=col_key/s`. Also hist/box(by=col_key).</span>

0 commit comments

Comments
 (0)