filter(self, func, dropna=True, *args, **kwargs)
Elements from groups are filtered if they do not satisfy the boolean criterion specified by func.
Each subframe is endowed the attribute 'name' in case you need to know which group you are working on.
Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See gotchas.udf-mutation
for more details.
Function to apply to each subframe. Should return True or False.
If False, groups that evaluate False are filled with NaNs.
Return a copy of a DataFrame excluding filtered elements.
>>> df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar',See :
... 'foo', 'bar'],
... 'B' : [1, 2, 3, 4, 5, 6],
... 'C' : [2.0, 5., 8., 1., 2., 9.]})
... grouped = df.groupby('A')
... grouped.filter(lambda x: x['B'].mean() > 3.) A B C 1 bar 2 5.0 3 bar 4 1.0 5 bar 6 9.0
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them