= pd.DataFrame({'a': [1, 2, 3, 4, 4, 5, 5, 6, 6, 6], 'b':[1, 1, 1, 1, 2, 2, 2, 3, 3, 4]})
df 'b') df.repetitions(
b
1 4
2 3
3 2
4 1
dtype: int64
dummydf ()
A dummy DataFrame.
DataFrame.repetitions (col)
Counts the number of repetitions for each element.
df = pd.DataFrame({'a': [1, 2, 3, 4, 4, 5, 5, 6, 6, 6], 'b':[1, 1, 1, 1, 2, 2, 2, 3, 3, 4]})
df.repetitions('b')
b
1 4
2 3
3 2
4 1
dtype: int64
DataFrame.repetition_counts (col)
Counts the number of groups with the same number of repetitions.
In the following example there are three groups with one element, two groups with two elements, and one group with three elements.
DataFrame.single_events (col)
DataFrame.single_events (col)
Returns rows that appear only once.
Pandas functions that are easier to execute as DataFrame/Series methods.
DataFrame.crosstab (index, column, **kwargs)
DataFrame.len ()
Series.len ()
These methods allow fast exploration of the data in one line.
Index.l ()
Series.minmax ()
DataFrame.page (page, page_size=5)
Shows rows between page*page_size
and (page+1)*page_size
Series.page (page, page_size=5)
Shows rows between page*page_size
and (page+1)*page_size
L.page (page, page_size=10)
Shows elements between page*page_size
and (page+1)*page_size
These methods are slight variations from DataFrame ones.
DataFrame.renamec (d, *args, **kwargs)
col_a | bar | |
---|---|---|
0 | 100 | a |
1 | 101 | b |
2 | 102 | c |
3 | 103 | d |
4 | 104 | e |
Series.notin (values)
Series.mapk (fun, **kwargs)
DataFrame.sort (by, **kwargs)
DataFrame.c2back (cols2back)
DataFrame.c2front (cols2front)
DataFrame.reorderc (to_front=[], to_back=[])
Reorder DataFrame columns.