EXPAND ALL
  • Home

DataFrame.groupby

Groups the data in preparation for an aggregate.

Groups the data by the unique values in the passed in columns. At the current time we do not support standalone groupings, you must always follow the groupby() call with a call to agg().

Arguments

NameTypeDescription
columnsUnion[str,List[str]]DataFrame columns to group by, either as a string or a list.

Returns

px.DataFrame: Grouped DataFrame. Must be followed by a call to agg().

Examples

# Group by UPID and calculate maximum user time for the each
# UPID group.
df = px.DataFrame('process_stats')
df = df.groupby('upid').agg(cpu_utime=('cpu_utime_ns', px.max))

This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.