Reputation: 431
For simplicity -Let's say I want to calculate the number of type of each manufacturer of the plane.
I want the output as such-
BOEING-xxx
EMBRAER-xxx
MCDONNELL-XXX
:
:
:
so on
How can I do this ? Please help me out with this.
Upvotes: 0
Views: 51
Reputation: 14983
You can use dataframe['manufacturer'].value_counts()
to get the result that you want;
However, note that you have NaNs
in your column; so prior to applying the function above, use:
dataframe.dropna(subset=['manufacturer'],inplace=True)
Summing it up:
dataframe.dropna(subset=['manufacturer'],inplace=True)
dataframe['manufacturer'].value_counts()
Upvotes: 2