Pandas dataframe: Listing amount of people per gender in each major
altering @VaishaliGarg's answer a little, 
you can use
df.groupby(['Qgender','Qmajor']).count()
Also if needed a dataframe out of it, we need to add .reset_index()
since it would be a groupbyObject.
df.groupby(['Qgender','Qmajor']).count().reset_index()
Sorry about the vague title, but I didn't know how to word it. 
So I have a pandas dataframe with 3 columns and any amount of rows. The first column is a person's name, the second column is their major (six possible majors, always written the same), and the third column is their gender (always 'Male' or 'Female'). 
I was told to print out the number of people in each major, which I was able to accomplish by saying table.Qmajor.value_counts() (table being my dataframe variable name). Now I am being asked to print the amount of males and females in each major, and I have no idea where to start. Any help is appreciated.
The column names are Qnames, Qmajor, and Qgender.