The groupby operation is used to aggregate similar items. First, it splits the data based on the values, finds an aggregate of similar values, and combines the aggregated results. This can be seen in the following code:
# Find the average values of all the columns for employee left or stayed
ddf.groupby('left').mean().compute()
This results in the following output:
In the preceding example, we grouped the data based on the left column (it shows an employee who stayed or left the company) and aggregated it by the mean value.