Here is an excellent tutorial that explains how to use the group_by function in pandas to summarize data: