Skip to content

Commit 0ff16b3

Browse files
committed
Pandas
1 parent 519ac14 commit 0ff16b3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,7 @@ c 6 7
33753375
```python
33763376
<GB> = <DF>.groupby(col_key/s) # Splits DF into groups based on passed column.
33773377
<DF> = <GB>.apply(<func>) # Maps each group. Func can return DF, S or el.
3378+
<DF> = <GB>.filter(<func>) # Drops a group if function returns False.
33783379
<DF> = <GB>.get_group(<el>) # Selects a group by grouping column's value.
33793380
<S> = <GB>.size() # S of group sizes. Same keys as get_group().
33803381
<GB> = <GB>[col_key] # Single column GB. All operations return S.

index.html

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

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

@@ -2747,6 +2747,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
27472747
</ul>
27482748
<div><h3 id="groupby">GroupBy</h3><p><strong>Object that groups together rows of a dataframe based on the value of the passed column.</strong></p><pre><code class="python language-python hljs">&lt;GB&gt; = &lt;DF&gt;.groupby(col_key/s) <span class="hljs-comment"># Splits DF into groups based on passed column.</span>
27492749
&lt;DF&gt; = &lt;GB&gt;.apply(&lt;func&gt;) <span class="hljs-comment"># Maps each group. Func can return DF, S or el.</span>
2750+
&lt;DF&gt; = &lt;GB&gt;.filter(&lt;func&gt;) <span class="hljs-comment"># Drops a group if function returns False.</span>
27502751
&lt;DF&gt; = &lt;GB&gt;.get_group(&lt;el&gt;) <span class="hljs-comment"># Selects a group by grouping column's value.</span>
27512752
&lt;S&gt; = &lt;GB&gt;.size() <span class="hljs-comment"># S of group sizes. Same keys as get_group().</span>
27522753
&lt;GB&gt; = &lt;GB&gt;[col_key] <span class="hljs-comment"># Single column GB. All operations return S.</span>
@@ -2923,7 +2924,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29232924

29242925

29252926
<footer>
2926-
<aside>November 28, 2024</aside>
2927+
<aside>November 29, 2024</aside>
29272928
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29282929
</footer>
29292930

0 commit comments

Comments
 (0)