0

I have a data set as such enter image description here

For simplicity -Let's say I want to calculate the number of type of each manufacturer of the plane. enter image description here

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.

1 Answer 1

2

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:

  1. dataframe.dropna(subset=['manufacturer'],inplace=True)
  2. dataframe['manufacturer'].value_counts()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.