Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (pclass column is 1) and boarded from Southampton (embarked column is S).

Respuesta :

The data frame first_south is created using first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

How to create the data frame?

To do this, we make the following assumptions:

  • The pandas module has been loaded as pd
  • The dataset has also been loaded as titanic

When pclass column is 1.

This is represented as:

titanic['pclass']==1

When the passenger boards from Southampton.

This is represented as:

titanic['Embarked']=='S'

So, we have:

first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

Read more about data frames at:

https://brainly.com/question/16524297

#SPJ1