I have a pandas dataframe based on airports that has a type column with values: small_airport, medium_airport, large_airport
I need to extract these values in to 3 different columns and I'm a bit stuck. I have tried various permutations of:
data['small_airport'] = data[['type'] == 'small_airport']
But I can't get anything to work. I have seen several similar posts on here but have not really understood the answers fully enough to implement the suggestions so sorry if I am duplicating questions.
Any advice would be much appreciated! Edit: A sample of the data is:
id, type, name
652, small_airport, Total Rf
345, heliport, Aero B
654, large_airport, Lowell field
It is a university project and the brief states: The ‘type’ column contains information of the type of airport. Extract this out into a new column, one for each category of airport
I hope that helps!