I am starting with data of city transits with an additional column containing the mode of transportation
Orig Dest Type
NY SF Train
NY SF Plane
NO NY Plane
SE NO Plane
SE NO Train
I want to aggregate it such that each unique value in Type becomes a column with counts of that Type for each unique Orig/Dest pair
Orig Dest Plane Train
NY SF 1 1
NO NY 1 0
SE NO 1 1
I know some basic aggregation using pd.groupby but can only aggregate so far as to get just basic counts of the Orig/Dest pairs using:
df.groubpy(['Orig','Dest'])['Type'].count()