Sample Tabular Data: Titanic

Source Notebook

Anonymous list of passengers on the Titanic

Details

Anonymous list of 1309 passengers on the Titanic providing class, age, sex, and survival information.

Examples

Basic Examples (3) 

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\)]
Out[1]=

Dimensions:

In[2]:=
Dimensions[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\)]]
Out[2]=

Column keys and types:

In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\), "ColumnKeys"]
Out[3]=
In[4]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\), "ColumnTypes"]
Out[4]=

Column descriptions:

In[5]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\), "ColumnDescriptions"] // Dataset
Out[5]=

Scope & Additional Elements (2) 

Find the mean age of those who survived and of those who died:

In[6]:=
AggregateRows[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\)], {"mean age" -> (Mean[#age] &)}, {"survived"}]
Out[6]=

Count how many survived and how many died per class and sex:

In[7]:=
AggregateRows[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Titanic\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Titanic-Input",
AutoDelete->True]\)], {"lived" -> (Count[#survived, True] &), "died" -> (Count[#survived, False] &)}, Flatten@{{"sex"}, {"class"}}]
Out[7]=

Gosia Konwerska, "Sample Tabular Data: Titanic" from the Wolfram Data Repository (2024)  

Data Resource History

Source Metadata

See Also

Publisher Information