You can use the groupby() function in Pandas to group data based on one or more columns.