Elena' s AI Blog

Data exploration and analysis with Python Pandas

20 Jan 2023 / 238 minutes to read

Elena Daehnhardt


Jasper AI-generated art, January 2023


Introduction

Data science is a multidisciplinary field involving scientific methods, procedures, algorithms, and techniques to extract knowledge and insights from structured and unstructured data. Data analysis uses statistical and computational approaches to identify data patterns, trends, and relationships. It plays a vital role in the data science process. It is typically used to prepare and preprocess the data, perform exploratory data analysis, build and evaluate models, extract insights and make data-driven decisions. In Data Science, we have so many terms explaining concepts and techniques that it is easy to need clarification and get a clear understanding of all data science components and steps.

In this post, I fill the gap by explaining data science’s two essential components: data analysis and exploration. To make things clear and precise, I will outline both approaches, compare them and show the usage of Python Pandas for data exploration and analysis. I will also show several practices using Pandas and graph drawing using Python. Please let me know should you have any questions or comments about this post.

Data Analysis vs. Data Exploration

What is Data Analysis?

Data analysis can help determine patterns, trends, and insights that may not be immediately evident from raw data. This can guide informed decision-making, improved processes and strategies, and the ability to measure the effectiveness of different approaches. Additionally, analyzing data can help see and diagnose issues and can be used to build predictive models that can inform future actions.

These are a few examples of how data analysis can improve business productivity.

  1. Determining inefficiencies: Businesses can identify areas where operations are taking too long or resources are being wasted by analyzing data from different business processes. This can help them make changes that increase efficiency and lower expenses.
  2. Targeted marketing: Data analysis can be used to better understand customer behavior and preferences. This helps businesses construct more targeted marketing campaigns that are more likely to be successful, which leads to increased sales and earnings.
  3. Inventory management: By scrutinizing data on product sales and customer demand, businesses can optimize their stock levels, which can help them avoid stockouts and overstocking.
  4. Quality control: Data analysis can identify production data patterns, which can help businesses find and fix problems before they result in defective products or customer complaints.
  5. Predictive care: By analyzing data on equipment performance, companies can predict when maintenance will be needed and organize it proactively, which can prevent breakdowns and improve uptime.
  6. Fraud detection: Data analysis can identify dishonest behavior patterns, which can help companies detect and prevent fraudulent transactions before they happen.

Data analysis is the process of using statistical and computational methods to extract meaningful insights from data.

The main steps in data analysis typically include the following:

  1. Defining the problem and goals: This step involves defining the problem you want to solve and the specific questions or hypotheses you want to answer.
  2. Data preparation: This step involves cleaning and preparing the data for analysis, including loading it into a suitable format, handling missing values, and transforming the data as needed.
  3. Exploratory Data Analysis: This step involves exploring and summarizing the characteristics of the data, including understanding the structure and distribution of the data.
  4. Modeling: This step involves building mathematical or statistical models to represent the data. The models can make predictions, classify data or identify patterns.
  5. Evaluation: This step involves evaluating the performance of the models and comparing them with relevant benchmarks.
  6. Communication of results: This step involves presenting and interpreting the analysis results clearly and meaningfully, creating a report or a presentation to share the findings.
  7. Deployment: This step involves taking the results and putting them into action, using the models to make predictions or insights to inform business decisions.

These steps may only sometimes be strictly sequential, and there may be iterations and multiple rounds of analysis as needed to gain a thorough understanding of the data. The steps and techniques will vary depending on the type of data and the problem being addressed.

What is Data Exploration?

Data exploration analyzes and summarizes a dataset to understand its characteristics and properties. This may involve visualizing the data, identifying patterns and trends, and performing statistical analyses. The goal of data exploration is to gain insights into the data that can inform further analysis or modeling.

Data exploration typically includes the following steps:

  1. Data loading and cleaning: This step involves loading the data into a suitable format, such as a Pandas DataFrame, and cleaning it to remove any errors, missing values, or irrelevant information.
  2. Data understanding: This step involves understanding the structure of the data, including the number of rows and columns, the data types, and the range of values for each variable.
  3. Univariate analysis: This step involves analyzing each variable individually to understand its distribution, central tendency, and variability. This can be done using simple statistics, such as mean, median, and standard deviation, and visualizations, such as histograms, box plots, and bar charts.
  4. Multivariate analysis: This step involves analyzing the relationships between variables. This can be done using visualizations, such as scatter plots and heat maps, and correlation coefficients to measure the strength of the relationship between variables.
  5. Data transformation: This step involves transforming the data to make it more suitable for analysis. This can include scaling the data, creating new variables, or encoding categorical variables.
  6. Identifying outliers: This step involves identifying and analyzing any extreme values present in the data which can significantly impact the analysis.
  7. Data summarisation: This step involves summarizing the main findings of the exploration and creating a report or a presentation to share the results.

These steps are not strictly sequential, and there may be iterations and multiple rounds of exploration to gain a thorough understanding of the data.

Their main differences

Data analysis and data exploration are related but distinct processes. The main differences between the two are:

  1. Goal: Data analysis aims to extract meaningful insights, inform decisions, and support problem-solving. On the other hand, data exploration seeks to gain a general understanding of the data, identify patterns, and discover relationships.
  2. Approach: Data analysis is typically more structured and formal, often guided by specific questions or hypotheses. On the other hand, data exploration is more open-ended, allowing you to explore the data without preconceived notions of what you might find.
  3. Tools: Data analysis typically requires advanced statistical and computational tools to draw inferences from the data. On the other hand, data exploration can be done with various tools, including visualization and simple statistics.
  4. Output: Data analysis produces quantifiable results, such as statistics and reports. On the other hand, data exploration often results in a deeper understanding of the data and the discovery of new questions to be further analyzed.
  5. Audience: Data analysis is usually done for a specific audience, such as management or stakeholders. Data exploration is generally done by researchers or data scientists to gain insights and discover new questions.
  6. Data exploration is often a preliminary step in the data analysis process, and it’s essential to do some level of exploration before diving into the analysis. Still, they are not mutually exclusive, and the two can be combined differently depending on the use case.

Can we accept that data exploration is a step in data analysis?

Yes, data exploration is often considered a step in the data analysis process. Data exploration is the process of gaining an initial understanding of the data, identifying patterns and relationships, and summarizing the main characteristics of the dataset. It is an essential step before starting any data analysis, as it allows you to identify potential issues with the data, such as outliers, missing values, and data errors, and to understand the distribution, central tendency, and variability of the variables.

Data exploration can also help identify the relationships between variables, which can inform the choice of models, techniques, and methods for the data analysis. Additionally, data exploration can assist in identifying new questions or hypotheses that can be further explored during the data analysis.

It is important to note that data exploration and analysis are not mutually exclusive and can be combined differently depending on the use case. The level and depth of data exploration can vary depending on the goals and complexity of the data analysis project.

Python’s Pandas library

Pandas is Python’s powerful and popular open-source data analysis and manipulation library, providing functions for working with time series data, filtering, grouping, transforming data, and handling missing values. Pandas supports reading and writing various file formats, such as CSV and SQL. Pandas is an integral part of many data analysis and machine learning pipelines. It is better fitting for working with data programmatically because of its integration with the rest of the Python ecosystem.

In Pandas documentation we read:

pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.

When reading this definition above, I wanted to know whether we can confidently define Pandas as a complete data analysis solution and why. Keep reading.

Installing and Importing Pandas

Installing Pandas

To install the Pandas package on Mac OS, you must have Python and pip (the Python package manager) installed on your system. To install the latest version of Pandas and all its dependencies, run this command in a terminal window:

pip install pandas

Suppose you still need to install Python and pip. In that case, you can download and install the latest version of Python from the official Python website (https://www.python.org/downloads/). This will install Python and pip on your system. Once Python and pip are installed, you can use pip to install the Pandas package by running the command above.

Alternatively, you can install Pandas using the Anaconda distribution, which comes with a pre-installed version of Pandas and many other popular data science libraries. To install Anaconda, visit the Anaconda website (https://www.anaconda.com/products/individual) and follow the instructions to download and install the latest version.

Importing Pandas

You must use the import statement to import the Pandas library into a Python script. This will import the Pandas library and give it the alias “pd”. Further, we will use the alias “pd” to access the functions and methods in the Pandas library.

import pandas as pd

Exploring the Titanic dataset

In the previous section, we have defined the main concepts of Data Science, Data Exploration, and Data Analysis. It is clear to me that Data Exploration is one of the steps in the stricter and former process of Data analysis, often requiring a definition of the hypothesis that we methodically explore using statistical and computational techniques. Most of the Pandas functionality we will see in this post mainly relates to data exploration. I will write up the differences and the exact Pandas features related to the data analysis.

Thus, in this post, we will use Pandas for “understanding” or exploring the Titanic dataset. The Titanic dataset is a well-known dataset that contains information about the passengers on the Titanic, a British passenger liner that sank in the North Atlantic Ocean in 1912 after colliding with an iceberg.

The Titanic dataset is a good dataset for learning data manipulation and analysis techniques, as it has a relatively small size and is easy to work with. The dataset includes information about each passenger, such as their name, age, gender, class (i.e., first, second, or third class), the fare paid, and whether they survived the disaster.

Loading Titanic Dataset

Pandas provides several methods to directly read data from various sources, for instance, from a webpage with the help of function pd.read_html(), or from a CSV file uploaded to a web server with the help of pd.read_csv() function using URL string pointing to a Comma-separated file (CSV).

url = 'https://raw.githubusercontent.com/edaehn/python_tutorials/main/titanic/train.csv'
titanic_df = pd.read_csv(url)

This will download the CSV file and load it into a Pandas DataFrame.

index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.25 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38.0 1 0 PC 17599 71.2833 C85 C
2 3 1 3 Heikkinen, Miss. Laina female 26.0 0 0 STON/O2. 3101282 7.925 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.05 NaN S
5 6 0 3 Moran, Mr. James male NaN 0 0 330877 8.4583 NaN Q
6 7 0 1 McCarthy, Mr. Timothy J male 54.0 0 0 17463 51.8625 E46 S
7 8 0 3 Palsson, Master. Gosta Leonard male 2.0 3 1 349909 21.075 NaN S
8 9 1 3 Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg) female 27.0 0 2 347742 11.1333 NaN S
9 10 1 2 Nasser, Mrs. Nicholas (Adele Achem) female 14.0 1 0 237736 30.0708 NaN C
10 11 1 3 Sandstrom, Miss. Marguerite Rut female 4.0 1 1 PP 9549 16.7 G6 S
11 12 1 1 Bonnell, Miss. Elizabeth female 58.0 0 0 113783 26.55 C103 S
12 13 0 3 Saundercock, Mr. William Henry male 20.0 0 0 A/5. 2151 8.05 NaN S
13 14 0 3 Andersson, Mr. Anders Johan male 39.0 1 5 347082 31.275 NaN S
14 15 0 3 Vestrom, Miss. Hulda Amanda Adolfina female 14.0 0 0 350406 7.8542 NaN S
15 16 1 2 Hewlett, Mrs. (Mary D Kingcome) female 55.0 0 0 248706 16.0 NaN S
16 17 0 3 Rice, Master. Eugene male 2.0 4 1 382652 29.125 NaN Q
17 18 1 2 Williams, Mr. Charles Eugene male NaN 0 0 244373 13.0 NaN S
18 19 0 3 Vander Planke, Mrs. Julius (Emelia Maria Vandemoortele) female 31.0 1 0 345763 18.0 NaN S
19 20 1 3 Masselmani, Mrs. Fatima female NaN 0 0 2649 7.225 NaN C
20 21 0 2 Fynney, Mr. Joseph J male 35.0 0 0 239865 26.0 NaN S
21 22 1 2 Beesley, Mr. Lawrence male 34.0 0 0 248698 13.0 D56 S
22 23 1 3 McGowan, Miss. Anna “Annie” female 15.0 0 0 330923 8.0292 NaN Q
23 24 1 1 Sloper, Mr. William Thompson male 28.0 0 0 113788 35.5 A6 S
24 25 0 3 Palsson, Miss. Torborg Danira female 8.0 3 1 349909 21.075 NaN S
25 26 1 3 Asplund, Mrs. Carl Oscar (Selma Augusta Emilia Johansson) female 38.0 1 5 347077 31.3875 NaN S
26 27 0 3 Emir, Mr. Farred Chehab male NaN 0 0 2631 7.225 NaN C
27 28 0 1 Fortune, Mr. Charles Alexander male 19.0 3 2 19950 263.0 C23 C25 C27 S
28 29 1 3 O’Dwyer, Miss. Ellen “Nellie” female NaN 0 0 330959 7.8792 NaN Q
29 30 0 3 Todoroff, Mr. Lalio male NaN 0 0 349216 7.8958 NaN S
30 31 0 1 Uruchurtu, Don. Manuel E male 40.0 0 0 PC 17601 27.7208 NaN C
31 32 1 1 Spencer, Mrs. William Augustus (Marie Eugenie) female NaN 1 0 PC 17569 146.5208 B78 C
32 33 1 3 Glynn, Miss. Mary Agatha female NaN 0 0 335677 7.75 NaN Q
33 34 0 2 Wheadon, Mr. Edward H male 66.0 0 0 C.A. 24579 10.5 NaN S
34 35 0 1 Meyer, Mr. Edgar Joseph male 28.0 1 0 PC 17604 82.1708 NaN C
35 36 0 1 Holverson, Mr. Alexander Oskar male 42.0 1 0 113789 52.0 NaN S
36 37 1 3 Mamee, Mr. Hanna male NaN 0 0 2677 7.2292 NaN C
37 38 0 3 Cann, Mr. Ernest Charles male 21.0 0 0 A./5. 2152 8.05 NaN S
38 39 0 3 Vander Planke, Miss. Augusta Maria female 18.0 2 0 345764 18.0 NaN S
39 40 1 3 Nicola-Yarred, Miss. Jamila female 14.0 1 0 2651 11.2417 NaN C
40 41 0 3 Ahlin, Mrs. Johan (Johanna Persdotter Larsson) female 40.0 1 0 7546 9.475 NaN S
41 42 0 2 Turpin, Mrs. William John Robert (Dorothy Ann Wonnacott) female 27.0 1 0 11668 21.0 NaN S
42 43 0 3 Kraeff, Mr. Theodor male NaN 0 0 349253 7.8958 NaN C
43 44 1 2 Laroche, Miss. Simonne Marie Anne Andree female 3.0 1 2 SC/Paris 2123 41.5792 NaN C
44 45 1 3 Devaney, Miss. Margaret Delia female 19.0 0 0 330958 7.8792 NaN Q
45 46 0 3 Rogers, Mr. William John male NaN 0 0 S.C./A.4. 23567 8.05 NaN S
46 47 0 3 Lennon, Mr. Denis male NaN 1 0 370371 15.5 NaN Q
47 48 1 3 O’Driscoll, Miss. Bridget female NaN 0 0 14311 7.75 NaN Q
48 49 0 3 Samaan, Mr. Youssef male NaN 2 0 2662 21.6792 NaN C
49 50 0 3 Arnold-Franchi, Mrs. Josef (Josefine Franchi) female 18.0 1 0 349237 17.8 NaN S
50 51 0 3 Panula, Master. Juha Niilo male 7.0 4 1 3101295 39.6875 NaN S
51 52 0 3 Nosworthy, Mr. Richard Cater male 21.0 0 0 A/4. 39886 7.8 NaN S
52 53 1 1 Harper, Mrs. Henry Sleeper (Myna Haxtun) female 49.0 1 0 PC 17572 76.7292 D33 C
53 54 1 2 Faunthorpe, Mrs. Lizzie (Elizabeth Anne Wilkinson) female 29.0 1 0 2926 26.0 NaN S
54 55 0 1 Ostby, Mr. Engelhart Cornelius male 65.0 0 1 113509 61.9792 B30 C
55 56 1 1 Woolner, Mr. Hugh male NaN 0 0 19947 35.5 C52 S
56 57 1 2 Rugg, Miss. Emily female 21.0 0 0 C.A. 31026 10.5 NaN S
57 58 0 3 Novel, Mr. Mansouer male 28.5 0 0 2697 7.2292 NaN C
58 59 1 2 West, Miss. Constance Mirium female 5.0 1 2 C.A. 34651 27.75 NaN S
59 60 0 3 Goodwin, Master. William Frederick male 11.0 5 2 CA 2144 46.9 NaN S
60 61 0 3 Sirayanian, Mr. Orsen male 22.0 0 0 2669 7.2292 NaN C
61 62 1 1 Icard, Miss. Amelie female 38.0 0 0 113572 80.0 B28 NaN
62 63 0 1 Harris, Mr. Henry Birkhardt male 45.0 1 0 36973 83.475 C83 S
63 64 0 3 Skoog, Master. Harald male 4.0 3 2 347088 27.9 NaN S
64 65 0 1 Stewart, Mr. Albert A male NaN 0 0 PC 17605 27.7208 NaN C
65 66 1 3 Moubarek, Master. Gerios male NaN 1 1 2661 15.2458 NaN C
66 67 1 2 Nye, Mrs. (Elizabeth Ramell) female 29.0 0 0 C.A. 29395 10.5 F33 S
67 68 0 3 Crease, Mr. Ernest James male 19.0 0 0 S.P. 3464 8.1583 NaN S
68 69 1 3 Andersson, Miss. Erna Alexandra female 17.0 4 2 3101281 7.925 NaN S
69 70 0 3 Kink, Mr. Vincenz male 26.0 2 0 315151 8.6625 NaN S
70 71 0 2 Jenkin, Mr. Stephen Curnow male 32.0 0 0 C.A. 33111 10.5 NaN S
71 72 0 3 Goodwin, Miss. Lillian Amy female 16.0 5 2 CA 2144 46.9 NaN S
72 73 0 2 Hood, Mr. Ambrose Jr male 21.0 0 0 S.O.C. 14879 73.5 NaN S
73 74 0 3 Chronopoulos, Mr. Apostolos male 26.0 1 0 2680 14.4542 NaN C
74 75 1 3 Bing, Mr. Lee male 32.0 0 0 1601 56.4958 NaN S
75 76 0 3 Moen, Mr. Sigurd Hansen male 25.0 0 0 348123 7.65 F G73 S
76 77 0 3 Staneff, Mr. Ivan male NaN 0 0 349208 7.8958 NaN S
77 78 0 3 Moutal, Mr. Rahamin Haim male NaN 0 0 374746 8.05 NaN S
78 79 1 2 Caldwell, Master. Alden Gates male 0.83 0 2 248738 29.0 NaN S
79 80 1 3 Dowdell, Miss. Elizabeth female 30.0 0 0 364516 12.475 NaN S
80 81 0 3 Waelens, Mr. Achille male 22.0 0 0 345767 9.0 NaN S
81 82 1 3 Sheerlinck, Mr. Jan Baptist male 29.0 0 0 345779 9.5 NaN S
82 83 1 3 McDermott, Miss. Brigdet Delia female NaN 0 0 330932 7.7875 NaN Q
83 84 0 1 Carrau, Mr. Francisco M male 28.0 0 0 113059 47.1 NaN S
84 85 1 2 Ilett, Miss. Bertha female 17.0 0 0 SO/C 14885 10.5 NaN S
85 86 1 3 Backstrom, Mrs. Karl Alfred (Maria Mathilda Gustafsson) female 33.0 3 0 3101278 15.85 NaN S
86 87 0 3 Ford, Mr. William Neal male 16.0 1 3 W./C. 6608 34.375 NaN S
87 88 0 3 Slocovski, Mr. Selman Francis male NaN 0 0 SOTON/OQ 392086 8.05 NaN S
88 89 1 1 Fortune, Miss. Mabel Helen female 23.0 3 2 19950 263.0 C23 C25 C27 S
89 90 0 3 Celotti, Mr. Francesco male 24.0 0 0 343275 8.05 NaN S
90 91 0 3 Christmann, Mr. Emil male 29.0 0 0 343276 8.05 NaN S
91 92 0 3 Andreasson, Mr. Paul Edvin male 20.0 0 0 347466 7.8542 NaN S
92 93 0 1 Chaffee, Mr. Herbert Fuller male 46.0 1 0 W.E.P. 5734 61.175 E31 S
93 94 0 3 Dean, Mr. Bertram Frank male 26.0 1 2 C.A. 2315 20.575 NaN S
94 95 0 3 Coxon, Mr. Daniel male 59.0 0 0 364500 7.25 NaN S
95 96 0 3 Shorney, Mr. Charles Joseph male NaN 0 0 374910 8.05 NaN S
96 97 0 1 Goldschmidt, Mr. George B male 71.0 0 0 PC 17754 34.6542 A5 C
97 98 1 1 Greenfield, Mr. William Bertram male 23.0 0 1 PC 17759 63.3583 D10 D12 C
98 99 1 2 Doling, Mrs. John T (Ada Julia Bone) female 34.0 0 1 231919 23.0 NaN S
99 100 0 2 Kantor, Mr. Sinai male 34.0 1 0 244367 26.0 NaN S
100 101 0 3 Petranec, Miss. Matilda female 28.0 0 0 349245 7.8958 NaN S
101 102 0 3 Petroff, Mr. Pastcho (“Pentcho”) male NaN 0 0 349215 7.8958 NaN S
102 103 0 1 White, Mr. Richard Frasar male 21.0 0 1 35281 77.2875 D26 S
103 104 0 3 Johansson, Mr. Gustaf Joel male 33.0 0 0 7540 8.6542 NaN S
104 105 0 3 Gustafsson, Mr. Anders Vilhelm male 37.0 2 0 3101276 7.925 NaN S
105 106 0 3 Mionoff, Mr. Stoytcho male 28.0 0 0 349207 7.8958 NaN S
106 107 1 3 Salkjelsvik, Miss. Anna Kristine female 21.0 0 0 343120 7.65 NaN S
107 108 1 3 Moss, Mr. Albert Johan male NaN 0 0 312991 7.775 NaN S
108 109 0 3 Rekic, Mr. Tido male 38.0 0 0 349249 7.8958 NaN S
109 110 1 3 Moran, Miss. Bertha female NaN 1 0 371110 24.15 NaN Q
110 111 0 1 Porter, Mr. Walter Chamberlain male 47.0 0 0 110465 52.0 C110 S
111 112 0 3 Zabour, Miss. Hileni female 14.5 1 0 2665 14.4542 NaN C
112 113 0 3 Barton, Mr. David John male 22.0 0 0 324669 8.05 NaN S
113 114 0 3 Jussila, Miss. Katriina female 20.0 1 0 4136 9.825 NaN S
114 115 0 3 Attalah, Miss. Malake female 17.0 0 0 2627 14.4583 NaN C
115 116 0 3 Pekoniemi, Mr. Edvard male 21.0 0 0 STON/O 2. 3101294 7.925 NaN S
116 117 0 3 Connors, Mr. Patrick male 70.5 0 0 370369 7.75 NaN Q
117 118 0 2 Turpin, Mr. William John Robert male 29.0 1 0 11668 21.0 NaN S
118 119 0 1 Baxter, Mr. Quigg Edmond male 24.0 0 1 PC 17558 247.5208 B58 B60 C
119 120 0 3 Andersson, Miss. Ellis Anna Maria female 2.0 4 2 347082 31.275 NaN S
120 121 0 2 Hickman, Mr. Stanley George male 21.0 2 0 S.O.C. 14879 73.5 NaN S
121 122 0 3 Moore, Mr. Leonard Charles male NaN 0 0 A4. 54510 8.05 NaN S
122 123 0 2 Nasser, Mr. Nicholas male 32.5 1 0 237736 30.0708 NaN C
123 124 1 2 Webber, Miss. Susan female 32.5 0 0 27267 13.0 E101 S
124 125 0 1 White, Mr. Percival Wayland male 54.0 0 1 35281 77.2875 D26 S
125 126 1 3 Nicola-Yarred, Master. Elias male 12.0 1 0 2651 11.2417 NaN C
126 127 0 3 McMahon, Mr. Martin male NaN 0 0 370372 7.75 NaN Q
127 128 1 3 Madsen, Mr. Fridtjof Arne male 24.0 0 0 C 17369 7.1417 NaN S
128 129 1 3 Peter, Miss. Anna female NaN 1 1 2668 22.3583 F E69 C
129 130 0 3 Ekstrom, Mr. Johan male 45.0 0 0 347061 6.975 NaN S
130 131 0 3 Drazenoic, Mr. Jozef male 33.0 0 0 349241 7.8958 NaN C
131 132 0 3 Coelho, Mr. Domingos Fernandeo male 20.0 0 0 SOTON/O.Q. 3101307 7.05 NaN S
132 133 0 3 Robins, Mrs. Alexander A (Grace Charity Laury) female 47.0 1 0 A/5. 3337 14.5 NaN S
133 134 1 2 Weisz, Mrs. Leopold (Mathilde Francoise Pede) female 29.0 1 0 228414 26.0 NaN S
134 135 0 2 Sobey, Mr. Samuel James Hayden male 25.0 0 0 C.A. 29178 13.0 NaN S
135 136 0 2 Richard, Mr. Emile male 23.0 0 0 SC/PARIS 2133 15.0458 NaN C
136 137 1 1 Newsom, Miss. Helen Monypeny female 19.0 0 2 11752 26.2833 D47 S
137 138 0 1 Futrelle, Mr. Jacques Heath male 37.0 1 0 113803 53.1 C123 S
138 139 0 3 Osen, Mr. Olaf Elon male 16.0 0 0 7534 9.2167 NaN S
139 140 0 1 Giglio, Mr. Victor male 24.0 0 0 PC 17593 79.2 B86 C
140 141 0 3 Boulos, Mrs. Joseph (Sultana) female NaN 0 2 2678 15.2458 NaN C
141 142 1 3 Nysten, Miss. Anna Sofia female 22.0 0 0 347081 7.75 NaN S
142 143 1 3 Hakkarainen, Mrs. Pekka Pietari (Elin Matilda Dolck) female 24.0 1 0 STON/O2. 3101279 15.85 NaN S
143 144 0 3 Burke, Mr. Jeremiah male 19.0 0 0 365222 6.75 NaN Q
144 145 0 2 Andrew, Mr. Edgardo Samuel male 18.0 0 0 231945 11.5 NaN S
145 146 0 2 Nicholls, Mr. Joseph Charles male 19.0 1 1 C.A. 33112 36.75 NaN S
146 147 1 3 Andersson, Mr. August Edvard (“Wennerstrom”) male 27.0 0 0 350043 7.7958 NaN S
147 148 0 3 Ford, Miss. Robina Maggie “Ruby” female 9.0 2 2 W./C. 6608 34.375 NaN S
148 149 0 2 Navratil, Mr. Michel (“Louis M Hoffman”) male 36.5 0 2 230080 26.0 F2 S
149 150 0 2 Byles, Rev. Thomas Roussel Davids male 42.0 0 0 244310 13.0 NaN S
150 151 0 2 Bateman, Rev. Robert James male 51.0 0 0 S.O.P. 1166 12.525 NaN S
151 152 1 1 Pears, Mrs. Thomas (Edith Wearne) female 22.0 1 0 113776 66.6 C2 S
152 153 0 3 Meo, Mr. Alfonzo male 55.5 0 0 A.5. 11206 8.05 NaN S
153 154 0 3 van Billiard, Mr. Austin Blyler male 40.5 0 2 A/5. 851 14.5 NaN S
154 155 0 3 Olsen, Mr. Ole Martin male NaN 0 0 Fa 265302 7.3125 NaN S
155 156 0 1 Williams, Mr. Charles Duane male 51.0 0 1 PC 17597 61.3792 NaN C
156 157 1 3 Gilnagh, Miss. Katherine “Katie” female 16.0 0 0 35851 7.7333 NaN Q
157 158 0 3 Corn, Mr. Harry male 30.0 0 0 SOTON/OQ 392090 8.05 NaN S
158 159 0 3 Smiljanic, Mr. Mile male NaN 0 0 315037 8.6625 NaN S
159 160 0 3 Sage, Master. Thomas Henry male NaN 8 2 CA. 2343 69.55 NaN S
160 161 0 3 Cribb, Mr. John Hatfield male 44.0 0 1 371362 16.1 NaN S
161 162 1 2 Watt, Mrs. James (Elizabeth “Bessie” Inglis Milne) female 40.0 0 0 C.A. 33595 15.75 NaN S
162 163 0 3 Bengtsson, Mr. John Viktor male 26.0 0 0 347068 7.775 NaN S
163 164 0 3 Calic, Mr. Jovo male 17.0 0 0 315093 8.6625 NaN S
164 165 0 3 Panula, Master. Eino Viljami male 1.0 4 1 3101295 39.6875 NaN S
165 166 1 3 Goldsmith, Master. Frank John William “Frankie” male 9.0 0 2 363291 20.525 NaN S
166 167 1 1 Chibnall, Mrs. (Edith Martha Bowerman) female NaN 0 1 113505 55.0 E33 S
167 168 0 3 Skoog, Mrs. William (Anna Bernhardina Karlsson) female 45.0 1 4 347088 27.9 NaN S
168 169 0 1 Baumann, Mr. John D male NaN 0 0 PC 17318 25.925 NaN S
169 170 0 3 Ling, Mr. Lee male 28.0 0 0 1601 56.4958 NaN S
170 171 0 1 Van der hoef, Mr. Wyckoff male 61.0 0 0 111240 33.5 B19 S
171 172 0 3 Rice, Master. Arthur male 4.0 4 1 382652 29.125 NaN Q
172 173 1 3 Johnson, Miss. Eleanor Ileen female 1.0 1 1 347742 11.1333 NaN S
173 174 0 3 Sivola, Mr. Antti Wilhelm male 21.0 0 0 STON/O 2. 3101280 7.925 NaN S
174 175 0 1 Smith, Mr. James Clinch male 56.0 0 0 17764 30.6958 A7 C
175 176 0 3 Klasen, Mr. Klas Albin male 18.0 1 1 350404 7.8542 NaN S
176 177 0 3 Lefebre, Master. Henry Forbes male NaN 3 1 4133 25.4667 NaN S
177 178 0 1 Isham, Miss. Ann Elizabeth female 50.0 0 0 PC 17595 28.7125 C49 C
178 179 0 2 Hale, Mr. Reginald male 30.0 0 0 250653 13.0 NaN S
179 180 0 3 Leonard, Mr. Lionel male 36.0 0 0 LINE 0.0 NaN S
180 181 0 3 Sage, Miss. Constance Gladys female NaN 8 2 CA. 2343 69.55 NaN S
181 182 0 2 Pernot, Mr. Rene male NaN 0 0 SC/PARIS 2131 15.05 NaN C
182 183 0 3 Asplund, Master. Clarence Gustaf Hugo male 9.0 4 2 347077 31.3875 NaN S
183 184 1 2 Becker, Master. Richard F male 1.0 2 1 230136 39.0 F4 S
184 185 1 3 Kink-Heilmann, Miss. Luise Gretchen female 4.0 0 2 315153 22.025 NaN S
185 186 0 1 Rood, Mr. Hugh Roscoe male NaN 0 0 113767 50.0 A32 S
186 187 1 3 O’Brien, Mrs. Thomas (Johanna “Hannah” Godfrey) female NaN 1 0 370365 15.5 NaN Q
187 188 1 1 Romaine, Mr. Charles Hallace (“Mr C Rolmane”) male 45.0 0 0 111428 26.55 NaN S
188 189 0 3 Bourke, Mr. John male 40.0 1 1 364849 15.5 NaN Q
189 190 0 3 Turcin, Mr. Stjepan male 36.0 0 0 349247 7.8958 NaN S
190 191 1 2 Pinsky, Mrs. (Rosa) female 32.0 0 0 234604 13.0 NaN S
191 192 0 2 Carbines, Mr. William male 19.0 0 0 28424 13.0 NaN S
192 193 1 3 Andersen-Jensen, Miss. Carla Christine Nielsine female 19.0 1 0 350046 7.8542 NaN S
193 194 1 2 Navratil, Master. Michel M male 3.0 1 1 230080 26.0 F2 S
194 195 1 1 Brown, Mrs. James Joseph (Margaret Tobin) female 44.0 0 0 PC 17610 27.7208 B4 C
195 196 1 1 Lurette, Miss. Elise female 58.0 0 0 PC 17569 146.5208 B80 C
196 197 0 3 Mernagh, Mr. Robert male NaN 0 0 368703 7.75 NaN Q
197 198 0 3 Olsen, Mr. Karl Siegwart Andreas male 42.0 0 1 4579 8.4042 NaN S
198 199 1 3 Madigan, Miss. Margaret “Maggie” female NaN 0 0 370370 7.75 NaN Q
199 200 0 2 Yrois, Miss. Henriette (“Mrs Harbeck”) female 24.0 0 0 248747 13.0 NaN S
200 201 0 3 Vande Walle, Mr. Nestor Cyriel male 28.0 0 0 345770 9.5 NaN S
201 202 0 3 Sage, Mr. Frederick male NaN 8 2 CA. 2343 69.55 NaN S
202 203 0 3 Johanson, Mr. Jakob Alfred male 34.0 0 0 3101264 6.4958 NaN S
203 204 0 3 Youseff, Mr. Gerious male 45.5 0 0 2628 7.225 NaN C
204 205 1 3 Cohen, Mr. Gurshon “Gus” male 18.0 0 0 A/5 3540 8.05 NaN S
205 206 0 3 Strom, Miss. Telma Matilda female 2.0 0 1 347054 10.4625 G6 S
206 207 0 3 Backstrom, Mr. Karl Alfred male 32.0 1 0 3101278 15.85 NaN S
207 208 1 3 Albimona, Mr. Nassef Cassem male 26.0 0 0 2699 18.7875 NaN C
208 209 1 3 Carr, Miss. Helen “Ellen” female 16.0 0 0 367231 7.75 NaN Q
209 210 1 1 Blank, Mr. Henry male 40.0 0 0 112277 31.0 A31 C
210 211 0 3 Ali, Mr. Ahmed male 24.0 0 0 SOTON/O.Q. 3101311 7.05 NaN S
211 212 1 2 Cameron, Miss. Clear Annie female 35.0 0 0 F.C.C. 13528 21.0 NaN S
212 213 0 3 Perkin, Mr. John Henry male 22.0 0 0 A/5 21174 7.25 NaN S
213 214 0 2 Givard, Mr. Hans Kristensen male 30.0 0 0 250646 13.0 NaN S
214 215 0 3 Kiernan, Mr. Philip male NaN 1 0 367229 7.75 NaN Q
215 216 1 1 Newell, Miss. Madeleine female 31.0 1 0 35273 113.275 D36 C
216 217 1 3 Honkanen, Miss. Eliina female 27.0 0 0 STON/O2. 3101283 7.925 NaN S
217 218 0 2 Jacobsohn, Mr. Sidney Samuel male 42.0 1 0 243847 27.0 NaN S
218 219 1 1 Bazzani, Miss. Albina female 32.0 0 0 11813 76.2917 D15 C
219 220 0 2 Harris, Mr. Walter male 30.0 0 0 W/C 14208 10.5 NaN S
220 221 1 3 Sunderland, Mr. Victor Francis male 16.0 0 0 SOTON/OQ 392089 8.05 NaN S
221 222 0 2 Bracken, Mr. James H male 27.0 0 0 220367 13.0 NaN S
222 223 0 3 Green, Mr. George Henry male 51.0 0 0 21440 8.05 NaN S
223 224 0 3 Nenkoff, Mr. Christo male NaN 0 0 349234 7.8958 NaN S
224 225 1 1 Hoyt, Mr. Frederick Maxfield male 38.0 1 0 19943 90.0 C93 S
225 226 0 3 Berglund, Mr. Karl Ivar Sven male 22.0 0 0 PP 4348 9.35 NaN S
226 227 1 2 Mellors, Mr. William John male 19.0 0 0 SW/PP 751 10.5 NaN S
227 228 0 3 Lovell, Mr. John Hall (“Henry”) male 20.5 0 0 A/5 21173 7.25 NaN S
228 229 0 2 Fahlstrom, Mr. Arne Jonas male 18.0 0 0 236171 13.0 NaN S
229 230 0 3 Lefebre, Miss. Mathilde female NaN 3 1 4133 25.4667 NaN S
230 231 1 1 Harris, Mrs. Henry Birkhardt (Irene Wallach) female 35.0 1 0 36973 83.475 C83 S
231 232 0 3 Larsson, Mr. Bengt Edvin male 29.0 0 0 347067 7.775 NaN S
232 233 0 2 Sjostedt, Mr. Ernst Adolf male 59.0 0 0 237442 13.5 NaN S
233 234 1 3 Asplund, Miss. Lillian Gertrud female 5.0 4 2 347077 31.3875 NaN S
234 235 0 2 Leyson, Mr. Robert William Norman male 24.0 0 0 C.A. 29566 10.5 NaN S
235 236 0 3 Harknett, Miss. Alice Phoebe female NaN 0 0 W./C. 6609 7.55 NaN S
236 237 0 2 Hold, Mr. Stephen male 44.0 1 0 26707 26.0 NaN S
237 238 1 2 Collyer, Miss. Marjorie “Lottie” female 8.0 0 2 C.A. 31921 26.25 NaN S
238 239 0 2 Pengelly, Mr. Frederick William male 19.0 0 0 28665 10.5 NaN S
239 240 0 2 Hunt, Mr. George Henry male 33.0 0 0 SCO/W 1585 12.275 NaN S
240 241 0 3 Zabour, Miss. Thamine female NaN 1 0 2665 14.4542 NaN C
241 242 1 3 Murphy, Miss. Katherine “Kate” female NaN 1 0 367230 15.5 NaN Q
242 243 0 2 Coleridge, Mr. Reginald Charles male 29.0 0 0 W./C. 14263 10.5 NaN S
243 244 0 3 Maenpaa, Mr. Matti Alexanteri male 22.0 0 0 STON/O 2. 3101275 7.125 NaN S
244 245 0 3 Attalah, Mr. Sleiman male 30.0 0 0 2694 7.225 NaN C
245 246 0 1 Minahan, Dr. William Edward male 44.0 2 0 19928 90.0 C78 Q
246 247 0 3 Lindahl, Miss. Agda Thorilda Viktoria female 25.0 0 0 347071 7.775 NaN S
247 248 1 2 Hamalainen, Mrs. William (Anna) female 24.0 0 2 250649 14.5 NaN S
248 249 1 1 Beckwith, Mr. Richard Leonard male 37.0 1 1 11751 52.5542 D35 S
249 250 0 2 Carter, Rev. Ernest Courtenay male 54.0 1 0 244252 26.0 NaN S
250 251 0 3 Reed, Mr. James George male NaN 0 0 362316 7.25 NaN S
251 252 0 3 Strom, Mrs. Wilhelm (Elna Matilda Persson) female 29.0 1 1 347054 10.4625 G6 S
252 253 0 1 Stead, Mr. William Thomas male 62.0 0 0 113514 26.55 C87 S
253 254 0 3 Lobb, Mr. William Arthur male 30.0 1 0 A/5. 3336 16.1 NaN S
254 255 0 3 Rosblom, Mrs. Viktor (Helena Wilhelmina) female 41.0 0 2 370129 20.2125 NaN S
255 256 1 3 Touma, Mrs. Darwis (Hanne Youssef Razi) female 29.0 0 2 2650 15.2458 NaN C
256 257 1 1 Thorne, Mrs. Gertrude Maybelle female NaN 0 0 PC 17585 79.2 NaN C
257 258 1 1 Cherry, Miss. Gladys female 30.0 0 0 110152 86.5 B77 S
258 259 1 1 Ward, Miss. Anna female 35.0 0 0 PC 17755 512.3292 NaN C
259 260 1 2 Parrish, Mrs. (Lutie Davis) female 50.0 0 1 230433 26.0 NaN S
260 261 0 3 Smith, Mr. Thomas male NaN 0 0 384461 7.75 NaN Q
261 262 1 3 Asplund, Master. Edvin Rojj Felix male 3.0 4 2 347077 31.3875 NaN S
262 263 0 1 Taussig, Mr. Emil male 52.0 1 1 110413 79.65 E67 S
263 264 0 1 Harrison, Mr. William male 40.0 0 0 112059 0.0 B94 S
264 265 0 3 Henry, Miss. Delia female NaN 0 0 382649 7.75 NaN Q
265 266 0 2 Reeves, Mr. David male 36.0 0 0 C.A. 17248 10.5 NaN S
266 267 0 3 Panula, Mr. Ernesti Arvid male 16.0 4 1 3101295 39.6875 NaN S
267 268 1 3 Persson, Mr. Ernst Ulrik male 25.0 1 0 347083 7.775 NaN S
268 269 1 1 Graham, Mrs. William Thompson (Edith Junkins) female 58.0 0 1 PC 17582 153.4625 C125 S
269 270 1 1 Bissette, Miss. Amelia female 35.0 0 0 PC 17760 135.6333 C99 S
270 271 0 1 Cairns, Mr. Alexander male NaN 0 0 113798 31.0 NaN S
271 272 1 3 Tornquist, Mr. William Henry male 25.0 0 0 LINE 0.0 NaN S
272 273 1 2 Mellinger, Mrs. (Elizabeth Anne Maidment) female 41.0 0 1 250644 19.5 NaN S
273 274 0 1 Natsch, Mr. Charles H male 37.0 0 1 PC 17596 29.7 C118 C
274 275 1 3 Healy, Miss. Hanora “Nora” female NaN 0 0 370375 7.75 NaN Q
275 276 1 1 Andrews, Miss. Kornelia Theodosia female 63.0 1 0 13502 77.9583 D7 S
276 277 0 3 Lindblom, Miss. Augusta Charlotta female 45.0 0 0 347073 7.75 NaN S
277 278 0 2 Parkes, Mr. Francis “Frank” male NaN 0 0 239853 0.0 NaN S
278 279 0 3 Rice, Master. Eric male 7.0 4 1 382652 29.125 NaN Q
279 280 1 3 Abbott, Mrs. Stanton (Rosa Hunt) female 35.0 1 1 C.A. 2673 20.25 NaN S
280 281 0 3 Duane, Mr. Frank male 65.0 0 0 336439 7.75 NaN Q
281 282 0 3 Olsson, Mr. Nils Johan Goransson male 28.0 0 0 347464 7.8542 NaN S
282 283 0 3 de Pelsmaeker, Mr. Alfons male 16.0 0 0 345778 9.5 NaN S
283 284 1 3 Dorking, Mr. Edward Arthur male 19.0 0 0 A/5. 10482 8.05 NaN S
284 285 0 1 Smith, Mr. Richard William male NaN 0 0 113056 26.0 A19 S
285 286 0 3 Stankovic, Mr. Ivan male 33.0 0 0 349239 8.6625 NaN C
286 287 1 3 de Mulder, Mr. Theodore male 30.0 0 0 345774 9.5 NaN S
287 288 0 3 Naidenoff, Mr. Penko male 22.0 0 0 349206 7.8958 NaN S
288 289 1 2 Hosono, Mr. Masabumi male 42.0 0 0 237798 13.0 NaN S
289 290 1 3 Connolly, Miss. Kate female 22.0 0 0 370373 7.75 NaN Q
290 291 1 1 Barber, Miss. Ellen “Nellie” female 26.0 0 0 19877 78.85 NaN S
291 292 1 1 Bishop, Mrs. Dickinson H (Helen Walton) female 19.0 1 0 11967 91.0792 B49 C
292 293 0 2 Levy, Mr. Rene Jacques male 36.0 0 0 SC/Paris 2163 12.875 D C
293 294 0 3 Haas, Miss. Aloisia female 24.0 0 0 349236 8.85 NaN S
294 295 0 3 Mineff, Mr. Ivan male 24.0 0 0 349233 7.8958 NaN S
295 296 0 1 Lewy, Mr. Ervin G male NaN 0 0 PC 17612 27.7208 NaN C
296 297 0 3 Hanna, Mr. Mansour male 23.5 0 0 2693 7.2292 NaN C
297 298 0 1 Allison, Miss. Helen Loraine female 2.0 1 2 113781 151.55 C22 C26 S
298 299 1 1 Saalfeld, Mr. Adolphe male NaN 0 0 19988 30.5 C106 S
299 300 1 1 Baxter, Mrs. James (Helene DeLaudeniere Chaput) female 50.0 0 1 PC 17558 247.5208 B58 B60 C
300 301 1 3 Kelly, Miss. Anna Katherine “Annie Kate” female NaN 0 0 9234 7.75 NaN Q
301 302 1 3 McCoy, Mr. Bernard male NaN 2 0 367226 23.25 NaN Q
302 303 0 3 Johnson, Mr. William Cahoone Jr male 19.0 0 0 LINE 0.0 NaN S
303 304 1 2 Keane, Miss. Nora A female NaN 0 0 226593 12.35 E101 Q
304 305 0 3 Williams, Mr. Howard Hugh “Harry” male NaN 0 0 A/5 2466 8.05 NaN S
305 306 1 1 Allison, Master. Hudson Trevor male 0.92 1 2 113781 151.55 C22 C26 S
306 307 1 1 Fleming, Miss. Margaret female NaN 0 0 17421 110.8833 NaN C
307 308 1 1 Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo) female 17.0 1 0 PC 17758 108.9 C65 C
308 309 0 2 Abelson, Mr. Samuel male 30.0 1 0 P/PP 3381 24.0 NaN C
309 310 1 1 Francatelli, Miss. Laura Mabel female 30.0 0 0 PC 17485 56.9292 E36 C
310 311 1 1 Hays, Miss. Margaret Bechstein female 24.0 0 0 11767 83.1583 C54 C
311 312 1 1 Ryerson, Miss. Emily Borie female 18.0 2 2 PC 17608 262.375 B57 B59 B63 B66 C
312 313 0 2 Lahtinen, Mrs. William (Anna Sylfven) female 26.0 1 1 250651 26.0 NaN S
313 314 0 3 Hendekovic, Mr. Ignjac male 28.0 0 0 349243 7.8958 NaN S
314 315 0 2 Hart, Mr. Benjamin male 43.0 1 1 F.C.C. 13529 26.25 NaN S
315 316 1 3 Nilsson, Miss. Helmina Josefina female 26.0 0 0 347470 7.8542 NaN S
316 317 1 2 Kantor, Mrs. Sinai (Miriam Sternin) female 24.0 1 0 244367 26.0 NaN S
317 318 0 2 Moraweck, Dr. Ernest male 54.0 0 0 29011 14.0 NaN S
318 319 1 1 Wick, Miss. Mary Natalie female 31.0 0 2 36928 164.8667 C7 S
319 320 1 1 Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone) female 40.0 1 1 16966 134.5 E34 C
320 321 0 3 Dennis, Mr. Samuel male 22.0 0 0 A/5 21172 7.25 NaN S
321 322 0 3 Danoff, Mr. Yoto male 27.0 0 0 349219 7.8958 NaN S
322 323 1 2 Slayter, Miss. Hilda Mary female 30.0 0 0 234818 12.35 NaN Q
323 324 1 2 Caldwell, Mrs. Albert Francis (Sylvia Mae Harbaugh) female 22.0 1 1 248738 29.0 NaN S
324 325 0 3 Sage, Mr. George John Jr male NaN 8 2 CA. 2343 69.55 NaN S
325 326 1 1 Young, Miss. Marie Grice female 36.0 0 0 PC 17760 135.6333 C32 C
326 327 0 3 Nysveen, Mr. Johan Hansen male 61.0 0 0 345364 6.2375 NaN S
327 328 1 2 Ball, Mrs. (Ada E Hall) female 36.0 0 0 28551 13.0 D S
328 329 1 3 Goldsmith, Mrs. Frank John (Emily Alice Brown) female 31.0 1 1 363291 20.525 NaN S
329 330 1 1 Hippach, Miss. Jean Gertrude female 16.0 0 1 111361 57.9792 B18 C
330 331 1 3 McCoy, Miss. Agnes female NaN 2 0 367226 23.25 NaN Q
331 332 0 1 Partner, Mr. Austen male 45.5 0 0 113043 28.5 C124 S
332 333 0 1 Graham, Mr. George Edward male 38.0 0 1 PC 17582 153.4625 C91 S
333 334 0 3 Vander Planke, Mr. Leo Edmondus male 16.0 2 0 345764 18.0 NaN S
334 335 1 1 Frauenthal, Mrs. Henry William (Clara Heinsheimer) female NaN 1 0 PC 17611 133.65 NaN S
335 336 0 3 Denkoff, Mr. Mitto male NaN 0 0 349225 7.8958 NaN S
336 337 0 1 Pears, Mr. Thomas Clinton male 29.0 1 0 113776 66.6 C2 S
337 338 1 1 Burns, Miss. Elizabeth Margaret female 41.0 0 0 16966 134.5 E40 C
338 339 1 3 Dahl, Mr. Karl Edwart male 45.0 0 0 7598 8.05 NaN S
339 340 0 1 Blackwell, Mr. Stephen Weart male 45.0 0 0 113784 35.5 T S
340 341 1 2 Navratil, Master. Edmond Roger male 2.0 1 1 230080 26.0 F2 S
341 342 1 1 Fortune, Miss. Alice Elizabeth female 24.0 3 2 19950 263.0 C23 C25 C27 S
342 343 0 2 Collander, Mr. Erik Gustaf male 28.0 0 0 248740 13.0 NaN S
343 344 0 2 Sedgwick, Mr. Charles Frederick Waddington male 25.0 0 0 244361 13.0 NaN S
344 345 0 2 Fox, Mr. Stanley Hubert male 36.0 0 0 229236 13.0 NaN S
345 346 1 2 Brown, Miss. Amelia “Mildred” female 24.0 0 0 248733 13.0 F33 S
346 347 1 2 Smith, Miss. Marion Elsie female 40.0 0 0 31418 13.0 NaN S
347 348 1 3 Davison, Mrs. Thomas Henry (Mary E Finck) female NaN 1 0 386525 16.1 NaN S
348 349 1 3 Coutts, Master. William Loch “William” male 3.0 1 1 C.A. 37671 15.9 NaN S
349 350 0 3 Dimic, Mr. Jovan male 42.0 0 0 315088 8.6625 NaN S
350 351 0 3 Odahl, Mr. Nils Martin male 23.0 0 0 7267 9.225 NaN S
351 352 0 1 Williams-Lambert, Mr. Fletcher Fellows male NaN 0 0 113510 35.0 C128 S
352 353 0 3 Elias, Mr. Tannous male 15.0 1 1 2695 7.2292 NaN C
353 354 0 3 Arnold-Franchi, Mr. Josef male 25.0 1 0 349237 17.8 NaN S
354 355 0 3 Yousif, Mr. Wazli male NaN 0 0 2647 7.225 NaN C
355 356 0 3 Vanden Steen, Mr. Leo Peter male 28.0 0 0 345783 9.5 NaN S
356 357 1 1 Bowerman, Miss. Elsie Edith female 22.0 0 1 113505 55.0 E33 S
357 358 0 2 Funk, Miss. Annie Clemmer female 38.0 0 0 237671 13.0 NaN S
358 359 1 3 McGovern, Miss. Mary female NaN 0 0 330931 7.8792 NaN Q
359 360 1 3 Mockler, Miss. Helen Mary “Ellie” female NaN 0 0 330980 7.8792 NaN Q
360 361 0 3 Skoog, Mr. Wilhelm male 40.0 1 4 347088 27.9 NaN S
361 362 0 2 del Carlo, Mr. Sebastiano male 29.0 1 0 SC/PARIS 2167 27.7208 NaN C
362 363 0 3 Barbara, Mrs. (Catherine David) female 45.0 0 1 2691 14.4542 NaN C
363 364 0 3 Asim, Mr. Adola male 35.0 0 0 SOTON/O.Q. 3101310 7.05 NaN S
364 365 0 3 O’Brien, Mr. Thomas male NaN 1 0 370365 15.5 NaN Q
365 366 0 3 Adahl, Mr. Mauritz Nils Martin male 30.0 0 0 C 7076 7.25 NaN S
366 367 1 1 Warren, Mrs. Frank Manley (Anna Sophia Atkinson) female 60.0 1 0 110813 75.25 D37 C
367 368 1 3 Moussa, Mrs. (Mantoura Boulos) female NaN 0 0 2626 7.2292 NaN C
368 369 1 3 Jermyn, Miss. Annie female NaN 0 0 14313 7.75 NaN Q
369 370 1 1 Aubart, Mme. Leontine Pauline female 24.0 0 0 PC 17477 69.3 B35 C
370 371 1 1 Harder, Mr. George Achilles male 25.0 1 0 11765 55.4417 E50 C
371 372 0 3 Wiklund, Mr. Jakob Alfred male 18.0 1 0 3101267 6.4958 NaN S
372 373 0 3 Beavan, Mr. William Thomas male 19.0 0 0 323951 8.05 NaN S
373 374 0 1 Ringhini, Mr. Sante male 22.0 0 0 PC 17760 135.6333 NaN C
374 375 0 3 Palsson, Miss. Stina Viola female 3.0 3 1 349909 21.075 NaN S
375 376 1 1 Meyer, Mrs. Edgar Joseph (Leila Saks) female NaN 1 0 PC 17604 82.1708 NaN C
376 377 1 3 Landergren, Miss. Aurora Adelia female 22.0 0 0 C 7077 7.25 NaN S
377 378 0 1 Widener, Mr. Harry Elkins male 27.0 0 2 113503 211.5 C82 C
378 379 0 3 Betros, Mr. Tannous male 20.0 0 0 2648 4.0125 NaN C
379 380 0 3 Gustafsson, Mr. Karl Gideon male 19.0 0 0 347069 7.775 NaN S
380 381 1 1 Bidois, Miss. Rosalie female 42.0 0 0 PC 17757 227.525 NaN C
381 382 1 3 Nakid, Miss. Maria (“Mary”) female 1.0 0 2 2653 15.7417 NaN C
382 383 0 3 Tikkanen, Mr. Juho male 32.0 0 0 STON/O 2. 3101293 7.925 NaN S
383 384 1 1 Holverson, Mrs. Alexander Oskar (Mary Aline Towner) female 35.0 1 0 113789 52.0 NaN S
384 385 0 3 Plotcharsky, Mr. Vasil male NaN 0 0 349227 7.8958 NaN S
385 386 0 2 Davies, Mr. Charles Henry male 18.0 0 0 S.O.C. 14879 73.5 NaN S
386 387 0 3 Goodwin, Master. Sidney Leonard male 1.0 5 2 CA 2144 46.9 NaN S
387 388 1 2 Buss, Miss. Kate female 36.0 0 0 27849 13.0 NaN S
388 389 0 3 Sadlier, Mr. Matthew male NaN 0 0 367655 7.7292 NaN Q
389 390 1 2 Lehmann, Miss. Bertha female 17.0 0 0 SC 1748 12.0 NaN C
390 391 1 1 Carter, Mr. William Ernest male 36.0 1 2 113760 120.0 B96 B98 S
391 392 1 3 Jansson, Mr. Carl Olof male 21.0 0 0 350034 7.7958 NaN S
392 393 0 3 Gustafsson, Mr. Johan Birger male 28.0 2 0 3101277 7.925 NaN S
393 394 1 1 Newell, Miss. Marjorie female 23.0 1 0 35273 113.275 D36 C
394 395 1 3 Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengtsson) female 24.0 0 2 PP 9549 16.7 G6 S
395 396 0 3 Johansson, Mr. Erik male 22.0 0 0 350052 7.7958 NaN S
396 397 0 3 Olsson, Miss. Elina female 31.0 0 0 350407 7.8542 NaN S
397 398 0 2 McKane, Mr. Peter David male 46.0 0 0 28403 26.0 NaN S
398 399 0 2 Pain, Dr. Alfred male 23.0 0 0 244278 10.5 NaN S
399 400 1 2 Trout, Mrs. William H (Jessie L) female 28.0 0 0 240929 12.65 NaN S
400 401 1 3 Niskanen, Mr. Juha male 39.0 0 0 STON/O 2. 3101289 7.925 NaN S
401 402 0 3 Adams, Mr. John male 26.0 0 0 341826 8.05 NaN S
402 403 0 3 Jussila, Miss. Mari Aina female 21.0 1 0 4137 9.825 NaN S
403 404 0 3 Hakkarainen, Mr. Pekka Pietari male 28.0 1 0 STON/O2. 3101279 15.85 NaN S
404 405 0 3 Oreskovic, Miss. Marija female 20.0 0 0 315096 8.6625 NaN S
405 406 0 2 Gale, Mr. Shadrach male 34.0 1 0 28664 21.0 NaN S
406 407 0 3 Widegren, Mr. Carl/Charles Peter male 51.0 0 0 347064 7.75 NaN S
407 408 1 2 Richards, Master. William Rowe male 3.0 1 1 29106 18.75 NaN S
408 409 0 3 Birkeland, Mr. Hans Martin Monsen male 21.0 0 0 312992 7.775 NaN S
409 410 0 3 Lefebre, Miss. Ida female NaN 3 1 4133 25.4667 NaN S
410 411 0 3 Sdycoff, Mr. Todor male NaN 0 0 349222 7.8958 NaN S
411 412 0 3 Hart, Mr. Henry male NaN 0 0 394140 6.8583 NaN Q
412 413 1 1 Minahan, Miss. Daisy E female 33.0 1 0 19928 90.0 C78 Q
413 414 0 2 Cunningham, Mr. Alfred Fleming male NaN 0 0 239853 0.0 NaN S
414 415 1 3 Sundman, Mr. Johan Julian male 44.0 0 0 STON/O 2. 3101269 7.925 NaN S
415 416 0 3 Meek, Mrs. Thomas (Annie Louise Rowley) female NaN 0 0 343095 8.05 NaN S
416 417 1 2 Drew, Mrs. James Vivian (Lulu Thorne Christian) female 34.0 1 1 28220 32.5 NaN S
417 418 1 2 Silven, Miss. Lyyli Karoliina female 18.0 0 2 250652 13.0 NaN S
418 419 0 2 Matthews, Mr. William John male 30.0 0 0 28228 13.0 NaN S
419 420 0 3 Van Impe, Miss. Catharina female 10.0 0 2 345773 24.15 NaN S
420 421 0 3 Gheorgheff, Mr. Stanio male NaN 0 0 349254 7.8958 NaN C
421 422 0 3 Charters, Mr. David male 21.0 0 0 A/5. 13032 7.7333 NaN Q
422 423 0 3 Zimmerman, Mr. Leo male 29.0 0 0 315082 7.875 NaN S
423 424 0 3 Danbom, Mrs. Ernst Gilbert (Anna Sigrid Maria Brogren) female 28.0 1 1 347080 14.4 NaN S
424 425 0 3 Rosblom, Mr. Viktor Richard male 18.0 1 1 370129 20.2125 NaN S
425 426 0 3 Wiseman, Mr. Phillippe male NaN 0 0 A/4. 34244 7.25 NaN S
426 427 1 2 Clarke, Mrs. Charles V (Ada Maria Winfield) female 28.0 1 0 2003 26.0 NaN S
427 428 1 2 Phillips, Miss. Kate Florence (“Mrs Kate Louise Phillips Marshall”) female 19.0 0 0 250655 26.0 NaN S
428 429 0 3 Flynn, Mr. James male NaN 0 0 364851 7.75 NaN Q
429 430 1 3 Pickard, Mr. Berk (Berk Trembisky) male 32.0 0 0 SOTON/O.Q. 392078 8.05 E10 S
430 431 1 1 Bjornstrom-Steffansson, Mr. Mauritz Hakan male 28.0 0 0 110564 26.55 C52 S
431 432 1 3 Thorneycroft, Mrs. Percival (Florence Kate White) female NaN 1 0 376564 16.1 NaN S
432 433 1 2 Louch, Mrs. Charles Alexander (Alice Adelaide Slow) female 42.0 1 0 SC/AH 3085 26.0 NaN S
433 434 0 3 Kallio, Mr. Nikolai Erland male 17.0 0 0 STON/O 2. 3101274 7.125 NaN S
434 435 0 1 Silvey, Mr. William Baird male 50.0 1 0 13507 55.9 E44 S
435 436 1 1 Carter, Miss. Lucile Polk female 14.0 1 2 113760 120.0 B96 B98 S
436 437 0 3 Ford, Miss. Doolina Margaret “Daisy” female 21.0 2 2 W./C. 6608 34.375 NaN S
437 438 1 2 Richards, Mrs. Sidney (Emily Hocking) female 24.0 2 3 29106 18.75 NaN S
438 439 0 1 Fortune, Mr. Mark male 64.0 1 4 19950 263.0 C23 C25 C27 S
439 440 0 2 Kvillner, Mr. Johan Henrik Johannesson male 31.0 0 0 C.A. 18723 10.5 NaN S
440 441 1 2 Hart, Mrs. Benjamin (Esther Ada Bloomfield) female 45.0 1 1 F.C.C. 13529 26.25 NaN S
441 442 0 3 Hampe, Mr. Leon male 20.0 0 0 345769 9.5 NaN S
442 443 0 3 Petterson, Mr. Johan Emil male 25.0 1 0 347076 7.775 NaN S
443 444 1 2 Reynaldo, Ms. Encarnacion female 28.0 0 0 230434 13.0 NaN S
444 445 1 3 Johannesen-Bratthammer, Mr. Bernt male NaN 0 0 65306 8.1125 NaN S
445 446 1 1 Dodge, Master. Washington male 4.0 0 2 33638 81.8583 A34 S
446 447 1 2 Mellinger, Miss. Madeleine Violet female 13.0 0 1 250644 19.5 NaN S
447 448 1 1 Seward, Mr. Frederic Kimber male 34.0 0 0 113794 26.55 NaN S
448 449 1 3 Baclini, Miss. Marie Catherine female 5.0 2 1 2666 19.2583 NaN C
449 450 1 1 Peuchen, Major. Arthur Godfrey male 52.0 0 0 113786 30.5 C104 S
450 451 0 2 West, Mr. Edwy Arthur male 36.0 1 2 C.A. 34651 27.75 NaN S
451 452 0 3 Hagland, Mr. Ingvald Olai Olsen male NaN 1 0 65303 19.9667 NaN S
452 453 0 1 Foreman, Mr. Benjamin Laventall male 30.0 0 0 113051 27.75 C111 C
453 454 1 1 Goldenberg, Mr. Samuel L male 49.0 1 0 17453 89.1042 C92 C
454 455 0 3 Peduzzi, Mr. Joseph male NaN 0 0 A/5 2817 8.05 NaN S
455 456 1 3 Jalsevac, Mr. Ivan male 29.0 0 0 349240 7.8958 NaN C
456 457 0 1 Millet, Mr. Francis Davis male 65.0 0 0 13509 26.55 E38 S
457 458 1 1 Kenyon, Mrs. Frederick R (Marion) female NaN 1 0 17464 51.8625 D21 S
458 459 1 2 Toomey, Miss. Ellen female 50.0 0 0 F.C.C. 13531 10.5 NaN S
459 460 0 3 O’Connor, Mr. Maurice male NaN 0 0 371060 7.75 NaN Q
460 461 1 1 Anderson, Mr. Harry male 48.0 0 0 19952 26.55 E12 S
461 462 0 3 Morley, Mr. William male 34.0 0 0 364506 8.05 NaN S
462 463 0 1 Gee, Mr. Arthur H male 47.0 0 0 111320 38.5 E63 S
463 464 0 2 Milling, Mr. Jacob Christian male 48.0 0 0 234360 13.0 NaN S
464 465 0 3 Maisner, Mr. Simon male NaN 0 0 A/S 2816 8.05 NaN S
465 466 0 3 Goncalves, Mr. Manuel Estanslas male 38.0 0 0 SOTON/O.Q. 3101306 7.05 NaN S
466 467 0 2 Campbell, Mr. William male NaN 0 0 239853 0.0 NaN S
467 468 0 1 Smart, Mr. John Montgomery male 56.0 0 0 113792 26.55 NaN S
468 469 0 3 Scanlan, Mr. James male NaN 0 0 36209 7.725 NaN Q
469 470 1 3 Baclini, Miss. Helene Barbara female 0.75 2 1 2666 19.2583 NaN C
470 471 0 3 Keefe, Mr. Arthur male NaN 0 0 323592 7.25 NaN S
471 472 0 3 Cacic, Mr. Luka male 38.0 0 0 315089 8.6625 NaN S
472 473 1 2 West, Mrs. Edwy Arthur (Ada Mary Worth) female 33.0 1 2 C.A. 34651 27.75 NaN S
473 474 1 2 Jerwan, Mrs. Amin S (Marie Marthe Thuillard) female 23.0 0 0 SC/AH Basle 541 13.7917 D C
474 475 0 3 Strandberg, Miss. Ida Sofia female 22.0 0 0 7553 9.8375 NaN S
475 476 0 1 Clifford, Mr. George Quincy male NaN 0 0 110465 52.0 A14 S
476 477 0 2 Renouf, Mr. Peter Henry male 34.0 1 0 31027 21.0 NaN S
477 478 0 3 Braund, Mr. Lewis Richard male 29.0 1 0 3460 7.0458 NaN S
478 479 0 3 Karlsson, Mr. Nils August male 22.0 0 0 350060 7.5208 NaN S
479 480 1 3 Hirvonen, Miss. Hildur E female 2.0 0 1 3101298 12.2875 NaN S
480 481 0 3 Goodwin, Master. Harold Victor male 9.0 5 2 CA 2144 46.9 NaN S
481 482 0 2 Frost, Mr. Anthony Wood “Archie” male NaN 0 0 239854 0.0 NaN S
482 483 0 3 Rouse, Mr. Richard Henry male 50.0 0 0 A/5 3594 8.05 NaN S
483 484 1 3 Turkula, Mrs. (Hedwig) female 63.0 0 0 4134 9.5875 NaN S
484 485 1 1 Bishop, Mr. Dickinson H male 25.0 1 0 11967 91.0792 B49 C
485 486 0 3 Lefebre, Miss. Jeannie female NaN 3 1 4133 25.4667 NaN S
486 487 1 1 Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby) female 35.0 1 0 19943 90.0 C93 S
487 488 0 1 Kent, Mr. Edward Austin male 58.0 0 0 11771 29.7 B37 C
488 489 0 3 Somerton, Mr. Francis William male 30.0 0 0 A.5. 18509 8.05 NaN S
489 490 1 3 Coutts, Master. Eden Leslie “Neville” male 9.0 1 1 C.A. 37671 15.9 NaN S
490 491 0 3 Hagland, Mr. Konrad Mathias Reiersen male NaN 1 0 65304 19.9667 NaN S
491 492 0 3 Windelov, Mr. Einar male 21.0 0 0 SOTON/OQ 3101317 7.25 NaN S
492 493 0 1 Molson, Mr. Harry Markland male 55.0 0 0 113787 30.5 C30 S
493 494 0 1 Artagaveytia, Mr. Ramon male 71.0 0 0 PC 17609 49.5042 NaN C
494 495 0 3 Stanley, Mr. Edward Roland male 21.0 0 0 A/4 45380 8.05 NaN S
495 496 0 3 Yousseff, Mr. Gerious male NaN 0 0 2627 14.4583 NaN C
496 497 1 1 Eustis, Miss. Elizabeth Mussey female 54.0 1 0 36947 78.2667 D20 C
497 498 0 3 Shellard, Mr. Frederick William male NaN 0 0 C.A. 6212 15.1 NaN S
498 499 0 1 Allison, Mrs. Hudson J C (Bessie Waldo Daniels) female 25.0 1 2 113781 151.55 C22 C26 S
499 500 0 3 Svensson, Mr. Olof male 24.0 0 0 350035 7.7958 NaN S
500 501 0 3 Calic, Mr. Petar male 17.0 0 0 315086 8.6625 NaN S
501 502 0 3 Canavan, Miss. Mary female 21.0 0 0 364846 7.75 NaN Q
502 503 0 3 O’Sullivan, Miss. Bridget Mary female NaN 0 0 330909 7.6292 NaN Q
503 504 0 3 Laitinen, Miss. Kristina Sofia female 37.0 0 0 4135 9.5875 NaN S
504 505 1 1 Maioni, Miss. Roberta female 16.0 0 0 110152 86.5 B79 S
505 506 0 1 Penasco y Castellana, Mr. Victor de Satode male 18.0 1 0 PC 17758 108.9 C65 C
506 507 1 2 Quick, Mrs. Frederick Charles (Jane Richards) female 33.0 0 2 26360 26.0 NaN S
507 508 1 1 Bradley, Mr. George (“George Arthur Brayton”) male NaN 0 0 111427 26.55 NaN S
508 509 0 3 Olsen, Mr. Henry Margido male 28.0 0 0 C 4001 22.525 NaN S
509 510 1 3 Lang, Mr. Fang male 26.0 0 0 1601 56.4958 NaN S
510 511 1 3 Daly, Mr. Eugene Patrick male 29.0 0 0 382651 7.75 NaN Q
511 512 0 3 Webber, Mr. James male NaN 0 0 SOTON/OQ 3101316 8.05 NaN S
512 513 1 1 McGough, Mr. James Robert male 36.0 0 0 PC 17473 26.2875 E25 S
513 514 1 1 Rothschild, Mrs. Martin (Elizabeth L. Barrett) female 54.0 1 0 PC 17603 59.4 NaN C
514 515 0 3 Coleff, Mr. Satio male 24.0 0 0 349209 7.4958 NaN S
515 516 0 1 Walker, Mr. William Anderson male 47.0 0 0 36967 34.0208 D46 S
516 517 1 2 Lemore, Mrs. (Amelia Milley) female 34.0 0 0 C.A. 34260 10.5 F33 S
517 518 0 3 Ryan, Mr. Patrick male NaN 0 0 371110 24.15 NaN Q
518 519 1 2 Angle, Mrs. William A (Florence “Mary” Agnes Hughes) female 36.0 1 0 226875 26.0 NaN S
519 520 0 3 Pavlovic, Mr. Stefo male 32.0 0 0 349242 7.8958 NaN S
520 521 1 1 Perreault, Miss. Anne female 30.0 0 0 12749 93.5 B73 S
521 522 0 3 Vovk, Mr. Janko male 22.0 0 0 349252 7.8958 NaN S
522 523 0 3 Lahoud, Mr. Sarkis male NaN 0 0 2624 7.225 NaN C
523 524 1 1 Hippach, Mrs. Louis Albert (Ida Sophia Fischer) female 44.0 0 1 111361 57.9792 B18 C
524 525 0 3 Kassem, Mr. Fared male NaN 0 0 2700 7.2292 NaN C
525 526 0 3 Farrell, Mr. James male 40.5 0 0 367232 7.75 NaN Q
526 527 1 2 Ridsdale, Miss. Lucy female 50.0 0 0 W./C. 14258 10.5 NaN S
527 528 0 1 Farthing, Mr. John male NaN 0 0 PC 17483 221.7792 C95 S
528 529 0 3 Salonen, Mr. Johan Werner male 39.0 0 0 3101296 7.925 NaN S
529 530 0 2 Hocking, Mr. Richard George male 23.0 2 1 29104 11.5 NaN S
530 531 1 2 Quick, Miss. Phyllis May female 2.0 1 1 26360 26.0 NaN S
531 532 0 3 Toufik, Mr. Nakli male NaN 0 0 2641 7.2292 NaN C
532 533 0 3 Elias, Mr. Joseph Jr male 17.0 1 1 2690 7.2292 NaN C
533 534 1 3 Peter, Mrs. Catherine (Catherine Rizk) female NaN 0 2 2668 22.3583 NaN C
534 535 0 3 Cacic, Miss. Marija female 30.0 0 0 315084 8.6625 NaN S
535 536 1 2 Hart, Miss. Eva Miriam female 7.0 0 2 F.C.C. 13529 26.25 NaN S
536 537 0 1 Butt, Major. Archibald Willingham male 45.0 0 0 113050 26.55 B38 S
537 538 1 1 LeRoy, Miss. Bertha female 30.0 0 0 PC 17761 106.425 NaN C
538 539 0 3 Risien, Mr. Samuel Beard male NaN 0 0 364498 14.5 NaN S
539 540 1 1 Frolicher, Miss. Hedwig Margaritha female 22.0 0 2 13568 49.5 B39 C
540 541 1 1 Crosby, Miss. Harriet R female 36.0 0 2 WE/P 5735 71.0 B22 S
541 542 0 3 Andersson, Miss. Ingeborg Constanzia female 9.0 4 2 347082 31.275 NaN S
542 543 0 3 Andersson, Miss. Sigrid Elisabeth female 11.0 4 2 347082 31.275 NaN S
543 544 1 2 Beane, Mr. Edward male 32.0 1 0 2908 26.0 NaN S
544 545 0 1 Douglas, Mr. Walter Donald male 50.0 1 0 PC 17761 106.425 C86 C
545 546 0 1 Nicholson, Mr. Arthur Ernest male 64.0 0 0 693 26.0 NaN S
546 547 1 2 Beane, Mrs. Edward (Ethel Clarke) female 19.0 1 0 2908 26.0 NaN S
547 548 1 2 Padro y Manent, Mr. Julian male NaN 0 0 SC/PARIS 2146 13.8625 NaN C
548 549 0 3 Goldsmith, Mr. Frank John male 33.0 1 1 363291 20.525 NaN S
549 550 1 2 Davies, Master. John Morgan Jr male 8.0 1 1 C.A. 33112 36.75 NaN S
550 551 1 1 Thayer, Mr. John Borland Jr male 17.0 0 2 17421 110.8833 C70 C
551 552 0 2 Sharp, Mr. Percival James R male 27.0 0 0 244358 26.0 NaN S
552 553 0 3 O’Brien, Mr. Timothy male NaN 0 0 330979 7.8292 NaN Q
553 554 1 3 Leeni, Mr. Fahim (“Philip Zenni”) male 22.0 0 0 2620 7.225 NaN C
554 555 1 3 Ohman, Miss. Velin female 22.0 0 0 347085 7.775 NaN S
555 556 0 1 Wright, Mr. George male 62.0 0 0 113807 26.55 NaN S
556 557 1 1 Duff Gordon, Lady. (Lucille Christiana Sutherland) (“Mrs Morgan”) female 48.0 1 0 11755 39.6 A16 C
557 558 0 1 Robbins, Mr. Victor male NaN 0 0 PC 17757 227.525 NaN C
558 559 1 1 Taussig, Mrs. Emil (Tillie Mandelbaum) female 39.0 1 1 110413 79.65 E67 S
559 560 1 3 de Messemaeker, Mrs. Guillaume Joseph (Emma) female 36.0 1 0 345572 17.4 NaN S
560 561 0 3 Morrow, Mr. Thomas Rowan male NaN 0 0 372622 7.75 NaN Q
561 562 0 3 Sivic, Mr. Husein male 40.0 0 0 349251 7.8958 NaN S
562 563 0 2 Norman, Mr. Robert Douglas male 28.0 0 0 218629 13.5 NaN S
563 564 0 3 Simmons, Mr. John male NaN 0 0 SOTON/OQ 392082 8.05 NaN S
564 565 0 3 Meanwell, Miss. (Marion Ogden) female NaN 0 0 SOTON/O.Q. 392087 8.05 NaN S
565 566 0 3 Davies, Mr. Alfred J male 24.0 2 0 A/4 48871 24.15 NaN S
566 567 0 3 Stoytcheff, Mr. Ilia male 19.0 0 0 349205 7.8958 NaN S
567 568 0 3 Palsson, Mrs. Nils (Alma Cornelia Berglund) female 29.0 0 4 349909 21.075 NaN S
568 569 0 3 Doharr, Mr. Tannous male NaN 0 0 2686 7.2292 NaN C
569 570 1 3 Jonsson, Mr. Carl male 32.0 0 0 350417 7.8542 NaN S
570 571 1 2 Harris, Mr. George male 62.0 0 0 S.W./PP 752 10.5 NaN S
571 572 1 1 Appleton, Mrs. Edward Dale (Charlotte Lamson) female 53.0 2 0 11769 51.4792 C101 S
572 573 1 1 Flynn, Mr. John Irwin (“Irving”) male 36.0 0 0 PC 17474 26.3875 E25 S
573 574 1 3 Kelly, Miss. Mary female NaN 0 0 14312 7.75 NaN Q
574 575 0 3 Rush, Mr. Alfred George John male 16.0 0 0 A/4. 20589 8.05 NaN S
575 576 0 3 Patchett, Mr. George male 19.0 0 0 358585 14.5 NaN S
576 577 1 2 Garside, Miss. Ethel female 34.0 0 0 243880 13.0 NaN S
577 578 1 1 Silvey, Mrs. William Baird (Alice Munger) female 39.0 1 0 13507 55.9 E44 S
578 579 0 3 Caram, Mrs. Joseph (Maria Elias) female NaN 1 0 2689 14.4583 NaN C
579 580 1 3 Jussila, Mr. Eiriik male 32.0 0 0 STON/O 2. 3101286 7.925 NaN S
580 581 1 2 Christy, Miss. Julie Rachel female 25.0 1 1 237789 30.0 NaN S
581 582 1 1 Thayer, Mrs. John Borland (Marian Longstreth Morris) female 39.0 1 1 17421 110.8833 C68 C
582 583 0 2 Downton, Mr. William James male 54.0 0 0 28403 26.0 NaN S
583 584 0 1 Ross, Mr. John Hugo male 36.0 0 0 13049 40.125 A10 C
584 585 0 3 Paulner, Mr. Uscher male NaN 0 0 3411 8.7125 NaN C
585 586 1 1 Taussig, Miss. Ruth female 18.0 0 2 110413 79.65 E68 S
586 587 0 2 Jarvis, Mr. John Denzil male 47.0 0 0 237565 15.0 NaN S
587 588 1 1 Frolicher-Stehli, Mr. Maxmillian male 60.0 1 1 13567 79.2 B41 C
588 589 0 3 Gilinski, Mr. Eliezer male 22.0 0 0 14973 8.05 NaN S
589 590 0 3 Murdlin, Mr. Joseph male NaN 0 0 A./5. 3235 8.05 NaN S
590 591 0 3 Rintamaki, Mr. Matti male 35.0 0 0 STON/O 2. 3101273 7.125 NaN S
591 592 1 1 Stephenson, Mrs. Walter Bertram (Martha Eustis) female 52.0 1 0 36947 78.2667 D20 C
592 593 0 3 Elsbury, Mr. William James male 47.0 0 0 A/5 3902 7.25 NaN S
593 594 0 3 Bourke, Miss. Mary female NaN 0 2 364848 7.75 NaN Q
594 595 0 2 Chapman, Mr. John Henry male 37.0 1 0 SC/AH 29037 26.0 NaN S
595 596 0 3 Van Impe, Mr. Jean Baptiste male 36.0 1 1 345773 24.15 NaN S
596 597 1 2 Leitch, Miss. Jessie Wills female NaN 0 0 248727 33.0 NaN S
597 598 0 3 Johnson, Mr. Alfred male 49.0 0 0 LINE 0.0 NaN S
598 599 0 3 Boulos, Mr. Hanna male NaN 0 0 2664 7.225 NaN C
599 600 1 1 Duff Gordon, Sir. Cosmo Edmund (“Mr Morgan”) male 49.0 1 0 PC 17485 56.9292 A20 C
600 601 1 2 Jacobsohn, Mrs. Sidney Samuel (Amy Frances Christy) female 24.0 2 1 243847 27.0 NaN S
601 602 0 3 Slabenoff, Mr. Petco male NaN 0 0 349214 7.8958 NaN S
602 603 0 1 Harrington, Mr. Charles H male NaN 0 0 113796 42.4 NaN S
603 604 0 3 Torber, Mr. Ernst William male 44.0 0 0 364511 8.05 NaN S
604 605 1 1 Homer, Mr. Harry (“Mr E Haven”) male 35.0 0 0 111426 26.55 NaN C
605 606 0 3 Lindell, Mr. Edvard Bengtsson male 36.0 1 0 349910 15.55 NaN S
606 607 0 3 Karaic, Mr. Milan male 30.0 0 0 349246 7.8958 NaN S
607 608 1 1 Daniel, Mr. Robert Williams male 27.0 0 0 113804 30.5 NaN S
608 609 1 2 Laroche, Mrs. Joseph (Juliette Marie Louise Lafargue) female 22.0 1 2 SC/Paris 2123 41.5792 NaN C
609 610 1 1 Shutes, Miss. Elizabeth W female 40.0 0 0 PC 17582 153.4625 C125 S
610 611 0 3 Andersson, Mrs. Anders Johan (Alfrida Konstantia Brogren) female 39.0 1 5 347082 31.275 NaN S
611 612 0 3 Jardin, Mr. Jose Neto male NaN 0 0 SOTON/O.Q. 3101305 7.05 NaN S
612 613 1 3 Murphy, Miss. Margaret Jane female NaN 1 0 367230 15.5 NaN Q
613 614 0 3 Horgan, Mr. John male NaN 0 0 370377 7.75 NaN Q
614 615 0 3 Brocklebank, Mr. William Alfred male 35.0 0 0 364512 8.05 NaN S
615 616 1 2 Herman, Miss. Alice female 24.0 1 2 220845 65.0 NaN S
616 617 0 3 Danbom, Mr. Ernst Gilbert male 34.0 1 1 347080 14.4 NaN S
617 618 0 3 Lobb, Mrs. William Arthur (Cordelia K Stanlick) female 26.0 1 0 A/5. 3336 16.1 NaN S
618 619 1 2 Becker, Miss. Marion Louise female 4.0 2 1 230136 39.0 F4 S
619 620 0 2 Gavey, Mr. Lawrence male 26.0 0 0 31028 10.5 NaN S
620 621 0 3 Yasbeck, Mr. Antoni male 27.0 1 0 2659 14.4542 NaN C
621 622 1 1 Kimball, Mr. Edwin Nelson Jr male 42.0 1 0 11753 52.5542 D19 S
622 623 1 3 Nakid, Mr. Sahid male 20.0 1 1 2653 15.7417 NaN C
623 624 0 3 Hansen, Mr. Henry Damsgaard male 21.0 0 0 350029 7.8542 NaN S
624 625 0 3 Bowen, Mr. David John “Dai” male 21.0 0 0 54636 16.1 NaN S
625 626 0 1 Sutton, Mr. Frederick male 61.0 0 0 36963 32.3208 D50 S
626 627 0 2 Kirkland, Rev. Charles Leonard male 57.0 0 0 219533 12.35 NaN Q
627 628 1 1 Longley, Miss. Gretchen Fiske female 21.0 0 0 13502 77.9583 D9 S
628 629 0 3 Bostandyeff, Mr. Guentcho male 26.0 0 0 349224 7.8958 NaN S
629 630 0 3 O’Connell, Mr. Patrick D male NaN 0 0 334912 7.7333 NaN Q
630 631 1 1 Barkworth, Mr. Algernon Henry Wilson male 80.0 0 0 27042 30.0 A23 S
631 632 0 3 Lundahl, Mr. Johan Svensson male 51.0 0 0 347743 7.0542 NaN S
632 633 1 1 Stahelin-Maeglin, Dr. Max male 32.0 0 0 13214 30.5 B50 C
633 634 0 1 Parr, Mr. William Henry Marsh male NaN 0 0 112052 0.0 NaN S
634 635 0 3 Skoog, Miss. Mabel female 9.0 3 2 347088 27.9 NaN S
635 636 1 2 Davis, Miss. Mary female 28.0 0 0 237668 13.0 NaN S
636 637 0 3 Leinonen, Mr. Antti Gustaf male 32.0 0 0 STON/O 2. 3101292 7.925 NaN S
637 638 0 2 Collyer, Mr. Harvey male 31.0 1 1 C.A. 31921 26.25 NaN S
638 639 0 3 Panula, Mrs. Juha (Maria Emilia Ojala) female 41.0 0 5 3101295 39.6875 NaN S
639 640 0 3 Thorneycroft, Mr. Percival male NaN 1 0 376564 16.1 NaN S
640 641 0 3 Jensen, Mr. Hans Peder male 20.0 0 0 350050 7.8542 NaN S
641 642 1 1 Sagesser, Mlle. Emma female 24.0 0 0 PC 17477 69.3 B35 C
642 643 0 3 Skoog, Miss. Margit Elizabeth female 2.0 3 2 347088 27.9 NaN S
643 644 1 3 Foo, Mr. Choong male NaN 0 0 1601 56.4958 NaN S
644 645 1 3 Baclini, Miss. Eugenie female 0.75 2 1 2666 19.2583 NaN C
645 646 1 1 Harper, Mr. Henry Sleeper male 48.0 1 0 PC 17572 76.7292 D33 C
646 647 0 3 Cor, Mr. Liudevit male 19.0 0 0 349231 7.8958 NaN S
647 648 1 1 Simonius-Blumer, Col. Oberst Alfons male 56.0 0 0 13213 35.5 A26 C
648 649 0 3 Willey, Mr. Edward male NaN 0 0 S.O./P.P. 751 7.55 NaN S
649 650 1 3 Stanley, Miss. Amy Zillah Elsie female 23.0 0 0 CA. 2314 7.55 NaN S
650 651 0 3 Mitkoff, Mr. Mito male NaN 0 0 349221 7.8958 NaN S
651 652 1 2 Doling, Miss. Elsie female 18.0 0 1 231919 23.0 NaN S
652 653 0 3 Kalvik, Mr. Johannes Halvorsen male 21.0 0 0 8475 8.4333 NaN S
653 654 1 3 O’Leary, Miss. Hanora “Norah” female NaN 0 0 330919 7.8292 NaN Q
654 655 0 3 Hegarty, Miss. Hanora “Nora” female 18.0 0 0 365226 6.75 NaN Q
655 656 0 2 Hickman, Mr. Leonard Mark male 24.0 2 0 S.O.C. 14879 73.5 NaN S
656 657 0 3 Radeff, Mr. Alexander male NaN 0 0 349223 7.8958 NaN S
657 658 0 3 Bourke, Mrs. John (Catherine) female 32.0 1 1 364849 15.5 NaN Q
658 659 0 2 Eitemiller, Mr. George Floyd male 23.0 0 0 29751 13.0 NaN S
659 660 0 1 Newell, Mr. Arthur Webster male 58.0 0 2 35273 113.275 D48 C
660 661 1 1 Frauenthal, Dr. Henry William male 50.0 2 0 PC 17611 133.65 NaN S
661 662 0 3 Badt, Mr. Mohamed male 40.0 0 0 2623 7.225 NaN C
662 663 0 1 Colley, Mr. Edward Pomeroy male 47.0 0 0 5727 25.5875 E58 S
663 664 0 3 Coleff, Mr. Peju male 36.0 0 0 349210 7.4958 NaN S
664 665 1 3 Lindqvist, Mr. Eino William male 20.0 1 0 STON/O 2. 3101285 7.925 NaN S
665 666 0 2 Hickman, Mr. Lewis male 32.0 2 0 S.O.C. 14879 73.5 NaN S
666 667 0 2 Butler, Mr. Reginald Fenton male 25.0 0 0 234686 13.0 NaN S
667 668 0 3 Rommetvedt, Mr. Knud Paust male NaN 0 0 312993 7.775 NaN S
668 669 0 3 Cook, Mr. Jacob male 43.0 0 0 A/5 3536 8.05 NaN S
669 670 1 1 Taylor, Mrs. Elmer Zebley (Juliet Cummins Wright) female NaN 1 0 19996 52.0 C126 S
670 671 1 2 Brown, Mrs. Thomas William Solomon (Elizabeth Catherine Ford) female 40.0 1 1 29750 39.0 NaN S
671 672 0 1 Davidson, Mr. Thornton male 31.0 1 0 F.C. 12750 52.0 B71 S
672 673 0 2 Mitchell, Mr. Henry Michael male 70.0 0 0 C.A. 24580 10.5 NaN S
673 674 1 2 Wilhelms, Mr. Charles male 31.0 0 0 244270 13.0 NaN S
674 675 0 2 Watson, Mr. Ennis Hastings male NaN 0 0 239856 0.0 NaN S
675 676 0 3 Edvardsson, Mr. Gustaf Hjalmar male 18.0 0 0 349912 7.775 NaN S
676 677 0 3 Sawyer, Mr. Frederick Charles male 24.5 0 0 342826 8.05 NaN S
677 678 1 3 Turja, Miss. Anna Sofia female 18.0 0 0 4138 9.8417 NaN S
678 679 0 3 Goodwin, Mrs. Frederick (Augusta Tyler) female 43.0 1 6 CA 2144 46.9 NaN S
679 680 1 1 Cardeza, Mr. Thomas Drake Martinez male 36.0 0 1 PC 17755 512.3292 B51 B53 B55 C
680 681 0 3 Peters, Miss. Katie female NaN 0 0 330935 8.1375 NaN Q
681 682 1 1 Hassab, Mr. Hammad male 27.0 0 0 PC 17572 76.7292 D49 C
682 683 0 3 Olsvigen, Mr. Thor Anderson male 20.0 0 0 6563 9.225 NaN S
683 684 0 3 Goodwin, Mr. Charles Edward male 14.0 5 2 CA 2144 46.9 NaN S
684 685 0 2 Brown, Mr. Thomas William Solomon male 60.0 1 1 29750 39.0 NaN S
685 686 0 2 Laroche, Mr. Joseph Philippe Lemercier male 25.0 1 2 SC/Paris 2123 41.5792 NaN C
686 687 0 3 Panula, Mr. Jaako Arnold male 14.0 4 1 3101295 39.6875 NaN S
687 688 0 3 Dakic, Mr. Branko male 19.0 0 0 349228 10.1708 NaN S
688 689 0 3 Fischer, Mr. Eberhard Thelander male 18.0 0 0 350036 7.7958 NaN S
689 690 1 1 Madill, Miss. Georgette Alexandra female 15.0 0 1 24160 211.3375 B5 S
690 691 1 1 Dick, Mr. Albert Adrian male 31.0 1 0 17474 57.0 B20 S
691 692 1 3 Karun, Miss. Manca female 4.0 0 1 349256 13.4167 NaN C
692 693 1 3 Lam, Mr. Ali male NaN 0 0 1601 56.4958 NaN S
693 694 0 3 Saad, Mr. Khalil male 25.0 0 0 2672 7.225 NaN C
694 695 0 1 Weir, Col. John male 60.0 0 0 113800 26.55 NaN S
695 696 0 2 Chapman, Mr. Charles Henry male 52.0 0 0 248731 13.5 NaN S
696 697 0 3 Kelly, Mr. James male 44.0 0 0 363592 8.05 NaN S
697 698 1 3 Mullens, Miss. Katherine “Katie” female NaN 0 0 35852 7.7333 NaN Q
698 699 0 1 Thayer, Mr. John Borland male 49.0 1 1 17421 110.8833 C68 C
699 700 0 3 Humblen, Mr. Adolf Mathias Nicolai Olsen male 42.0 0 0 348121 7.65 F G63 S
700 701 1 1 Astor, Mrs. John Jacob (Madeleine Talmadge Force) female 18.0 1 0 PC 17757 227.525 C62 C64 C
701 702 1 1 Silverthorne, Mr. Spencer Victor male 35.0 0 0 PC 17475 26.2875 E24 S
702 703 0 3 Barbara, Miss. Saiide female 18.0 0 1 2691 14.4542 NaN C
703 704 0 3 Gallagher, Mr. Martin male 25.0 0 0 36864 7.7417 NaN Q
704 705 0 3 Hansen, Mr. Henrik Juul male 26.0 1 0 350025 7.8542 NaN S
705 706 0 2 Morley, Mr. Henry Samuel (“Mr Henry Marshall”) male 39.0 0 0 250655 26.0 NaN S
706 707 1 2 Kelly, Mrs. Florence “Fannie” female 45.0 0 0 223596 13.5 NaN S
707 708 1 1 Calderhead, Mr. Edward Pennington male 42.0 0 0 PC 17476 26.2875 E24 S
708 709 1 1 Cleaver, Miss. Alice female 22.0 0 0 113781 151.55 NaN S
709 710 1 3 Moubarek, Master. Halim Gonios (“William George”) male NaN 1 1 2661 15.2458 NaN C
710 711 1 1 Mayne, Mlle. Berthe Antonine (“Mrs de Villiers”) female 24.0 0 0 PC 17482 49.5042 C90 C
711 712 0 1 Klaber, Mr. Herman male NaN 0 0 113028 26.55 C124 S
712 713 1 1 Taylor, Mr. Elmer Zebley male 48.0 1 0 19996 52.0 C126 S
713 714 0 3 Larsson, Mr. August Viktor male 29.0 0 0 7545 9.4833 NaN S
714 715 0 2 Greenberg, Mr. Samuel male 52.0 0 0 250647 13.0 NaN S
715 716 0 3 Soholt, Mr. Peter Andreas Lauritz Andersen male 19.0 0 0 348124 7.65 F G73 S
716 717 1 1 Endres, Miss. Caroline Louise female 38.0 0 0 PC 17757 227.525 C45 C
717 718 1 2 Troutt, Miss. Edwina Celia “Winnie” female 27.0 0 0 34218 10.5 E101 S
718 719 0 3 McEvoy, Mr. Michael male NaN 0 0 36568 15.5 NaN Q
719 720 0 3 Johnson, Mr. Malkolm Joackim male 33.0 0 0 347062 7.775 NaN S
720 721 1 2 Harper, Miss. Annie Jessie “Nina” female 6.0 0 1 248727 33.0 NaN S
721 722 0 3 Jensen, Mr. Svend Lauritz male 17.0 1 0 350048 7.0542 NaN S
722 723 0 2 Gillespie, Mr. William Henry male 34.0 0 0 12233 13.0 NaN S
723 724 0 2 Hodges, Mr. Henry Price male 50.0 0 0 250643 13.0 NaN S
724 725 1 1 Chambers, Mr. Norman Campbell male 27.0 1 0 113806 53.1 E8 S
725 726 0 3 Oreskovic, Mr. Luka male 20.0 0 0 315094 8.6625 NaN S
726 727 1 2 Renouf, Mrs. Peter Henry (Lillian Jefferys) female 30.0 3 0 31027 21.0 NaN S
727 728 1 3 Mannion, Miss. Margareth female NaN 0 0 36866 7.7375 NaN Q
728 729 0 2 Bryhl, Mr. Kurt Arnold Gottfrid male 25.0 1 0 236853 26.0 NaN S
729 730 0 3 Ilmakangas, Miss. Pieta Sofia female 25.0 1 0 STON/O2. 3101271 7.925 NaN S
730 731 1 1 Allen, Miss. Elisabeth Walton female 29.0 0 0 24160 211.3375 B5 S
731 732 0 3 Hassan, Mr. Houssein G N male 11.0 0 0 2699 18.7875 NaN C
732 733 0 2 Knight, Mr. Robert J male NaN 0 0 239855 0.0 NaN S
733 734 0 2 Berriman, Mr. William John male 23.0 0 0 28425 13.0 NaN S
734 735 0 2 Troupiansky, Mr. Moses Aaron male 23.0 0 0 233639 13.0 NaN S
735 736 0 3 Williams, Mr. Leslie male 28.5 0 0 54636 16.1 NaN S
736 737 0 3 Ford, Mrs. Edward (Margaret Ann Watson) female 48.0 1 3 W./C. 6608 34.375 NaN S
737 738 1 1 Lesurer, Mr. Gustave J male 35.0 0 0 PC 17755 512.3292 B101 C
738 739 0 3 Ivanoff, Mr. Kanio male NaN 0 0 349201 7.8958 NaN S
739 740 0 3 Nankoff, Mr. Minko male NaN 0 0 349218 7.8958 NaN S
740 741 1 1 Hawksford, Mr. Walter James male NaN 0 0 16988 30.0 D45 S
741 742 0 1 Cavendish, Mr. Tyrell William male 36.0 1 0 19877 78.85 C46 S
742 743 1 1 Ryerson, Miss. Susan Parker “Suzette” female 21.0 2 2 PC 17608 262.375 B57 B59 B63 B66 C
743 744 0 3 McNamee, Mr. Neal male 24.0 1 0 376566 16.1 NaN S
744 745 1 3 Stranden, Mr. Juho male 31.0 0 0 STON/O 2. 3101288 7.925 NaN S
745 746 0 1 Crosby, Capt. Edward Gifford male 70.0 1 1 WE/P 5735 71.0 B22 S
746 747 0 3 Abbott, Mr. Rossmore Edward male 16.0 1 1 C.A. 2673 20.25 NaN S
747 748 1 2 Sinkkonen, Miss. Anna female 30.0 0 0 250648 13.0 NaN S
748 749 0 1 Marvin, Mr. Daniel Warner male 19.0 1 0 113773 53.1 D30 S
749 750 0 3 Connaghton, Mr. Michael male 31.0 0 0 335097 7.75 NaN Q
750 751 1 2 Wells, Miss. Joan female 4.0 1 1 29103 23.0 NaN S
751 752 1 3 Moor, Master. Meier male 6.0 0 1 392096 12.475 E121 S
752 753 0 3 Vande Velde, Mr. Johannes Joseph male 33.0 0 0 345780 9.5 NaN S
753 754 0 3 Jonkoff, Mr. Lalio male 23.0 0 0 349204 7.8958 NaN S
754 755 1 2 Herman, Mrs. Samuel (Jane Laver) female 48.0 1 2 220845 65.0 NaN S
755 756 1 2 Hamalainen, Master. Viljo male 0.67 1 1 250649 14.5 NaN S
756 757 0 3 Carlsson, Mr. August Sigfrid male 28.0 0 0 350042 7.7958 NaN S
757 758 0 2 Bailey, Mr. Percy Andrew male 18.0 0 0 29108 11.5 NaN S
758 759 0 3 Theobald, Mr. Thomas Leonard male 34.0 0 0 363294 8.05 NaN S
759 760 1 1 Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards) female 33.0 0 0 110152 86.5 B77 S
760 761 0 3 Garfirth, Mr. John male NaN 0 0 358585 14.5 NaN S
761 762 0 3 Nirva, Mr. Iisakki Antino Aijo male 41.0 0 0 SOTON/O2 3101272 7.125 NaN S
762 763 1 3 Barah, Mr. Hanna Assi male 20.0 0 0 2663 7.2292 NaN C
763 764 1 1 Carter, Mrs. William Ernest (Lucile Polk) female 36.0 1 2 113760 120.0 B96 B98 S
764 765 0 3 Eklund, Mr. Hans Linus male 16.0 0 0 347074 7.775 NaN S
765 766 1 1 Hogeboom, Mrs. John C (Anna Andrews) female 51.0 1 0 13502 77.9583 D11 S
766 767 0 1 Brewe, Dr. Arthur Jackson male NaN 0 0 112379 39.6 NaN C
767 768 0 3 Mangan, Miss. Mary female 30.5 0 0 364850 7.75 NaN Q
768 769 0 3 Moran, Mr. Daniel J male NaN 1 0 371110 24.15 NaN Q
769 770 0 3 Gronnestad, Mr. Daniel Danielsen male 32.0 0 0 8471 8.3625 NaN S
770 771 0 3 Lievens, Mr. Rene Aime male 24.0 0 0 345781 9.5 NaN S
771 772 0 3 Jensen, Mr. Niels Peder male 48.0 0 0 350047 7.8542 NaN S
772 773 0 2 Mack, Mrs. (Mary) female 57.0 0 0 S.O./P.P. 3 10.5 E77 S
773 774 0 3 Elias, Mr. Dibo male NaN 0 0 2674 7.225 NaN C
774 775 1 2 Hocking, Mrs. Elizabeth (Eliza Needs) female 54.0 1 3 29105 23.0 NaN S
775 776 0 3 Myhrman, Mr. Pehr Fabian Oliver Malkolm male 18.0 0 0 347078 7.75 NaN S
776 777 0 3 Tobin, Mr. Roger male NaN 0 0 383121 7.75 F38 Q
777 778 1 3 Emanuel, Miss. Virginia Ethel female 5.0 0 0 364516 12.475 NaN S
778 779 0 3 Kilgannon, Mr. Thomas J male NaN 0 0 36865 7.7375 NaN Q
779 780 1 1 Robert, Mrs. Edward Scott (Elisabeth Walton McMillan) female 43.0 0 1 24160 211.3375 B3 S
780 781 1 3 Ayoub, Miss. Banoura female 13.0 0 0 2687 7.2292 NaN C
781 782 1 1 Dick, Mrs. Albert Adrian (Vera Gillespie) female 17.0 1 0 17474 57.0 B20 S
782 783 0 1 Long, Mr. Milton Clyde male 29.0 0 0 113501 30.0 D6 S
783 784 0 3 Johnston, Mr. Andrew G male NaN 1 2 W./C. 6607 23.45 NaN S
784 785 0 3 Ali, Mr. William male 25.0 0 0 SOTON/O.Q. 3101312 7.05 NaN S
785 786 0 3 Harmer, Mr. Abraham (David Lishin) male 25.0 0 0 374887 7.25 NaN S
786 787 1 3 Sjoblom, Miss. Anna Sofia female 18.0 0 0 3101265 7.4958 NaN S
787 788 0 3 Rice, Master. George Hugh male 8.0 4 1 382652 29.125 NaN Q
788 789 1 3 Dean, Master. Bertram Vere male 1.0 1 2 C.A. 2315 20.575 NaN S
789 790 0 1 Guggenheim, Mr. Benjamin male 46.0 0 0 PC 17593 79.2 B82 B84 C
790 791 0 3 Keane, Mr. Andrew “Andy” male NaN 0 0 12460 7.75 NaN Q
791 792 0 2 Gaskell, Mr. Alfred male 16.0 0 0 239865 26.0 NaN S
792 793 0 3 Sage, Miss. Stella Anna female NaN 8 2 CA. 2343 69.55 NaN S
793 794 0 1 Hoyt, Mr. William Fisher male NaN 0 0 PC 17600 30.6958 NaN C
794 795 0 3 Dantcheff, Mr. Ristiu male 25.0 0 0 349203 7.8958 NaN S
795 796 0 2 Otter, Mr. Richard male 39.0 0 0 28213 13.0 NaN S
796 797 1 1 Leader, Dr. Alice (Farnham) female 49.0 0 0 17465 25.9292 D17 S
797 798 1 3 Osman, Mrs. Mara female 31.0 0 0 349244 8.6833 NaN S
798 799 0 3 Ibrahim Shawah, Mr. Yousseff male 30.0 0 0 2685 7.2292 NaN C
799 800 0 3 Van Impe, Mrs. Jean Baptiste (Rosalie Paula Govaert) female 30.0 1 1 345773 24.15 NaN S
800 801 0 2 Ponesell, Mr. Martin male 34.0 0 0 250647 13.0 NaN S
801 802 1 2 Collyer, Mrs. Harvey (Charlotte Annie Tate) female 31.0 1 1 C.A. 31921 26.25 NaN S
802 803 1 1 Carter, Master. William Thornton II male 11.0 1 2 113760 120.0 B96 B98 S
803 804 1 3 Thomas, Master. Assad Alexander male 0.42 0 1 2625 8.5167 NaN C
804 805 1 3 Hedman, Mr. Oskar Arvid male 27.0 0 0 347089 6.975 NaN S
805 806 0 3 Johansson, Mr. Karl Johan male 31.0 0 0 347063 7.775 NaN S
806 807 0 1 Andrews, Mr. Thomas Jr male 39.0 0 0 112050 0.0 A36 S
807 808 0 3 Pettersson, Miss. Ellen Natalia female 18.0 0 0 347087 7.775 NaN S
808 809 0 2 Meyer, Mr. August male 39.0 0 0 248723 13.0 NaN S
809 810 1 1 Chambers, Mrs. Norman Campbell (Bertha Griggs) female 33.0 1 0 113806 53.1 E8 S
810 811 0 3 Alexander, Mr. William male 26.0 0 0 3474 7.8875 NaN S
811 812 0 3 Lester, Mr. James male 39.0 0 0 A/4 48871 24.15 NaN S
812 813 0 2 Slemen, Mr. Richard James male 35.0 0 0 28206 10.5 NaN S
813 814 0 3 Andersson, Miss. Ebba Iris Alfrida female 6.0 4 2 347082 31.275 NaN S
814 815 0 3 Tomlin, Mr. Ernest Portage male 30.5 0 0 364499 8.05 NaN S
815 816 0 1 Fry, Mr. Richard male NaN 0 0 112058 0.0 B102 S
816 817 0 3 Heininen, Miss. Wendla Maria female 23.0 0 0 STON/O2. 3101290 7.925 NaN S
817 818 0 2 Mallet, Mr. Albert male 31.0 1 1 S.C./PARIS 2079 37.0042 NaN C
818 819 0 3 Holm, Mr. John Fredrik Alexander male 43.0 0 0 C 7075 6.45 NaN S
819 820 0 3 Skoog, Master. Karl Thorsten male 10.0 3 2 347088 27.9 NaN S
820 821 1 1 Hays, Mrs. Charles Melville (Clara Jennings Gregg) female 52.0 1 1 12749 93.5 B69 S
821 822 1 3 Lulic, Mr. Nikola male 27.0 0 0 315098 8.6625 NaN S
822 823 0 1 Reuchlin, Jonkheer. John George male 38.0 0 0 19972 0.0 NaN S
823 824 1 3 Moor, Mrs. (Beila) female 27.0 0 1 392096 12.475 E121 S
824 825 0 3 Panula, Master. Urho Abraham male 2.0 4 1 3101295 39.6875 NaN S
825 826 0 3 Flynn, Mr. John male NaN 0 0 368323 6.95 NaN Q
826 827 0 3 Lam, Mr. Len male NaN 0 0 1601 56.4958 NaN S
827 828 1 2 Mallet, Master. Andre male 1.0 0 2 S.C./PARIS 2079 37.0042 NaN C
828 829 1 3 McCormack, Mr. Thomas Joseph male NaN 0 0 367228 7.75 NaN Q
829 830 1 1 Stone, Mrs. George Nelson (Martha Evelyn) female 62.0 0 0 113572 80.0 B28 NaN
830 831 1 3 Yasbeck, Mrs. Antoni (Selini Alexander) female 15.0 1 0 2659 14.4542 NaN C
831 832 1 2 Richards, Master. George Sibley male 0.83 1 1 29106 18.75 NaN S
832 833 0 3 Saad, Mr. Amin male NaN 0 0 2671 7.2292 NaN C
833 834 0 3 Augustsson, Mr. Albert male 23.0 0 0 347468 7.8542 NaN S
834 835 0 3 Allum, Mr. Owen George male 18.0 0 0 2223 8.3 NaN S
835 836 1 1 Compton, Miss. Sara Rebecca female 39.0 1 1 PC 17756 83.1583 E49 C
836 837 0 3 Pasic, Mr. Jakob male 21.0 0 0 315097 8.6625 NaN S
837 838 0 3 Sirota, Mr. Maurice male NaN 0 0 392092 8.05 NaN S
838 839 1 3 Chip, Mr. Chang male 32.0 0 0 1601 56.4958 NaN S
839 840 1 1 Marechal, Mr. Pierre male NaN 0 0 11774 29.7 C47 C
840 841 0 3 Alhomaki, Mr. Ilmari Rudolf male 20.0 0 0 SOTON/O2 3101287 7.925 NaN S
841 842 0 2 Mudd, Mr. Thomas Charles male 16.0 0 0 S.O./P.P. 3 10.5 NaN S
842 843 1 1 Serepeca, Miss. Augusta female 30.0 0 0 113798 31.0 NaN C
843 844 0 3 Lemberopolous, Mr. Peter L male 34.5 0 0 2683 6.4375 NaN C
844 845 0 3 Culumovic, Mr. Jeso male 17.0 0 0 315090 8.6625 NaN S
845 846 0 3 Abbing, Mr. Anthony male 42.0 0 0 C.A. 5547 7.55 NaN S
846 847 0 3 Sage, Mr. Douglas Bullen male NaN 8 2 CA. 2343 69.55 NaN S
847 848 0 3 Markoff, Mr. Marin male 35.0 0 0 349213 7.8958 NaN C
848 849 0 2 Harper, Rev. John male 28.0 0 1 248727 33.0 NaN S
849 850 1 1 Goldenberg, Mrs. Samuel L (Edwiga Grabowska) female NaN 1 0 17453 89.1042 C92 C
850 851 0 3 Andersson, Master. Sigvard Harald Elias male 4.0 4 2 347082 31.275 NaN S
851 852 0 3 Svensson, Mr. Johan male 74.0 0 0 347060 7.775 NaN S
852 853 0 3 Boulos, Miss. Nourelain female 9.0 1 1 2678 15.2458 NaN C
853 854 1 1 Lines, Miss. Mary Conover female 16.0 0 1 PC 17592 39.4 D28 S
854 855 0 2 Carter, Mrs. Ernest Courtenay (Lilian Hughes) female 44.0 1 0 244252 26.0 NaN S
855 856 1 3 Aks, Mrs. Sam (Leah Rosen) female 18.0 0 1 392091 9.35 NaN S
856 857 1 1 Wick, Mrs. George Dennick (Mary Hitchcock) female 45.0 1 1 36928 164.8667 NaN S
857 858 1 1 Daly, Mr. Peter Denis male 51.0 0 0 113055 26.55 E17 S
858 859 1 3 Baclini, Mrs. Solomon (Latifa Qurban) female 24.0 0 3 2666 19.2583 NaN C
859 860 0 3 Razi, Mr. Raihed male NaN 0 0 2629 7.2292 NaN C
860 861 0 3 Hansen, Mr. Claus Peter male 41.0 2 0 350026 14.1083 NaN S
861 862 0 2 Giles, Mr. Frederick Edward male 21.0 1 0 28134 11.5 NaN S
862 863 1 1 Swift, Mrs. Frederick Joel (Margaret Welles Barron) female 48.0 0 0 17466 25.9292 D17 S
863 864 0 3 Sage, Miss. Dorothy Edith “Dolly” female NaN 8 2 CA. 2343 69.55 NaN S
864 865 0 2 Gill, Mr. John William male 24.0 0 0 233866 13.0 NaN S
865 866 1 2 Bystrom, Mrs. (Karolina) female 42.0 0 0 236852 13.0 NaN S
866 867 1 2 Duran y More, Miss. Asuncion female 27.0 1 0 SC/PARIS 2149 13.8583 NaN C
867 868 0 1 Roebling, Mr. Washington Augustus II male 31.0 0 0 PC 17590 50.4958 A24 S
868 869 0 3 van Melkebeke, Mr. Philemon male NaN 0 0 345777 9.5 NaN S
869 870 1 3 Johnson, Master. Harold Theodor male 4.0 1 1 347742 11.1333 NaN S
870 871 0 3 Balkic, Mr. Cerin male 26.0 0 0 349248 7.8958 NaN S
871 872 1 1 Beckwith, Mrs. Richard Leonard (Sallie Monypeny) female 47.0 1 1 11751 52.5542 D35 S
872 873 0 1 Carlsson, Mr. Frans Olof male 33.0 0 0 695 5.0 B51 B53 B55 S
873 874 0 3 Vander Cruyssen, Mr. Victor male 47.0 0 0 345765 9.0 NaN S
874 875 1 2 Abelson, Mrs. Samuel (Hannah Wizosky) female 28.0 1 0 P/PP 3381 24.0 NaN C
875 876 1 3 Najib, Miss. Adele Kiamie “Jane” female 15.0 0 0 2667 7.225 NaN C
876 877 0 3 Gustafsson, Mr. Alfred Ossian male 20.0 0 0 7534 9.8458 NaN S
877 878 0 3 Petroff, Mr. Nedelio male 19.0 0 0 349212 7.8958 NaN S
878 879 0 3 Laleff, Mr. Kristo male NaN 0 0 349217 7.8958 NaN S
879 880 1 1 Potter, Mrs. Thomas Jr (Lily Alexenia Wilson) female 56.0 0 1 11767 83.1583 C50 C
880 881 1 2 Shelley, Mrs. William (Imanita Parrish Hall) female 25.0 0 1 230433 26.0 NaN S
881 882 0 3 Markun, Mr. Johann male 33.0 0 0 349257 7.8958 NaN S
882 883 0 3 Dahlberg, Miss. Gerda Ulrika female 22.0 0 0 7552 10.5167 NaN S
883 884 0 2 Banfield, Mr. Frederick James male 28.0 0 0 C.A./SOTON 34068 10.5 NaN S
884 885 0 3 Sutehall, Mr. Henry Jr male 25.0 0 0 SOTON/OQ 392076 7.05 NaN S
885 886 0 3 Rice, Mrs. William (Margaret Norton) female 39.0 0 5 382652 29.125 NaN Q
886 887 0 2 Montvila, Rev. Juozas male 27.0 0 0 211536 13.0 NaN S
887 888 1 1 Graham, Miss. Margaret Edith female 19.0 0 0 112053 30.0 B42 S
888 889 0 3 Johnston, Miss. Catherine Helen “Carrie” female NaN 1 2 W./C. 6607 23.45 NaN S
889 890 1 1 Behr, Mr. Karl Howell male 26.0 0 0 111369 30.0 C148 C
890 891 0 3 Dooley, Mr. Patrick male 32.0 0 0 370376 7.75 NaN Q

Data exploration examples

In short, data exploration is an iterative process that helps to better understand the data and identify potential issues or patterns that may be relevant for further analysis. Some everyday tasks that are performed during data exploration include:

  1. Examining the distribution of values for each variable
  2. Identifying any missing or incomplete data
  3. Detecting outliers or unusual values
  4. Calculating summary statistics such as mean, median, and standard deviation
  5. Visualizing relationships between variables using plots such as scatterplots or histograms.

Next, we will see the most useful data exploration functions in Pandas that are commonly used in data science and analysis.

The head() and tail()

The head() and tail() functions allow you to view the first or last few rows of a DataFrame, which can help get a feel for the data and identify any issues or patterns.

titanic_df.head()
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.25 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38.0 1 0 PC 17599 71.2833 C85 C
2 3 1 3 Heikkinen, Miss. Laina female 26.0 0 0 STON/O2. 3101282 7.925 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.05 NaN S
titanic_df.tail()
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
886 887 0 2 Montvila, Rev. Juozas male 27.0 0 0 211536 13.0 NaN S
887 888 1 1 Graham, Miss. Margaret Edith female 19.0 0 0 112053 30.0 B42 S
888 889 0 3 Johnston, Miss. Catherine Helen “Carrie” female NaN 1 2 W./C. 6607 23.45 NaN S
889 890 1 1 Behr, Mr. Karl Howell male 26.0 0 0 111369 30.0 C148 C
890 891 0 3 Dooley, Mr. Patrick male 32.0 0 0 370376 7.75 NaN Q

The describe()

The describe() function calculates a set of summary statistics for each column in a DataFrame, including the count, mean, median, standard deviation, and quartiles. It can be a quick and easy way to get a dataset summary.

titanic_df.describe()
index PassengerId Survived Pclass Age SibSp Parch Fare
count 891.0 891.0 891.0 714.0 891.0 891.0 891.0
mean 446.0 0.34 2.31 29.70 0.52 0.38 32.20
std 257.35 0.49 0.84 14.53 1.10 0.81 49.69
min 1.0 0.0 1.0 0.42 0.0 0.0 0.0
25% 223.5 0.0 2.0 20.13 0.0 0.0 7.91
50% 446.0 0.0 3.0 28.0 0.0 0.0 14.46
75% 668.5 1.0 3.0 38.0 1.0 0.0 31.0
max 891.0 1.0 3.0 80.0 8.0 6.0 512.33

The value_counts()

The value_counts() function counts the number of occurrences of each unique value in a Pandas Series (i.e., a single column of a DataFrame). It can be used to identify the most common values in a column and detect any unusual or unexpected ones. For instance, we can see passenger age distribution with value_counts() as follows and observe that the largest age group is people 24 years old.

titanic_df["Age"].value_counts(ascending=True)
74.00     1
14.50     1
70.50     1
12.00     1
36.50     1
         ..
30.00    25
19.00    25
18.00    26
22.00    27
24.00    30
Name: Age, Length: 88, dtype: int64

The corr()

The corr() function calculates the correlation between pairs of columns in a DataFrame. It can be used to identify relationships between variables and detect any multicollinearity.

titanic_df.corr()
index PassengerId Survived Pclass Age SibSp Parch Fare
PassengerId 1.0 -0.01 -0.04 0.04 -0.06 -0.0 0.01
Survived -0.01 1.0 -0.34 -0.08 -0.04 0.08 0.26
Pclass -0.04 -0.34 1.0 -0.37 0.08 0.02 -0.55
Age 0.04 -0.08 -0.37 1.0 -0.31 -0.19 0.1
SibSp -0.06 -0.04 0.08 -0.31 1.0 0.41 0.16
Parch -0.0 0.08 0.02 -0.19 0.41 1.0 0.22
Fare 0.01 0.26 -0.55 0.1 0.16 0.22 1.0

The info()

The info() function provides a summary of a Pandas DataFrame, including the number of rows and columns, the data type of each column, and the number of non-missing values in each column. It can help get a high-level overview of a dataset and identify any potential data issues or problems.

titanic_df.info()
RangeIndex: 891 entries, 0 to 890
Data columns (total 12 columns):
 #   Column       Non-Null Count  Dtype  
---  -----------  --------------  -----  
 0   PassengerId  891 non-null    int64  
 1   Survived     891 non-null    int64  
 2   Pclass       891 non-null    int64  
 3   Name         891 non-null    object 
 4   Sex          891 non-null    object 
 5   Age          714 non-null    float64
 6   SibSp        891 non-null    int64  
 7   Parch        891 non-null    int64  
 8   Ticket       891 non-null    object 
 9   Fare         891 non-null    float64
 10  Cabin        204 non-null    object 
 11  Embarked     889 non-null    object 
dtypes: float64(2), int64(5), object(5)
memory usage: 83.7+ KB

Data Cleansing

Finding missing values

Real-life data often contains missing values that require removal or preprocessing. The simplest way to find missing values represented by NaN (which means “Not A Number”), which is a particular floating-point value and cannot be converted to any other type than float, is by using
.isna().any() and .isna().sum() functions. For null values, we similarly use isnull() function.

Firstly, let’s check the size of the Titanic dataset using the built-in shape sequence returning the number of rows and columns in the dataframe.

# The size of loaded dataset
titanic_df.shape
(891, 12)
# Finding all columns with NaN values:
titanic_df.isna().any()
PassengerId    False
Survived       False
Pclass         False
Name           False
Sex            False
Age             True
SibSp          False
Parch          False
Ticket         False
Fare           False
Cabin           True
Embarked        True
dtype: bool

With the sum() function, we see the total number of rows with the NaN values for each column.

titanic_df.isna().sum()
PassengerId      0
Survived         0
Pclass           0
Name             0
Sex              0
Age            177
SibSp            0
Parch            0
Ticket           0
Fare             0
Cabin          687
Embarked         2
dtype: int64

Alternatively, we can select all columns with NaNs as follow.

# Selecting all columns with NaN values
titanic_df[titanic_df.columns[titanic_df.isna().any()]]
index Age Cabin Embarked
0 22.0 NaN S
1 38.0 C85 C
2 26.0 NaN S
3 35.0 C123 S
4 35.0 NaN S
5 NaN NaN Q
6 54.0 E46 S
7 2.0 NaN S
8 27.0 NaN S
9 14.0 NaN C
10 4.0 G6 S
11 58.0 C103 S
12 20.0 NaN S
13 39.0 NaN S
14 14.0 NaN S
15 55.0 NaN S
16 2.0 NaN Q
17 NaN NaN S
18 31.0 NaN S
19 NaN NaN C
20 35.0 NaN S
21 34.0 D56 S
22 15.0 NaN Q
23 28.0 A6 S
24 8.0 NaN S
25 38.0 NaN S
26 NaN NaN C
27 19.0 C23 C25 C27 S
28 NaN NaN Q
29 NaN NaN S
30 40.0 NaN C
31 NaN B78 C
32 NaN NaN Q
33 66.0 NaN S
34 28.0 NaN C
35 42.0 NaN S
36 NaN NaN C
37 21.0 NaN S
38 18.0 NaN S
39 14.0 NaN C
40 40.0 NaN S
41 27.0 NaN S
42 NaN NaN C
43 3.0 NaN C
44 19.0 NaN Q
45 NaN NaN S
46 NaN NaN Q
47 NaN NaN Q
48 NaN NaN C
49 18.0 NaN S
50 7.0 NaN S
51 21.0 NaN S
52 49.0 D33 C
53 29.0 NaN S
54 65.0 B30 C
55 NaN C52 S
56 21.0 NaN S
57 28.5 NaN C
58 5.0 NaN S
59 11.0 NaN S
60 22.0 NaN C
61 38.0 B28 NaN
62 45.0 C83 S
63 4.0 NaN S
64 NaN NaN C
65 NaN NaN C
66 29.0 F33 S
67 19.0 NaN S
68 17.0 NaN S
69 26.0 NaN S
70 32.0 NaN S
71 16.0 NaN S
72 21.0 NaN S
73 26.0 NaN C
74 32.0 NaN S
75 25.0 F G73 S
76 NaN NaN S
77 NaN NaN S
78 0.83 NaN S
79 30.0 NaN S
80 22.0 NaN S
81 29.0 NaN S
82 NaN NaN Q
83 28.0 NaN S
84 17.0 NaN S
85 33.0 NaN S
86 16.0 NaN S
87 NaN NaN S
88 23.0 C23 C25 C27 S
89 24.0 NaN S
90 29.0 NaN S
91 20.0 NaN S
92 46.0 E31 S
93 26.0 NaN S
94 59.0 NaN S
95 NaN NaN S
96 71.0 A5 C
97 23.0 D10 D12 C
98 34.0 NaN S
99 34.0 NaN S
100 28.0 NaN S
101 NaN NaN S
102 21.0 D26 S
103 33.0 NaN S
104 37.0 NaN S
105 28.0 NaN S
106 21.0 NaN S
107 NaN NaN S
108 38.0 NaN S
109 NaN NaN Q
110 47.0 C110 S
111 14.5 NaN C
112 22.0 NaN S
113 20.0 NaN S
114 17.0 NaN C
115 21.0 NaN S
116 70.5 NaN Q
117 29.0 NaN S
118 24.0 B58 B60 C
119 2.0 NaN S
120 21.0 NaN S
121 NaN NaN S
122 32.5 NaN C
123 32.5 E101 S
124 54.0 D26 S
125 12.0 NaN C
126 NaN NaN Q
127 24.0 NaN S
128 NaN F E69 C
129 45.0 NaN S
130 33.0 NaN C
131 20.0 NaN S
132 47.0 NaN S
133 29.0 NaN S
134 25.0 NaN S
135 23.0 NaN C
136 19.0 D47 S
137 37.0 C123 S
138 16.0 NaN S
139 24.0 B86 C
140 NaN NaN C
141 22.0 NaN S
142 24.0 NaN S
143 19.0 NaN Q
144 18.0 NaN S
145 19.0 NaN S
146 27.0 NaN S
147 9.0 NaN S
148 36.5 F2 S
149 42.0 NaN S
150 51.0 NaN S
151 22.0 C2 S
152 55.5 NaN S
153 40.5 NaN S
154 NaN NaN S
155 51.0 NaN C
156 16.0 NaN Q
157 30.0 NaN S
158 NaN NaN S
159 NaN NaN S
160 44.0 NaN S
161 40.0 NaN S
162 26.0 NaN S
163 17.0 NaN S
164 1.0 NaN S
165 9.0 NaN S
166 NaN E33 S
167 45.0 NaN S
168 NaN NaN S
169 28.0 NaN S
170 61.0 B19 S
171 4.0 NaN Q
172 1.0 NaN S
173 21.0 NaN S
174 56.0 A7 C
175 18.0 NaN S
176 NaN NaN S
177 50.0 C49 C
178 30.0 NaN S
179 36.0 NaN S
180 NaN NaN S
181 NaN NaN C
182 9.0 NaN S
183 1.0 F4 S
184 4.0 NaN S
185 NaN A32 S
186 NaN NaN Q
187 45.0 NaN S
188 40.0 NaN Q
189 36.0 NaN S
190 32.0 NaN S
191 19.0 NaN S
192 19.0 NaN S
193 3.0 F2 S
194 44.0 B4 C
195 58.0 B80 C
196 NaN NaN Q
197 42.0 NaN S
198 NaN NaN Q
199 24.0 NaN S
200 28.0 NaN S
201 NaN NaN S
202 34.0 NaN S
203 45.5 NaN C
204 18.0 NaN S
205 2.0 G6 S
206 32.0 NaN S
207 26.0 NaN C
208 16.0 NaN Q
209 40.0 A31 C
210 24.0 NaN S
211 35.0 NaN S
212 22.0 NaN S
213 30.0 NaN S
214 NaN NaN Q
215 31.0 D36 C
216 27.0 NaN S
217 42.0 NaN S
218 32.0 D15 C
219 30.0 NaN S
220 16.0 NaN S
221 27.0 NaN S
222 51.0 NaN S
223 NaN NaN S
224 38.0 C93 S
225 22.0 NaN S
226 19.0 NaN S
227 20.5 NaN S
228 18.0 NaN S
229 NaN NaN S
230 35.0 C83 S
231 29.0 NaN S
232 59.0 NaN S
233 5.0 NaN S
234 24.0 NaN S
235 NaN NaN S
236 44.0 NaN S
237 8.0 NaN S
238 19.0 NaN S
239 33.0 NaN S
240 NaN NaN C
241 NaN NaN Q
242 29.0 NaN S
243 22.0 NaN S
244 30.0 NaN C
245 44.0 C78 Q
246 25.0 NaN S
247 24.0 NaN S
248 37.0 D35 S
249 54.0 NaN S
250 NaN NaN S
251 29.0 G6 S
252 62.0 C87 S
253 30.0 NaN S
254 41.0 NaN S
255 29.0 NaN C
256 NaN NaN C
257 30.0 B77 S
258 35.0 NaN C
259 50.0 NaN S
260 NaN NaN Q
261 3.0 NaN S
262 52.0 E67 S
263 40.0 B94 S
264 NaN NaN Q
265 36.0 NaN S
266 16.0 NaN S
267 25.0 NaN S
268 58.0 C125 S
269 35.0 C99 S
270 NaN NaN S
271 25.0 NaN S
272 41.0 NaN S
273 37.0 C118 C
274 NaN NaN Q
275 63.0 D7 S
276 45.0 NaN S
277 NaN NaN S
278 7.0 NaN Q
279 35.0 NaN S
280 65.0 NaN Q
281 28.0 NaN S
282 16.0 NaN S
283 19.0 NaN S
284 NaN A19 S
285 33.0 NaN C
286 30.0 NaN S
287 22.0 NaN S
288 42.0 NaN S
289 22.0 NaN Q
290 26.0 NaN S
291 19.0 B49 C
292 36.0 D C
293 24.0 NaN S
294 24.0 NaN S
295 NaN NaN C
296 23.5 NaN C
297 2.0 C22 C26 S
298 NaN C106 S
299 50.0 B58 B60 C
300 NaN NaN Q
301 NaN NaN Q
302 19.0 NaN S
303 NaN E101 Q
304 NaN NaN S
305 0.92 C22 C26 S
306 NaN NaN C
307 17.0 C65 C
308 30.0 NaN C
309 30.0 E36 C
310 24.0 C54 C
311 18.0 B57 B59 B63 B66 C
312 26.0 NaN S
313 28.0 NaN S
314 43.0 NaN S
315 26.0 NaN S
316 24.0 NaN S
317 54.0 NaN S
318 31.0 C7 S
319 40.0 E34 C
320 22.0 NaN S
321 27.0 NaN S
322 30.0 NaN Q
323 22.0 NaN S
324 NaN NaN S
325 36.0 C32 C
326 61.0 NaN S
327 36.0 D S
328 31.0 NaN S
329 16.0 B18 C
330 NaN NaN Q
331 45.5 C124 S
332 38.0 C91 S
333 16.0 NaN S
334 NaN NaN S
335 NaN NaN S
336 29.0 C2 S
337 41.0 E40 C
338 45.0 NaN S
339 45.0 T S
340 2.0 F2 S
341 24.0 C23 C25 C27 S
342 28.0 NaN S
343 25.0 NaN S
344 36.0 NaN S
345 24.0 F33 S
346 40.0 NaN S
347 NaN NaN S
348 3.0 NaN S
349 42.0 NaN S
350 23.0 NaN S
351 NaN C128 S
352 15.0 NaN C
353 25.0 NaN S
354 NaN NaN C
355 28.0 NaN S
356 22.0 E33 S
357 38.0 NaN S
358 NaN NaN Q
359 NaN NaN Q
360 40.0 NaN S
361 29.0 NaN C
362 45.0 NaN C
363 35.0 NaN S
364 NaN NaN Q
365 30.0 NaN S
366 60.0 D37 C
367 NaN NaN C
368 NaN NaN Q
369 24.0 B35 C
370 25.0 E50 C
371 18.0 NaN S
372 19.0 NaN S
373 22.0 NaN C
374 3.0 NaN S
375 NaN NaN C
376 22.0 NaN S
377 27.0 C82 C
378 20.0 NaN C
379 19.0 NaN S
380 42.0 NaN C
381 1.0 NaN C
382 32.0 NaN S
383 35.0 NaN S
384 NaN NaN S
385 18.0 NaN S
386 1.0 NaN S
387 36.0 NaN S
388 NaN NaN Q
389 17.0 NaN C
390 36.0 B96 B98 S
391 21.0 NaN S
392 28.0 NaN S
393 23.0 D36 C
394 24.0 G6 S
395 22.0 NaN S
396 31.0 NaN S
397 46.0 NaN S
398 23.0 NaN S
399 28.0 NaN S
400 39.0 NaN S
401 26.0 NaN S
402 21.0 NaN S
403 28.0 NaN S
404 20.0 NaN S
405 34.0 NaN S
406 51.0 NaN S
407 3.0 NaN S
408 21.0 NaN S
409 NaN NaN S
410 NaN NaN S
411 NaN NaN Q
412 33.0 C78 Q
413 NaN NaN S
414 44.0 NaN S
415 NaN NaN S
416 34.0 NaN S
417 18.0 NaN S
418 30.0 NaN S
419 10.0 NaN S
420 NaN NaN C
421 21.0 NaN Q
422 29.0 NaN S
423 28.0 NaN S
424 18.0 NaN S
425 NaN NaN S
426 28.0 NaN S
427 19.0 NaN S
428 NaN NaN Q
429 32.0 E10 S
430 28.0 C52 S
431 NaN NaN S
432 42.0 NaN S
433 17.0 NaN S
434 50.0 E44 S
435 14.0 B96 B98 S
436 21.0 NaN S
437 24.0 NaN S
438 64.0 C23 C25 C27 S
439 31.0 NaN S
440 45.0 NaN S
441 20.0 NaN S
442 25.0 NaN S
443 28.0 NaN S
444 NaN NaN S
445 4.0 A34 S
446 13.0 NaN S
447 34.0 NaN S
448 5.0 NaN C
449 52.0 C104 S
450 36.0 NaN S
451 NaN NaN S
452 30.0 C111 C
453 49.0 C92 C
454 NaN NaN S
455 29.0 NaN C
456 65.0 E38 S
457 NaN D21 S
458 50.0 NaN S
459 NaN NaN Q
460 48.0 E12 S
461 34.0 NaN S
462 47.0 E63 S
463 48.0 NaN S
464 NaN NaN S
465 38.0 NaN S
466 NaN NaN S
467 56.0 NaN S
468 NaN NaN Q
469 0.75 NaN C
470 NaN NaN S
471 38.0 NaN S
472 33.0 NaN S
473 23.0 D C
474 22.0 NaN S
475 NaN A14 S
476 34.0 NaN S
477 29.0 NaN S
478 22.0 NaN S
479 2.0 NaN S
480 9.0 NaN S
481 NaN NaN S
482 50.0 NaN S
483 63.0 NaN S
484 25.0 B49 C
485 NaN NaN S
486 35.0 C93 S
487 58.0 B37 C
488 30.0 NaN S
489 9.0 NaN S
490 NaN NaN S
491 21.0 NaN S
492 55.0 C30 S
493 71.0 NaN C
494 21.0 NaN S
495 NaN NaN C
496 54.0 D20 C
497 NaN NaN S
498 25.0 C22 C26 S
499 24.0 NaN S
500 17.0 NaN S
501 21.0 NaN Q
502 NaN NaN Q
503 37.0 NaN S
504 16.0 B79 S
505 18.0 C65 C
506 33.0 NaN S
507 NaN NaN S
508 28.0 NaN S
509 26.0 NaN S
510 29.0 NaN Q
511 NaN NaN S
512 36.0 E25 S
513 54.0 NaN C
514 24.0 NaN S
515 47.0 D46 S
516 34.0 F33 S
517 NaN NaN Q
518 36.0 NaN S
519 32.0 NaN S
520 30.0 B73 S
521 22.0 NaN S
522 NaN NaN C
523 44.0 B18 C
524 NaN NaN C
525 40.5 NaN Q
526 50.0 NaN S
527 NaN C95 S
528 39.0 NaN S
529 23.0 NaN S
530 2.0 NaN S
531 NaN NaN C
532 17.0 NaN C
533 NaN NaN C
534 30.0 NaN S
535 7.0 NaN S
536 45.0 B38 S
537 30.0 NaN C
538 NaN NaN S
539 22.0 B39 C
540 36.0 B22 S
541 9.0 NaN S
542 11.0 NaN S
543 32.0 NaN S
544 50.0 C86 C
545 64.0 NaN S
546 19.0 NaN S
547 NaN NaN C
548 33.0 NaN S
549 8.0 NaN S
550 17.0 C70 C
551 27.0 NaN S
552 NaN NaN Q
553 22.0 NaN C
554 22.0 NaN S
555 62.0 NaN S
556 48.0 A16 C
557 NaN NaN C
558 39.0 E67 S
559 36.0 NaN S
560 NaN NaN Q
561 40.0 NaN S
562 28.0 NaN S
563 NaN NaN S
564 NaN NaN S
565 24.0 NaN S
566 19.0 NaN S
567 29.0 NaN S
568 NaN NaN C
569 32.0 NaN S
570 62.0 NaN S
571 53.0 C101 S
572 36.0 E25 S
573 NaN NaN Q
574 16.0 NaN S
575 19.0 NaN S
576 34.0 NaN S
577 39.0 E44 S
578 NaN NaN C
579 32.0 NaN S
580 25.0 NaN S
581 39.0 C68 C
582 54.0 NaN S
583 36.0 A10 C
584 NaN NaN C
585 18.0 E68 S
586 47.0 NaN S
587 60.0 B41 C
588 22.0 NaN S
589 NaN NaN S
590 35.0 NaN S
591 52.0 D20 C
592 47.0 NaN S
593 NaN NaN Q
594 37.0 NaN S
595 36.0 NaN S
596 NaN NaN S
597 49.0 NaN S
598 NaN NaN C
599 49.0 A20 C
600 24.0 NaN S
601 NaN NaN S
602 NaN NaN S
603 44.0 NaN S
604 35.0 NaN C
605 36.0 NaN S
606 30.0 NaN S
607 27.0 NaN S
608 22.0 NaN C
609 40.0 C125 S
610 39.0 NaN S
611 NaN NaN S
612 NaN NaN Q
613 NaN NaN Q
614 35.0 NaN S
615 24.0 NaN S
616 34.0 NaN S
617 26.0 NaN S
618 4.0 F4 S
619 26.0 NaN S
620 27.0 NaN C
621 42.0 D19 S
622 20.0 NaN C
623 21.0 NaN S
624 21.0 NaN S
625 61.0 D50 S
626 57.0 NaN Q
627 21.0 D9 S
628 26.0 NaN S
629 NaN NaN Q
630 80.0 A23 S
631 51.0 NaN S
632 32.0 B50 C
633 NaN NaN S
634 9.0 NaN S
635 28.0 NaN S
636 32.0 NaN S
637 31.0 NaN S
638 41.0 NaN S
639 NaN NaN S
640 20.0 NaN S
641 24.0 B35 C
642 2.0 NaN S
643 NaN NaN S
644 0.75 NaN C
645 48.0 D33 C
646 19.0 NaN S
647 56.0 A26 C
648 NaN NaN S
649 23.0 NaN S
650 NaN NaN S
651 18.0 NaN S
652 21.0 NaN S
653 NaN NaN Q
654 18.0 NaN Q
655 24.0 NaN S
656 NaN NaN S
657 32.0 NaN Q
658 23.0 NaN S
659 58.0 D48 C
660 50.0 NaN S
661 40.0 NaN C
662 47.0 E58 S
663 36.0 NaN S
664 20.0 NaN S
665 32.0 NaN S
666 25.0 NaN S
667 NaN NaN S
668 43.0 NaN S
669 NaN C126 S
670 40.0 NaN S
671 31.0 B71 S
672 70.0 NaN S
673 31.0 NaN S
674 NaN NaN S
675 18.0 NaN S
676 24.5 NaN S
677 18.0 NaN S
678 43.0 NaN S
679 36.0 B51 B53 B55 C
680 NaN NaN Q
681 27.0 D49 C
682 20.0 NaN S
683 14.0 NaN S
684 60.0 NaN S
685 25.0 NaN C
686 14.0 NaN S
687 19.0 NaN S
688 18.0 NaN S
689 15.0 B5 S
690 31.0 B20 S
691 4.0 NaN C
692 NaN NaN S
693 25.0 NaN C
694 60.0 NaN S
695 52.0 NaN S
696 44.0 NaN S
697 NaN NaN Q
698 49.0 C68 C
699 42.0 F G63 S
700 18.0 C62 C64 C
701 35.0 E24 S
702 18.0 NaN C
703 25.0 NaN Q
704 26.0 NaN S
705 39.0 NaN S
706 45.0 NaN S
707 42.0 E24 S
708 22.0 NaN S
709 NaN NaN C
710 24.0 C90 C
711 NaN C124 S
712 48.0 C126 S
713 29.0 NaN S
714 52.0 NaN S
715 19.0 F G73 S
716 38.0 C45 C
717 27.0 E101 S
718 NaN NaN Q
719 33.0 NaN S
720 6.0 NaN S
721 17.0 NaN S
722 34.0 NaN S
723 50.0 NaN S
724 27.0 E8 S
725 20.0 NaN S
726 30.0 NaN S
727 NaN NaN Q
728 25.0 NaN S
729 25.0 NaN S
730 29.0 B5 S
731 11.0 NaN C
732 NaN NaN S
733 23.0 NaN S
734 23.0 NaN S
735 28.5 NaN S
736 48.0 NaN S
737 35.0 B101 C
738 NaN NaN S
739 NaN NaN S
740 NaN D45 S
741 36.0 C46 S
742 21.0 B57 B59 B63 B66 C
743 24.0 NaN S
744 31.0 NaN S
745 70.0 B22 S
746 16.0 NaN S
747 30.0 NaN S
748 19.0 D30 S
749 31.0 NaN Q
750 4.0 NaN S
751 6.0 E121 S
752 33.0 NaN S
753 23.0 NaN S
754 48.0 NaN S
755 0.67 NaN S
756 28.0 NaN S
757 18.0 NaN S
758 34.0 NaN S
759 33.0 B77 S
760 NaN NaN S
761 41.0 NaN S
762 20.0 NaN C
763 36.0 B96 B98 S
764 16.0 NaN S
765 51.0 D11 S
766 NaN NaN C
767 30.5 NaN Q
768 NaN NaN Q
769 32.0 NaN S
770 24.0 NaN S
771 48.0 NaN S
772 57.0 E77 S
773 NaN NaN C
774 54.0 NaN S
775 18.0 NaN S
776 NaN F38 Q
777 5.0 NaN S
778 NaN NaN Q
779 43.0 B3 S
780 13.0 NaN C
781 17.0 B20 S
782 29.0 D6 S
783 NaN NaN S
784 25.0 NaN S
785 25.0 NaN S
786 18.0 NaN S
787 8.0 NaN Q
788 1.0 NaN S
789 46.0 B82 B84 C
790 NaN NaN Q
791 16.0 NaN S
792 NaN NaN S
793 NaN NaN C
794 25.0 NaN S
795 39.0 NaN S
796 49.0 D17 S
797 31.0 NaN S
798 30.0 NaN C
799 30.0 NaN S
800 34.0 NaN S
801 31.0 NaN S
802 11.0 B96 B98 S
803 0.42 NaN C
804 27.0 NaN S
805 31.0 NaN S
806 39.0 A36 S
807 18.0 NaN S
808 39.0 NaN S
809 33.0 E8 S
810 26.0 NaN S
811 39.0 NaN S
812 35.0 NaN S
813 6.0 NaN S
814 30.5 NaN S
815 NaN B102 S
816 23.0 NaN S
817 31.0 NaN C
818 43.0 NaN S
819 10.0 NaN S
820 52.0 B69 S
821 27.0 NaN S
822 38.0 NaN S
823 27.0 E121 S
824 2.0 NaN S
825 NaN NaN Q
826 NaN NaN S
827 1.0 NaN C
828 NaN NaN Q
829 62.0 B28 NaN
830 15.0 NaN C
831 0.83 NaN S
832 NaN NaN C
833 23.0 NaN S
834 18.0 NaN S
835 39.0 E49 C
836 21.0 NaN S
837 NaN NaN S
838 32.0 NaN S
839 NaN C47 C
840 20.0 NaN S
841 16.0 NaN S
842 30.0 NaN C
843 34.5 NaN C
844 17.0 NaN S
845 42.0 NaN S
846 NaN NaN S
847 35.0 NaN C
848 28.0 NaN S
849 NaN C92 C
850 4.0 NaN S
851 74.0 NaN S
852 9.0 NaN C
853 16.0 D28 S
854 44.0 NaN S
855 18.0 NaN S
856 45.0 NaN S
857 51.0 E17 S
858 24.0 NaN C
859 NaN NaN C
860 41.0 NaN S
861 21.0 NaN S
862 48.0 D17 S
863 NaN NaN S
864 24.0 NaN S
865 42.0 NaN S
866 27.0 NaN C
867 31.0 A24 S
868 NaN NaN S
869 4.0 NaN S
870 26.0 NaN S
871 47.0 D35 S
872 33.0 B51 B53 B55 S
873 47.0 NaN S
874 28.0 NaN C
875 15.0 NaN C
876 20.0 NaN S
877 19.0 NaN S
878 NaN NaN S
879 56.0 C50 C
880 25.0 NaN S
881 33.0 NaN S
882 22.0 NaN S
883 28.0 NaN S
884 25.0 NaN S
885 39.0 NaN Q
886 27.0 NaN S
887 19.0 B42 S
888 NaN NaN S
889 26.0 C148 C
890 32.0 NaN Q
891 rows × 3 columns

Removing missing values

The dropna() function allows dropping Rows/Columns with missing NaN values. The axis=0 means that we delete all rows in which cells contain NaN. Since we use inplace=True, the dataframe will be modified after removing the rows.

# Removing all rows with NaN
titanic_df.dropna(axis=0, how='any', inplace=True)

# The size of the resulting dataset
titanic_df.shape
(183, 12)

Accessing Data

The bracket-based indexing operator

The bracket-based indexing operator helps us to extract specific columns from a dataframe.

# Get the only columns "Name", "Sex", "Age" of the first five rows
titanic_df[["Name", "Sex", "Age"]][:4]
index Name Sex Age
1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) NaN 38.0
3 Futrelle, Mrs. Jacques Heath (Lily May Peel) NaN 35.0
6 McCarthy, Mr. Timothy J NaN 54.0
10 Sandstrom, Miss. Marguerite Rut NaN 4.0

Accessing data by the key

We use the iloc() function to access the first five rows in our dataframe.

titanic_df.iloc[:5]
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Age_squared
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) NaN 38.0 1 0 PC 17599 71.2833 C85 C 1444.0
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) NaN 35.0 1 0 113803 53.1 C123 S 1225.0
6 7 0 1 McCarthy, Mr. Timothy J NaN 54.0 0 0 17463 51.8625 E46 S 2916.0
10 11 1 3 Sandstrom, Miss. Marguerite Rut NaN 4.0 1 1 PP 9549 16.7 G6 S 16.0
11 12 1 1 Bonnell, Miss. Elizabeth NaN 58.0 0 0 113783 26.55 C103 S 3364.0

Integer-location-based indexing

To find out the rows of the most senior passenger or a passenger who paid the highest fare in the dataset, we can use the integer-location-based indexing and the argmax() function.

# The most senior passenger
titanic_df.iloc[[titanic_df['Age'].argmax()]]
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Age_squared
630 631 1 1 Barkworth, Mr. Algernon Henry Wilson NaN 80.0 0 0 27042 30.0 A23 S 6400.0
# Paid the highest fair
titanic_df.iloc[[titanic_df['Fare'].argmax()]]
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Age_squared
679 680 1 1 Cardeza, Mr. Thomas Drake Martinez NaN 36.0 0 1 PC 17755 512.3292 B51 B53 B55 C 1296.0

Working with columns

To access a specific column, you can use the square brackets notation:

titanic_df['Age']
1      38.0
3      35.0
6      54.0
10      4.0
11     58.0
       ... 
871    47.0
872    33.0
879    56.0
887    19.0
889    26.0
Name: Age, Length: 183, dtype: float64

This will return the ‘Age’ column as a Pandas Series.

To select multiple columns, you can pass a list of column names:

titanic_df[['Age', 'Fare']]
index Age Fare
1 38.0 71.2833
3 35.0 53.1
6 54.0 51.8625
10 4.0 16.7
11 58.0 26.55
21 34.0 13.0
23 28.0 35.5
27 19.0 263.0
52 49.0 76.7292
54 65.0 61.9792
62 45.0 83.475
66 29.0 10.5
75 25.0 7.65
88 23.0 263.0
92 46.0 61.175
96 71.0 34.6542
97 23.0 63.3583
102 21.0 77.2875
110 47.0 52.0
118 24.0 247.5208
123 32.5 13.0
124 54.0 77.2875
136 19.0 26.2833
137 37.0 53.1
139 24.0 79.2
148 36.5 26.0
151 22.0 66.6
170 61.0 33.5
174 56.0 30.6958
177 50.0 28.7125
183 1.0 39.0
193 3.0 26.0
194 44.0 27.7208
195 58.0 146.5208
205 2.0 10.4625
209 40.0 31.0
215 31.0 113.275
218 32.0 76.2917
224 38.0 90.0
230 35.0 83.475
245 44.0 90.0
248 37.0 52.5542
251 29.0 10.4625
252 62.0 26.55
257 30.0 86.5
262 52.0 79.65
263 40.0 0.0
268 58.0 153.4625
269 35.0 135.6333
273 37.0 29.7
275 63.0 77.9583
291 19.0 91.0792
292 36.0 12.875
297 2.0 151.55
299 50.0 247.5208
305 0.92 151.55
307 17.0 108.9
309 30.0 56.9292
310 24.0 83.1583
311 18.0 262.375
318 31.0 164.8667
319 40.0 134.5
325 36.0 135.6333
327 36.0 13.0
329 16.0 57.9792
331 45.5 28.5
332 38.0 153.4625
336 29.0 66.6
337 41.0 134.5
339 45.0 35.5
340 2.0 26.0
341 24.0 263.0
345 24.0 13.0
356 22.0 55.0
366 60.0 75.25
369 24.0 69.3
370 25.0 55.4417
377 27.0 211.5
390 36.0 120.0
393 23.0 113.275
394 24.0 16.7
412 33.0 90.0
429 32.0 8.05
430 28.0 26.55
434 50.0 55.9
435 14.0 120.0
438 64.0 263.0
445 4.0 81.8583
449 52.0 30.5
452 30.0 27.75
453 49.0 89.1042
456 65.0 26.55
460 48.0 26.55
462 47.0 38.5
473 23.0 13.7917
484 25.0 91.0792
486 35.0 90.0
487 58.0 29.7
492 55.0 30.5
496 54.0 78.2667
498 25.0 151.55
504 16.0 86.5
505 18.0 108.9
512 36.0 26.2875
515 47.0 34.0208
516 34.0 10.5
520 30.0 93.5
523 44.0 57.9792
536 45.0 26.55
539 22.0 49.5
540 36.0 71.0
544 50.0 106.425
550 17.0 110.8833
556 48.0 39.6
558 39.0 79.65
571 53.0 51.4792
572 36.0 26.3875
577 39.0 55.9
581 39.0 110.8833
583 36.0 40.125
585 18.0 79.65
587 60.0 79.2
591 52.0 78.2667
599 49.0 56.9292
609 40.0 153.4625
618 4.0 39.0
621 42.0 52.5542
625 61.0 32.3208
627 21.0 77.9583
630 80.0 30.0
632 32.0 30.5
641 24.0 69.3
645 48.0 76.7292
647 56.0 35.5
659 58.0 113.275
662 47.0 25.5875
671 31.0 52.0
679 36.0 512.3292
681 27.0 76.7292
689 15.0 211.3375
690 31.0 57.0
698 49.0 110.8833
699 42.0 7.65
700 18.0 227.525
701 35.0 26.2875
707 42.0 26.2875
710 24.0 49.5042
712 48.0 52.0
715 19.0 7.65
716 38.0 227.525
717 27.0 10.5
724 27.0 53.1
730 29.0 211.3375
737 35.0 512.3292
741 36.0 78.85
742 21.0 262.375
745 70.0 71.0
748 19.0 53.1
751 6.0 12.475
759 33.0 86.5
763 36.0 120.0
765 51.0 77.9583
772 57.0 10.5
779 43.0 211.3375
781 17.0 57.0
782 29.0 30.0
789 46.0 79.2
796 49.0 25.9292
802 11.0 120.0
806 39.0 0.0
809 33.0 53.1
820 52.0 93.5
823 27.0 12.475
835 39.0 83.1583
853 16.0 39.4
857 51.0 26.55
862 48.0 25.9292
867 31.0 50.4958
871 47.0 52.5542
872 33.0 5.0
879 56.0 83.1583
887 19.0 30.0
889 26.0 30.0

This will return a new DataFrame with only the ‘Age’ and ‘Fare’ columns.

Conditional filtering

The filter function selects rows from a DataFrame based on a boolean condition. In the example above, the filter function selects only the rows where the ‘Age’ column is not null (i.e., where the value is not missing).

# Use the filter function to select only the rows where 'Age' is not null
filtered_df = titanic_df[titanic_df['Age'].notnull()]

Boolean indexing

You can also use boolean indexing to filter rows based on a condition:

titanic_df[titanic_df['Age'] > 30]
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38.0 1 0 PC 17599 71.2833 C85 C
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1 C123 S
6 7 0 1 McCarthy, Mr. Timothy J male 54.0 0 0 17463 51.8625 E46 S
11 12 1 1 Bonnell, Miss. Elizabeth female 58.0 0 0 113783 26.55 C103 S
21 22 1 2 Beesley, Mr. Lawrence male 34.0 0 0 248698 13.0 D56 S
52 53 1 1 Harper, Mrs. Henry Sleeper (Myna Haxtun) female 49.0 1 0 PC 17572 76.7292 D33 C
54 55 0 1 Ostby, Mr. Engelhart Cornelius male 65.0 0 1 113509 61.9792 B30 C
62 63 0 1 Harris, Mr. Henry Birkhardt male 45.0 1 0 36973 83.475 C83 S
92 93 0 1 Chaffee, Mr. Herbert Fuller male 46.0 1 0 W.E.P. 5734 61.175 E31 S
96 97 0 1 Goldschmidt, Mr. George B male 71.0 0 0 PC 17754 34.6542 A5 C
110 111 0 1 Porter, Mr. Walter Chamberlain male 47.0 0 0 110465 52.0 C110 S
123 124 1 2 Webber, Miss. Susan female 32.5 0 0 27267 13.0 E101 S
124 125 0 1 White, Mr. Percival Wayland male 54.0 0 1 35281 77.2875 D26 S
137 138 0 1 Futrelle, Mr. Jacques Heath male 37.0 1 0 113803 53.1 C123 S
148 149 0 2 Navratil, Mr. Michel (“Louis M Hoffman”) male 36.5 0 2 230080 26.0 F2 S
170 171 0 1 Van der hoef, Mr. Wyckoff male 61.0 0 0 111240 33.5 B19 S
174 175 0 1 Smith, Mr. James Clinch male 56.0 0 0 17764 30.6958 A7 C
177 178 0 1 Isham, Miss. Ann Elizabeth female 50.0 0 0 PC 17595 28.7125 C49 C
194 195 1 1 Brown, Mrs. James Joseph (Margaret Tobin) female 44.0 0 0 PC 17610 27.7208 B4 C
195 196 1 1 Lurette, Miss. Elise female 58.0 0 0 PC 17569 146.5208 B80 C
209 210 1 1 Blank, Mr. Henry male 40.0 0 0 112277 31.0 A31 C
215 216 1 1 Newell, Miss. Madeleine female 31.0 1 0 35273 113.275 D36 C
218 219 1 1 Bazzani, Miss. Albina female 32.0 0 0 11813 76.2917 D15 C
224 225 1 1 Hoyt, Mr. Frederick Maxfield male 38.0 1 0 19943 90.0 C93 S
230 231 1 1 Harris, Mrs. Henry Birkhardt (Irene Wallach) female 35.0 1 0 36973 83.475 C83 S
245 246 0 1 Minahan, Dr. William Edward male 44.0 2 0 19928 90.0 C78 Q
248 249 1 1 Beckwith, Mr. Richard Leonard male 37.0 1 1 11751 52.5542 D35 S
252 253 0 1 Stead, Mr. William Thomas male 62.0 0 0 113514 26.55 C87 S
262 263 0 1 Taussig, Mr. Emil male 52.0 1 1 110413 79.65 E67 S
263 264 0 1 Harrison, Mr. William male 40.0 0 0 112059 0.0 B94 S
268 269 1 1 Graham, Mrs. William Thompson (Edith Junkins) female 58.0 0 1 PC 17582 153.4625 C125 S
269 270 1 1 Bissette, Miss. Amelia female 35.0 0 0 PC 17760 135.6333 C99 S
273 274 0 1 Natsch, Mr. Charles H male 37.0 0 1 PC 17596 29.7 C118 C
275 276 1 1 Andrews, Miss. Kornelia Theodosia female 63.0 1 0 13502 77.9583 D7 S
292 293 0 2 Levy, Mr. Rene Jacques male 36.0 0 0 SC/Paris 2163 12.875 D C
299 300 1 1 Baxter, Mrs. James (Helene DeLaudeniere Chaput) female 50.0 0 1 PC 17558 247.5208 B58 B60 C
318 319 1 1 Wick, Miss. Mary Natalie female 31.0 0 2 36928 164.8667 C7 S
319 320 1 1 Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone) female 40.0 1 1 16966 134.5 E34 C
325 326 1 1 Young, Miss. Marie Grice female 36.0 0 0 PC 17760 135.6333 C32 C
327 328 1 2 Ball, Mrs. (Ada E Hall) female 36.0 0 0 28551 13.0 D S
331 332 0 1 Partner, Mr. Austen male 45.5 0 0 113043 28.5 C124 S
332 333 0 1 Graham, Mr. George Edward male 38.0 0 1 PC 17582 153.4625 C91 S
337 338 1 1 Burns, Miss. Elizabeth Margaret female 41.0 0 0 16966 134.5 E40 C
339 340 0 1 Blackwell, Mr. Stephen Weart male 45.0 0 0 113784 35.5 T S
366 367 1 1 Warren, Mrs. Frank Manley (Anna Sophia Atkinson) female 60.0 1 0 110813 75.25 D37 C
390 391 1 1 Carter, Mr. William Ernest male 36.0 1 2 113760 120.0 B96 B98 S
412 413 1 1 Minahan, Miss. Daisy E female 33.0 1 0 19928 90.0 C78 Q
429 430 1 3 Pickard, Mr. Berk (Berk Trembisky) male 32.0 0 0 SOTON/O.Q. 392078 8.05 E10 S
434 435 0 1 Silvey, Mr. William Baird male 50.0 1 0 13507 55.9 E44 S
438 439 0 1 Fortune, Mr. Mark male 64.0 1 4 19950 263.0 C23 C25 C27 S
449 450 1 1 Peuchen, Major. Arthur Godfrey male 52.0 0 0 113786 30.5 C104 S
453 454 1 1 Goldenberg, Mr. Samuel L male 49.0 1 0 17453 89.1042 C92 C
456 457 0 1 Millet, Mr. Francis Davis male 65.0 0 0 13509 26.55 E38 S
460 461 1 1 Anderson, Mr. Harry male 48.0 0 0 19952 26.55 E12 S
462 463 0 1 Gee, Mr. Arthur H male 47.0 0 0 111320 38.5 E63 S
486 487 1 1 Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby) female 35.0 1 0 19943 90.0 C93 S
487 488 0 1 Kent, Mr. Edward Austin male 58.0 0 0 11771 29.7 B37 C
492 493 0 1 Molson, Mr. Harry Markland male 55.0 0 0 113787 30.5 C30 S
496 497 1 1 Eustis, Miss. Elizabeth Mussey female 54.0 1 0 36947 78.2667 D20 C
512 513 1 1 McGough, Mr. James Robert male 36.0 0 0 PC 17473 26.2875 E25 S
515 516 0 1 Walker, Mr. William Anderson male 47.0 0 0 36967 34.0208 D46 S
516 517 1 2 Lemore, Mrs. (Amelia Milley) female 34.0 0 0 C.A. 34260 10.5 F33 S
523 524 1 1 Hippach, Mrs. Louis Albert (Ida Sophia Fischer) female 44.0 0 1 111361 57.9792 B18 C
536 537 0 1 Butt, Major. Archibald Willingham male 45.0 0 0 113050 26.55 B38 S
540 541 1 1 Crosby, Miss. Harriet R female 36.0 0 2 WE/P 5735 71.0 B22 S
544 545 0 1 Douglas, Mr. Walter Donald male 50.0 1 0 PC 17761 106.425 C86 C
556 557 1 1 Duff Gordon, Lady. (Lucille Christiana Sutherland) (“Mrs Morgan”) female 48.0 1 0 11755 39.6 A16 C
558 559 1 1 Taussig, Mrs. Emil (Tillie Mandelbaum) female 39.0 1 1 110413 79.65 E67 S
571 572 1 1 Appleton, Mrs. Edward Dale (Charlotte Lamson) female 53.0 2 0 11769 51.4792 C101 S
572 573 1 1 Flynn, Mr. John Irwin (“Irving”) male 36.0 0 0 PC 17474 26.3875 E25 S
577 578 1 1 Silvey, Mrs. William Baird (Alice Munger) female 39.0 1 0 13507 55.9 E44 S
581 582 1 1 Thayer, Mrs. John Borland (Marian Longstreth Morris) female 39.0 1 1 17421 110.8833 C68 C
583 584 0 1 Ross, Mr. John Hugo male 36.0 0 0 13049 40.125 A10 C
587 588 1 1 Frolicher-Stehli, Mr. Maxmillian male 60.0 1 1 13567 79.2 B41 C
591 592 1 1 Stephenson, Mrs. Walter Bertram (Martha Eustis) female 52.0 1 0 36947 78.2667 D20 C
599 600 1 1 Duff Gordon, Sir. Cosmo Edmund (“Mr Morgan”) male 49.0 1 0 PC 17485 56.9292 A20 C
609 610 1 1 Shutes, Miss. Elizabeth W female 40.0 0 0 PC 17582 153.4625 C125 S
621 622 1 1 Kimball, Mr. Edwin Nelson Jr male 42.0 1 0 11753 52.5542 D19 S
625 626 0 1 Sutton, Mr. Frederick male 61.0 0 0 36963 32.3208 D50 S
630 631 1 1 Barkworth, Mr. Algernon Henry Wilson male 80.0 0 0 27042 30.0 A23 S
632 633 1 1 Stahelin-Maeglin, Dr. Max male 32.0 0 0 13214 30.5 B50 C
645 646 1 1 Harper, Mr. Henry Sleeper male 48.0 1 0 PC 17572 76.7292 D33 C
647 648 1 1 Simonius-Blumer, Col. Oberst Alfons male 56.0 0 0 13213 35.5 A26 C
659 660 0 1 Newell, Mr. Arthur Webster male 58.0 0 2 35273 113.275 D48 C
662 663 0 1 Colley, Mr. Edward Pomeroy male 47.0 0 0 5727 25.5875 E58 S
671 672 0 1 Davidson, Mr. Thornton male 31.0 1 0 F.C. 12750 52.0 B71 S
679 680 1 1 Cardeza, Mr. Thomas Drake Martinez male 36.0 0 1 PC 17755 512.3292 B51 B53 B55 C
690 691 1 1 Dick, Mr. Albert Adrian male 31.0 1 0 17474 57.0 B20 S
698 699 0 1 Thayer, Mr. John Borland male 49.0 1 1 17421 110.8833 C68 C
699 700 0 3 Humblen, Mr. Adolf Mathias Nicolai Olsen male 42.0 0 0 348121 7.65 F G63 S
701 702 1 1 Silverthorne, Mr. Spencer Victor male 35.0 0 0 PC 17475 26.2875 E24 S
707 708 1 1 Calderhead, Mr. Edward Pennington male 42.0 0 0 PC 17476 26.2875 E24 S
712 713 1 1 Taylor, Mr. Elmer Zebley male 48.0 1 0 19996 52.0 C126 S
716 717 1 1 Endres, Miss. Caroline Louise female 38.0 0 0 PC 17757 227.525 C45 C
737 738 1 1 Lesurer, Mr. Gustave J male 35.0 0 0 PC 17755 512.3292 B101 C
741 742 0 1 Cavendish, Mr. Tyrell William male 36.0 1 0 19877 78.85 C46 S
745 746 0 1 Crosby, Capt. Edward Gifford male 70.0 1 1 WE/P 5735 71.0 B22 S
759 760 1 1 Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards) female 33.0 0 0 110152 86.5 B77 S
763 764 1 1 Carter, Mrs. William Ernest (Lucile Polk) female 36.0 1 2 113760 120.0 B96 B98 S
765 766 1 1 Hogeboom, Mrs. John C (Anna Andrews) female 51.0 1 0 13502 77.9583 D11 S
772 773 0 2 Mack, Mrs. (Mary) female 57.0 0 0 S.O./P.P. 3 10.5 E77 S
779 780 1 1 Robert, Mrs. Edward Scott (Elisabeth Walton McMillan) female 43.0 0 1 24160 211.3375 B3 S
789 790 0 1 Guggenheim, Mr. Benjamin male 46.0 0 0 PC 17593 79.2 B82 B84 C
796 797 1 1 Leader, Dr. Alice (Farnham) female 49.0 0 0 17465 25.9292 D17 S
806 807 0 1 Andrews, Mr. Thomas Jr male 39.0 0 0 112050 0.0 A36 S
809 810 1 1 Chambers, Mrs. Norman Campbell (Bertha Griggs) female 33.0 1 0 113806 53.1 E8 S
820 821 1 1 Hays, Mrs. Charles Melville (Clara Jennings Gregg) female 52.0 1 1 12749 93.5 B69 S
835 836 1 1 Compton, Miss. Sara Rebecca female 39.0 1 1 PC 17756 83.1583 E49 C
857 858 1 1 Daly, Mr. Peter Denis male 51.0 0 0 113055 26.55 E17 S
862 863 1 1 Swift, Mrs. Frederick Joel (Margaret Welles Barron) female 48.0 0 0 17466 25.9292 D17 S
867 868 0 1 Roebling, Mr. Washington Augustus II male 31.0 0 0 PC 17590 50.4958 A24 S
871 872 1 1 Beckwith, Mrs. Richard Leonard (Sallie Monypeny) female 47.0 1 1 11751 52.5542 D35 S
872 873 0 1 Carlsson, Mr. Frans Olof male 33.0 0 0 695 5.0 B51 B53 B55 S
879 880 1 1 Potter, Mrs. Thomas Jr (Lily Alexenia Wilson) female 56.0 0 1 11767 83.1583 C50 C

This will return a new DataFrame with only the rows where the ‘Age’ column is greater than 30.

Modifying the data

Changing columns

To create a new column, you can use the dot notation:

titanic_df['Age_squared'] = titanic_df['Age'] ** 2

This will add a new column to the DataFrame called ‘Age_squared,’ the square of the ‘Age’ column.

titanic_df['Age_squared']
1      1444.0
3      1225.0
6      2916.0
10       16.0
11     3364.0
        ...  
871    2209.0
872    1089.0
879    3136.0
887     361.0
889     676.0
Name: Age_squared, Length: 183, dtype: float64

Dropping columns

To drop a column, you can use the drop method:

titanic_df.drop('Age_squared', axis=1)

This will return a new DataFrame with the ‘Age_squared’ column removed.

index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Thayer) female 38.0 1 0 PC 17599 71.2833 C85 C
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1 C123 S
6 7 0 1 McCarthy, Mr. Timothy J male 54.0 0 0 17463 51.8625 E46 S
10 11 1 3 Sandstrom, Miss. Marguerite Rut female 4.0 1 1 PP 9549 16.7 G6 S
11 12 1 1 Bonnell, Miss. Elizabeth female 58.0 0 0 113783 26.55 C103 S
21 22 1 2 Beesley, Mr. Lawrence male 34.0 0 0 248698 13.0 D56 S
23 24 1 1 Sloper, Mr. William Thompson male 28.0 0 0 113788 35.5 A6 S
27 28 0 1 Fortune, Mr. Charles Alexander male 19.0 3 2 19950 263.0 C23 C25 C27 S
52 53 1 1 Harper, Mrs. Henry Sleeper (Myna Haxtun) female 49.0 1 0 PC 17572 76.7292 D33 C
54 55 0 1 Ostby, Mr. Engelhart Cornelius male 65.0 0 1 113509 61.9792 B30 C
62 63 0 1 Harris, Mr. Henry Birkhardt male 45.0 1 0 36973 83.475 C83 S
66 67 1 2 Nye, Mrs. (Elizabeth Ramell) female 29.0 0 0 C.A. 29395 10.5 F33 S
75 76 0 3 Moen, Mr. Sigurd Hansen male 25.0 0 0 348123 7.65 F G73 S
88 89 1 1 Fortune, Miss. Mabel Helen female 23.0 3 2 19950 263.0 C23 C25 C27 S
92 93 0 1 Chaffee, Mr. Herbert Fuller male 46.0 1 0 W.E.P. 5734 61.175 E31 S
96 97 0 1 Goldschmidt, Mr. George B male 71.0 0 0 PC 17754 34.6542 A5 C
97 98 1 1 Greenfield, Mr. William Bertram male 23.0 0 1 PC 17759 63.3583 D10 D12 C
102 103 0 1 White, Mr. Richard Frasar male 21.0 0 1 35281 77.2875 D26 S
110 111 0 1 Porter, Mr. Walter Chamberlain male 47.0 0 0 110465 52.0 C110 S
118 119 0 1 Baxter, Mr. Quigg Edmond male 24.0 0 1 PC 17558 247.5208 B58 B60 C
123 124 1 2 Webber, Miss. Susan female 32.5 0 0 27267 13.0 E101 S
124 125 0 1 White, Mr. Percival Wayland male 54.0 0 1 35281 77.2875 D26 S
136 137 1 1 Newsom, Miss. Helen Monypeny female 19.0 0 2 11752 26.2833 D47 S
137 138 0 1 Futrelle, Mr. Jacques Heath male 37.0 1 0 113803 53.1 C123 S
139 140 0 1 Giglio, Mr. Victor male 24.0 0 0 PC 17593 79.2 B86 C
148 149 0 2 Navratil, Mr. Michel (“Louis M Hoffman”) male 36.5 0 2 230080 26.0 F2 S
151 152 1 1 Pears, Mrs. Thomas (Edith Wearne) female 22.0 1 0 113776 66.6 C2 S
170 171 0 1 Van der hoef, Mr. Wyckoff male 61.0 0 0 111240 33.5 B19 S
174 175 0 1 Smith, Mr. James Clinch male 56.0 0 0 17764 30.6958 A7 C
177 178 0 1 Isham, Miss. Ann Elizabeth female 50.0 0 0 PC 17595 28.7125 C49 C
183 184 1 2 Becker, Master. Richard F male 1.0 2 1 230136 39.0 F4 S
193 194 1 2 Navratil, Master. Michel M male 3.0 1 1 230080 26.0 F2 S
194 195 1 1 Brown, Mrs. James Joseph (Margaret Tobin) female 44.0 0 0 PC 17610 27.7208 B4 C
195 196 1 1 Lurette, Miss. Elise female 58.0 0 0 PC 17569 146.5208 B80 C
205 206 0 3 Strom, Miss. Telma Matilda female 2.0 0 1 347054 10.4625 G6 S
209 210 1 1 Blank, Mr. Henry male 40.0 0 0 112277 31.0 A31 C
215 216 1 1 Newell, Miss. Madeleine female 31.0 1 0 35273 113.275 D36 C
218 219 1 1 Bazzani, Miss. Albina female 32.0 0 0 11813 76.2917 D15 C
224 225 1 1 Hoyt, Mr. Frederick Maxfield male 38.0 1 0 19943 90.0 C93 S
230 231 1 1 Harris, Mrs. Henry Birkhardt (Irene Wallach) female 35.0 1 0 36973 83.475 C83 S
245 246 0 1 Minahan, Dr. William Edward male 44.0 2 0 19928 90.0 C78 Q
248 249 1 1 Beckwith, Mr. Richard Leonard male 37.0 1 1 11751 52.5542 D35 S
251 252 0 3 Strom, Mrs. Wilhelm (Elna Matilda Persson) female 29.0 1 1 347054 10.4625 G6 S
252 253 0 1 Stead, Mr. William Thomas male 62.0 0 0 113514 26.55 C87 S
257 258 1 1 Cherry, Miss. Gladys female 30.0 0 0 110152 86.5 B77 S
262 263 0 1 Taussig, Mr. Emil male 52.0 1 1 110413 79.65 E67 S
263 264 0 1 Harrison, Mr. William male 40.0 0 0 112059 0.0 B94 S
268 269 1 1 Graham, Mrs. William Thompson (Edith Junkins) female 58.0 0 1 PC 17582 153.4625 C125 S
269 270 1 1 Bissette, Miss. Amelia female 35.0 0 0 PC 17760 135.6333 C99 S
273 274 0 1 Natsch, Mr. Charles H male 37.0 0 1 PC 17596 29.7 C118 C
275 276 1 1 Andrews, Miss. Kornelia Theodosia female 63.0 1 0 13502 77.9583 D7 S
291 292 1 1 Bishop, Mrs. Dickinson H (Helen Walton) female 19.0 1 0 11967 91.0792 B49 C
292 293 0 2 Levy, Mr. Rene Jacques male 36.0 0 0 SC/Paris 2163 12.875 D C
297 298 0 1 Allison, Miss. Helen Loraine female 2.0 1 2 113781 151.55 C22 C26 S
299 300 1 1 Baxter, Mrs. James (Helene DeLaudeniere Chaput) female 50.0 0 1 PC 17558 247.5208 B58 B60 C
305 306 1 1 Allison, Master. Hudson Trevor male 0.92 1 2 113781 151.55 C22 C26 S
307 308 1 1 Penasco y Castellana, Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo) female 17.0 1 0 PC 17758 108.9 C65 C
309 310 1 1 Francatelli, Miss. Laura Mabel female 30.0 0 0 PC 17485 56.9292 E36 C
310 311 1 1 Hays, Miss. Margaret Bechstein female 24.0 0 0 11767 83.1583 C54 C
311 312 1 1 Ryerson, Miss. Emily Borie female 18.0 2 2 PC 17608 262.375 B57 B59 B63 B66 C
318 319 1 1 Wick, Miss. Mary Natalie female 31.0 0 2 36928 164.8667 C7 S
319 320 1 1 Spedden, Mrs. Frederic Oakley (Margaretta Corning Stone) female 40.0 1 1 16966 134.5 E34 C
325 326 1 1 Young, Miss. Marie Grice female 36.0 0 0 PC 17760 135.6333 C32 C
327 328 1 2 Ball, Mrs. (Ada E Hall) female 36.0 0 0 28551 13.0 D S
329 330 1 1 Hippach, Miss. Jean Gertrude female 16.0 0 1 111361 57.9792 B18 C
331 332 0 1 Partner, Mr. Austen male 45.5 0 0 113043 28.5 C124 S
332 333 0 1 Graham, Mr. George Edward male 38.0 0 1 PC 17582 153.4625 C91 S
336 337 0 1 Pears, Mr. Thomas Clinton male 29.0 1 0 113776 66.6 C2 S
337 338 1 1 Burns, Miss. Elizabeth Margaret female 41.0 0 0 16966 134.5 E40 C
339 340 0 1 Blackwell, Mr. Stephen Weart male 45.0 0 0 113784 35.5 T S
340 341 1 2 Navratil, Master. Edmond Roger male 2.0 1 1 230080 26.0 F2 S
341 342 1 1 Fortune, Miss. Alice Elizabeth female 24.0 3 2 19950 263.0 C23 C25 C27 S
345 346 1 2 Brown, Miss. Amelia “Mildred” female 24.0 0 0 248733 13.0 F33 S
356 357 1 1 Bowerman, Miss. Elsie Edith female 22.0 0 1 113505 55.0 E33 S
366 367 1 1 Warren, Mrs. Frank Manley (Anna Sophia Atkinson) female 60.0 1 0 110813 75.25 D37 C
369 370 1 1 Aubart, Mme. Leontine Pauline female 24.0 0 0 PC 17477 69.3 B35 C
370 371 1 1 Harder, Mr. George Achilles male 25.0 1 0 11765 55.4417 E50 C
377 378 0 1 Widener, Mr. Harry Elkins male 27.0 0 2 113503 211.5 C82 C
390 391 1 1 Carter, Mr. William Ernest male 36.0 1 2 113760 120.0 B96 B98 S
393 394 1 1 Newell, Miss. Marjorie female 23.0 1 0 35273 113.275 D36 C
394 395 1 3 Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengtsson) female 24.0 0 2 PP 9549 16.7 G6 S
412 413 1 1 Minahan, Miss. Daisy E female 33.0 1 0 19928 90.0 C78 Q
429 430 1 3 Pickard, Mr. Berk (Berk Trembisky) male 32.0 0 0 SOTON/O.Q. 392078 8.05 E10 S
430 431 1 1 Bjornstrom-Steffansson, Mr. Mauritz Hakan male 28.0 0 0 110564 26.55 C52 S
434 435 0 1 Silvey, Mr. William Baird male 50.0 1 0 13507 55.9 E44 S
435 436 1 1 Carter, Miss. Lucile Polk female 14.0 1 2 113760 120.0 B96 B98 S
438 439 0 1 Fortune, Mr. Mark male 64.0 1 4 19950 263.0 C23 C25 C27 S
445 446 1 1 Dodge, Master. Washington male 4.0 0 2 33638 81.8583 A34 S
449 450 1 1 Peuchen, Major. Arthur Godfrey male 52.0 0 0 113786 30.5 C104 S
452 453 0 1 Foreman, Mr. Benjamin Laventall male 30.0 0 0 113051 27.75 C111 C
453 454 1 1 Goldenberg, Mr. Samuel L male 49.0 1 0 17453 89.1042 C92 C
456 457 0 1 Millet, Mr. Francis Davis male 65.0 0 0 13509 26.55 E38 S
460 461 1 1 Anderson, Mr. Harry male 48.0 0 0 19952 26.55 E12 S
462 463 0 1 Gee, Mr. Arthur H male 47.0 0 0 111320 38.5 E63 S
473 474 1 2 Jerwan, Mrs. Amin S (Marie Marthe Thuillard) female 23.0 0 0 SC/AH Basle 541 13.7917 D C
484 485 1 1 Bishop, Mr. Dickinson H male 25.0 1 0 11967 91.0792 B49 C
486 487 1 1 Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby) female 35.0 1 0 19943 90.0 C93 S
487 488 0 1 Kent, Mr. Edward Austin male 58.0 0 0 11771 29.7 B37 C
492 493 0 1 Molson, Mr. Harry Markland male 55.0 0 0 113787 30.5 C30 S
496 497 1 1 Eustis, Miss. Elizabeth Mussey female 54.0 1 0 36947 78.2667 D20 C
498 499 0 1 Allison, Mrs. Hudson J C (Bessie Waldo Daniels) female 25.0 1 2 113781 151.55 C22 C26 S
504 505 1 1 Maioni, Miss. Roberta female 16.0 0 0 110152 86.5 B79 S
505 506 0 1 Penasco y Castellana, Mr. Victor de Satode male 18.0 1 0 PC 17758 108.9 C65 C
512 513 1 1 McGough, Mr. James Robert male 36.0 0 0 PC 17473 26.2875 E25 S
515 516 0 1 Walker, Mr. William Anderson male 47.0 0 0 36967 34.0208 D46 S
516 517 1 2 Lemore, Mrs. (Amelia Milley) female 34.0 0 0 C.A. 34260 10.5 F33 S
520 521 1 1 Perreault, Miss. Anne female 30.0 0 0 12749 93.5 B73 S
523 524 1 1 Hippach, Mrs. Louis Albert (Ida Sophia Fischer) female 44.0 0 1 111361 57.9792 B18 C
536 537 0 1 Butt, Major. Archibald Willingham male 45.0 0 0 113050 26.55 B38 S
539 540 1 1 Frolicher, Miss. Hedwig Margaritha female 22.0 0 2 13568 49.5 B39 C
540 541 1 1 Crosby, Miss. Harriet R female 36.0 0 2 WE/P 5735 71.0 B22 S
544 545 0 1 Douglas, Mr. Walter Donald male 50.0 1 0 PC 17761 106.425 C86 C
550 551 1 1 Thayer, Mr. John Borland Jr male 17.0 0 2 17421 110.8833 C70 C
556 557 1 1 Duff Gordon, Lady. (Lucille Christiana Sutherland) (“Mrs Morgan”) female 48.0 1 0 11755 39.6 A16 C
558 559 1 1 Taussig, Mrs. Emil (Tillie Mandelbaum) female 39.0 1 1 110413 79.65 E67 S
571 572 1 1 Appleton, Mrs. Edward Dale (Charlotte Lamson) female 53.0 2 0 11769 51.4792 C101 S
572 573 1 1 Flynn, Mr. John Irwin (“Irving”) male 36.0 0 0 PC 17474 26.3875 E25 S
577 578 1 1 Silvey, Mrs. William Baird (Alice Munger) female 39.0 1 0 13507 55.9 E44 S
581 582 1 1 Thayer, Mrs. John Borland (Marian Longstreth Morris) female 39.0 1 1 17421 110.8833 C68 C
583 584 0 1 Ross, Mr. John Hugo male 36.0 0 0 13049 40.125 A10 C
585 586 1 1 Taussig, Miss. Ruth female 18.0 0 2 110413 79.65 E68 S
587 588 1 1 Frolicher-Stehli, Mr. Maxmillian male 60.0 1 1 13567 79.2 B41 C
591 592 1 1 Stephenson, Mrs. Walter Bertram (Martha Eustis) female 52.0 1 0 36947 78.2667 D20 C
599 600 1 1 Duff Gordon, Sir. Cosmo Edmund (“Mr Morgan”) male 49.0 1 0 PC 17485 56.9292 A20 C
609 610 1 1 Shutes, Miss. Elizabeth W female 40.0 0 0 PC 17582 153.4625 C125 S
618 619 1 2 Becker, Miss. Marion Louise female 4.0 2 1 230136 39.0 F4 S
621 622 1 1 Kimball, Mr. Edwin Nelson Jr male 42.0 1 0 11753 52.5542 D19 S
625 626 0 1 Sutton, Mr. Frederick male 61.0 0 0 36963 32.3208 D50 S
627 628 1 1 Longley, Miss. Gretchen Fiske female 21.0 0 0 13502 77.9583 D9 S
630 631 1 1 Barkworth, Mr. Algernon Henry Wilson male 80.0 0 0 27042 30.0 A23 S
632 633 1 1 Stahelin-Maeglin, Dr. Max male 32.0 0 0 13214 30.5 B50 C
641 642 1 1 Sagesser, Mlle. Emma female 24.0 0 0 PC 17477 69.3 B35 C
645 646 1 1 Harper, Mr. Henry Sleeper male 48.0 1 0 PC 17572 76.7292 D33 C
647 648 1 1 Simonius-Blumer, Col. Oberst Alfons male 56.0 0 0 13213 35.5 A26 C
659 660 0 1 Newell, Mr. Arthur Webster male 58.0 0 2 35273 113.275 D48 C
662 663 0 1 Colley, Mr. Edward Pomeroy male 47.0 0 0 5727 25.5875 E58 S
671 672 0 1 Davidson, Mr. Thornton male 31.0 1 0 F.C. 12750 52.0 B71 S
679 680 1 1 Cardeza, Mr. Thomas Drake Martinez male 36.0 0 1 PC 17755 512.3292 B51 B53 B55 C
681 682 1 1 Hassab, Mr. Hammad male 27.0 0 0 PC 17572 76.7292 D49 C
689 690 1 1 Madill, Miss. Georgette Alexandra female 15.0 0 1 24160 211.3375 B5 S
690 691 1 1 Dick, Mr. Albert Adrian male 31.0 1 0 17474 57.0 B20 S
698 699 0 1 Thayer, Mr. John Borland male 49.0 1 1 17421 110.8833 C68 C
699 700 0 3 Humblen, Mr. Adolf Mathias Nicolai Olsen male 42.0 0 0 348121 7.65 F G63 S
700 701 1 1 Astor, Mrs. John Jacob (Madeleine Talmadge Force) female 18.0 1 0 PC 17757 227.525 C62 C64 C
701 702 1 1 Silverthorne, Mr. Spencer Victor male 35.0 0 0 PC 17475 26.2875 E24 S
707 708 1 1 Calderhead, Mr. Edward Pennington male 42.0 0 0 PC 17476 26.2875 E24 S
710 711 1 1 Mayne, Mlle. Berthe Antonine (“Mrs de Villiers”) female 24.0 0 0 PC 17482 49.5042 C90 C
712 713 1 1 Taylor, Mr. Elmer Zebley male 48.0 1 0 19996 52.0 C126 S
715 716 0 3 Soholt, Mr. Peter Andreas Lauritz Andersen male 19.0 0 0 348124 7.65 F G73 S
716 717 1 1 Endres, Miss. Caroline Louise female 38.0 0 0 PC 17757 227.525 C45 C
717 718 1 2 Troutt, Miss. Edwina Celia “Winnie” female 27.0 0 0 34218 10.5 E101 S
724 725 1 1 Chambers, Mr. Norman Campbell male 27.0 1 0 113806 53.1 E8 S
730 731 1 1 Allen, Miss. Elisabeth Walton female 29.0 0 0 24160 211.3375 B5 S
737 738 1 1 Lesurer, Mr. Gustave J male 35.0 0 0 PC 17755 512.3292 B101 C
741 742 0 1 Cavendish, Mr. Tyrell William male 36.0 1 0 19877 78.85 C46 S
742 743 1 1 Ryerson, Miss. Susan Parker “Suzette” female 21.0 2 2 PC 17608 262.375 B57 B59 B63 B66 C
745 746 0 1 Crosby, Capt. Edward Gifford male 70.0 1 1 WE/P 5735 71.0 B22 S
748 749 0 1 Marvin, Mr. Daniel Warner male 19.0 1 0 113773 53.1 D30 S
751 752 1 3 Moor, Master. Meier male 6.0 0 1 392096 12.475 E121 S
759 760 1 1 Rothes, the Countess. of (Lucy Noel Martha Dyer-Edwards) female 33.0 0 0 110152 86.5 B77 S
763 764 1 1 Carter, Mrs. William Ernest (Lucile Polk) female 36.0 1 2 113760 120.0 B96 B98 S
765 766 1 1 Hogeboom, Mrs. John C (Anna Andrews) female 51.0 1 0 13502 77.9583 D11 S
772 773 0 2 Mack, Mrs. (Mary) female 57.0 0 0 S.O./P.P. 3 10.5 E77 S
779 780 1 1 Robert, Mrs. Edward Scott (Elisabeth Walton McMillan) female 43.0 0 1 24160 211.3375 B3 S
781 782 1 1 Dick, Mrs. Albert Adrian (Vera Gillespie) female 17.0 1 0 17474 57.0 B20 S
782 783 0 1 Long, Mr. Milton Clyde male 29.0 0 0 113501 30.0 D6 S
789 790 0 1 Guggenheim, Mr. Benjamin male 46.0 0 0 PC 17593 79.2 B82 B84 C
796 797 1 1 Leader, Dr. Alice (Farnham) female 49.0 0 0 17465 25.9292 D17 S
802 803 1 1 Carter, Master. William Thornton II male 11.0 1 2 113760 120.0 B96 B98 S
806 807 0 1 Andrews, Mr. Thomas Jr male 39.0 0 0 112050 0.0 A36 S
809 810 1 1 Chambers, Mrs. Norman Campbell (Bertha Griggs) female 33.0 1 0 113806 53.1 E8 S
820 821 1 1 Hays, Mrs. Charles Melville (Clara Jennings Gregg) female 52.0 1 1 12749 93.5 B69 S
823 824 1 3 Moor, Mrs. (Beila) female 27.0 0 1 392096 12.475 E121 S
835 836 1 1 Compton, Miss. Sara Rebecca female 39.0 1 1 PC 17756 83.1583 E49 C
853 854 1 1 Lines, Miss. Mary Conover female 16.0 0 1 PC 17592 39.4 D28 S
857 858 1 1 Daly, Mr. Peter Denis male 51.0 0 0 113055 26.55 E17 S
862 863 1 1 Swift, Mrs. Frederick Joel (Margaret Welles Barron) female 48.0 0 0 17466 25.9292 D17 S
867 868 0 1 Roebling, Mr. Washington Augustus II male 31.0 0 0 PC 17590 50.4958 A24 S
871 872 1 1 Beckwith, Mrs. Richard Leonard (Sallie Monypeny) female 47.0 1 1 11751 52.5542 D35 S
872 873 0 1 Carlsson, Mr. Frans Olof male 33.0 0 0 695 5.0 B51 B53 B55 S
879 880 1 1 Potter, Mrs. Thomas Jr (Lily Alexenia Wilson) female 56.0 0 1 11767 83.1583 C50 C
887 888 1 1 Graham, Miss. Margaret Edith female 19.0 0 0 112053 30.0 B42 S
889 890 1 1 Behr, Mr. Karl Howell male 26.0 0 0 111369 30.0 C148 C
183 rows × 12 columns

Data sorting

With sort_values() function, we sort values in ascending or descending order.

# Who paid too few
titanic_df.sort_values('Fare').head()
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Age_squared
806 807 0 1 Andrews, Mr. Thomas Jr NaN 39.0 0 0 112050 0.0 A36 S 1521.0
263 264 0 1 Harrison, Mr. William NaN 40.0 0 0 112059 0.0 B94 S 1600.0
872 873 0 1 Carlsson, Mr. Frans Olof NaN 33.0 0 0 695 5.0 B51 B53 B55 S 1089.0
715 716 0 3 Soholt, Mr. Peter Andreas Lauritz Andersen NaN 19.0 0 0 348124 7.65 F G73 S 361.0
699 700 0 3 Humblen, Mr. Adolf Mathias Nicolai Olsen NaN 42.0 0 0 348121 7.65 F G63 S 1764.0
# Who paid too much
titanic_df.sort_values('Fare', ascending=False).head()
index PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Age_squared
737 738 1 1 Lesurer, Mr. Gustave J NaN 35.0 0 0 PC 17755 512.3292 B101 C 1225.0
679 680 1 1 Cardeza, Mr. Thomas Drake Martinez NaN 36.0 0 1 PC 17755 512.3292 B51 B53 B55 C 1296.0
88 89 1 1 Fortune, Miss. Mabel Helen NaN 23.0 3 2 19950 263.0 C23 C25 C27 S 529.0
27 28 0 1 Fortune, Mr. Charles Alexander NaN 19.0 3 2 19950 263.0 C23 C25 C27 S 361.0
438 439 0 1 Fortune, Mr. Mark NaN 64.0 1 4 19950 263.0 C23 C25 C27 S 4096.0

Data Transformation

Pandas provides a wide range of data transformation functions, such as encoding, scaling, and normalization, which can be used to prepare the data for analysis.

For instance, the map function is used to apply a function or mapping to each element in a Pandas Series (i.e., a single column of a DataFrame). In the example above, the map function converts the strings in the ‘Sex’ column to numeric values (0 for ‘male’ and 1 for ‘female’).

# Use the map function to convert the 'Sex' column to a numeric value
titanic_df['Sex'] = titanic_df['Sex'].map({'male': 0, 'female': 1})
titanic_df['Sex'][:10]
1     1
3     1
6     0
10    1
11    1
21    0
23    0
27    0
52    1
54    0
Name: Sex, dtype: int64

Visualising data

The pyplot is a module in the matplotlib library in Python that provides functions for creating various plots and charts. It offers a simple, procedural interface to the underlying object-oriented plotting library in matplotlib. It provides functions for creating graphs, such as line plots, scatter plots, histograms, and bar charts, and for customizing the appearance of the plots, such as setting the axis labels, titles, and legends. It is often used with other data visualization libraries such as pandas and seaborn.

Bar plots

For instance, a Bar plot of the number of survivors by class can be created using the bar method of the plot function in Pandas. It can help to identify any differences in survival rates between the different classes.

Notice how the groupby function is used to group the data by class. The sum function calculates the number of survivors in each class. The plot.bar() method is then used to create the bar plot, and the title(), xlabel(), and ylabel() functions are used to add a title and labels to the plot. Finally, the show function is used to display the plot. To arrange the bars in a bar plot by their values, you can use the sort_values function before creating the plot.

import matplotlib.pyplot as plt

# Load the Titanic dataset
# titanic_df = pd.read_csv('titanic.csv')

# Group the data by class and calculate the number of survivors in each class
survival_by_class = titanic_df.groupby('Pclass')['Survived'].sum()

# Sort the values by the number of survivors
survival_by_class = survival_by_class.sort_values()

# Create a bar plot of the number of survivors by class
survival_by_class.plot.bar()

# Add a title and labels to the plot
plt.title('Number of survivors by class')
plt.xlabel('Class')
plt.ylabel('Number of survivors')

# Show the plot
plt.show()
Bar plot

This will create a bar plot showing the number of survivors by class, with the bars arranged in ascending order by the number of survivors.

Scatter plots

The scatter plot of age vs. fare plot can be created using the scatter method of the plot function in Pandas, and it can help identify any relationships between these two variables.

import pandas as pd
# Create a scatter plot of age vs fare
titanic_df.plot.scatter(x='Age', y='Fare')

# Add a title and labels to the plot
plt.title('Age vs Fare')
plt.xlabel('Age')
plt.ylabel('Fare')

# Show the plot
plt.show()
Scatter plot

This will create a scatter plot showing the relationship between age and fare paid. The plot.scatter() method is used to create the scatter plot. Finally, the show() function is used to display the plot.

To color the dots in the scatter plot based on the values in a column, you will need to use a scatterplot function from the seaborn library rather than the scatter function from Pandas. Here is an example of how to do this:

import seaborn as sns
sns.scatterplot(x='Age', y='Fare', hue='Sex', data=titanic_df)

# Add a title and labels to the plot
plt.title('Age vs Fare')
plt.xlabel('Age')
plt.ylabel('Fare')

# Show the plot
plt.show()
Seaborn Scatter plot

This will create a scatter plot showing the relationship between age and fare paid, with the dots colored red for females and blue for males. The hue parameter is used to specify the column to use for the colors.

Histograms

The histogram of the age plot can be created using the hist method of the plot function in Pandas, and it can help visualize the age distribution among the passengers.

To create a histogram of the ages of the passengers using the Pandas library, you can use the hist method of the plot function. Here is an example of how to do this:

# Create a histogram of the ages of the passengers
titanic_df['Age'].plot.hist()

# Add a title and labels to the plot
plt.title('Age distribution of passengers')
plt.xlabel('Age')
plt.ylabel('Number of passengers')

# Show the plot
plt.show()
Age distribution plot

This will create a histogram showing the distribution of ages among the passengers. The plot.hist() method is used to create the histogram

Box plots

The box plot of fare by class can be created using the box method of the plot function in Pandas. It can help identify differences in fares paid between the different passenger classes.

To create a box plot of the fare paid by class using the Pandas library, you can use the box method of the plot function.

# Create a box plot of the fare by class
titanic_df.boxplot(column='Fare', by='Pclass')

# Add a title and labels to the plot
plt.title('Fare by class')
plt.xlabel('Class')
plt.ylabel('Fare')

# Show the plot
plt.show()
Box plot fare by class

This will create a box plot showing the distribution of fare paid by class. The boxplot function is used to create the box plot.

Heatmaps

The heatmap of survival by class and gender plot can be created using the heatmap function from the seaborn library, and it can help identify any patterns in survival rates by class and gender.

Here is an example of how to create a heatmap using the seaborn library to visualize patterns in survival rates by class and gender. Notice that we did not encode the gender column in this code.

# Draw a heatmap function from the seaborn library to identify patterns in survival rates by class and gender.
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

# Load the Titanic dataset
# titanic_df = pd.read_csv('titanic.csv')

# Pivot the data to create a survival rate by class and gender
pivoted = titanic_df.pivot_table(index='Pclass', columns='Sex', values='Survived', aggfunc='mean')

# Create a heatmap of the survival rate by class and gender
sns.heatmap(pivoted, cmap='Reds')

# Add a title and labels to the plot
plt.title('Survival rate by class and gender')
plt.xlabel('Gender')
plt.ylabel('Class')

# Show the plot
plt.show()
The survival rate by class and gender, heatmap

This will create a heatmap showing the survival rate by class and gender. The pivot_table function is used to pivot the data and create a survival rate by class and gender, and the heatmap function is used to generate the plot. The cmap parameter is used to specify the color map.

What about data analysis?

Excuse me? What is about the data analysis? The Pandas features above are mostly related to data exploration. Can you pinpoint the Python Pandas features related strictly to the data analysis and not to data exploration?

Yes, many of the features I listed earlier are related to data exploration, which is a step of the data analysis process. Here are some additional features of Pandas that are more specifically related to data analysis.

Statistical Analysis

Descriptive statistics

Pandas provides a wide range of statistical functions, such as mean, median, sum, and standard deviation, that can be applied to the data to gain insights into the underlying patterns and trends.

Besides using those above describe() function encompassing the statistical functions performed on the whole dataframe to calculate the mean, median, sum, standard deviation, min, and max of the fare column of the dataset:

# Calculate Mean
print(titanic_df['Fare'].mean())

# Calculate Median
print(titanic_df['Fare'].median())

# Calculate Sum
print(titanic_df['Fare'].sum())

# Calculate Standard Deviation
print(titanic_df['Fare'].std())

# Calculate the minimum value
print(titanic_df['Fare'].min())

# Calculate the maximum value
print(titanic_df['Fare'].max())
32.204207968574636
14.4542
28693.9493
49.6934285971809
0.0
512.3292

Correlation

Pandas provides functions to calculate correlation between columns of a DataFrame, which can be used to identify relationships between variables.

To calculate the correlation between fare and age columns:

correlation = titanic_df['Fare'].corr(titanic_df['Age'])
print(correlation)

0.09606669176903888

Moreover, other Python libraries, such as Scipy, provide various statistical tools to perform hypothesis testing, such as the Chi-squared test, t-test, and ANOVA, which can be used to make inferences about the data.

Data Aggregation

Pandas provides a wide range of data aggregation functions, such as groupby(), pivot_table(), and crosstab(), which can be used to summarize large datasets and extract insights from the data. These features are not exclusive to data exploration and are more related to data analysis itself and can assist in drawing inferences, making predictions, and discovering patterns from the data.

Before summarising or grouping data, it is helpful to see the list of columns in the dataframe.

titanic_df.columns
Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',
       'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],
      dtype='object')

Data Grouping

Pandas’ groupby() function allows you to group data by one or more columns and then perform aggregate functions on the groups, such as sum, mean, and count, which is helpful for data analysis tasks. For instance, to group data by the class column and calculate the mean fare for each class:

grouped = titanic_df.groupby(by='Pclass')['Fare'].mean()
print(grouped)
Pclass
1    88.683228
2    18.444447
3    11.027500
Name: Fare, dtype: float64

Pivot Tables

Pivot tables in Pandas are similar to the groupby() functionality but allow more flexibility while returning a dataframe. Pivot tables can help summarise data with the function pd.pivot_table(). The parameter “data” takes in the input dataframe. When provided with “values,” it aggregates on the specified column, “index” and “columns” are to define a column or a list of columns to group the data, “aggfunc” is a function or list of functions to aggregate the data, “fill_value” is the value to fill in the missing values, the “margins” is when we want to add a row and a column for total values (the name is defined by the “margins_name” parameter), “dropna” is True when we want to exclude the NaN (missing values), “observed” is to show the categorical data groups, and “sort” True is for sorting the result.

For instance, we can summarise our titanic dataset to count the number of surviving passengers by their passenger class, and gender and calculate the mean fare for each passenger group.

pd.pivot_table(
    data=titanic_df,
    values="Fare", 
    index=["Pclass", "Sex"], 
    columns=["Survived"], 
    aggfunc=["count", "mean"], 
    fill_value=None, 
    margins=True, 
    dropna=True, 
    margins_name='All', 
    observed=False,
    sort=True
) 
Pclass Sex count, 0 count, 1 count, All mean, 0 mean, 1 mean, All
1 female 3 91 94 110.60 105.98 106.13
1 male 77 45 122 62.89 74.64 67.23
2 female 6 70 76 18.25 22.29 21.97
2 male 91 17 108 19.49 21.10 19.74
3 female 72 72 144 19.77 12.46 16.12
3 male 300 47 347 12.20 15.58 12.66
All   549 342 891 22.12 48.40 32.20

Using Crosstab

The crosstab() function in Pandas is similar in its functionality to the pivot_table() and allows summarising data. Additionally, we can normalise the result values. For instance, we can get a normalised break down of the titanic dataset by the passenger class and their survival.

summarised_table = pd.crosstab(titanic_df['Survived'], titanic_df['Pclass'], normalize=True)
print(summarised_table)
Pclass      1    2    3
Survived               
0        0.09 0.11 0.42
1        0.15 0.10 0.13

Machine Learning

Machine learning is a subset of data analysis and is often considered a part of the data analysis process. Machine learning teaches computers to learn from data without being explicitly programmed. It involves using algorithms to analyze data, learn from it, and make predictions or decisions without human intervention. The Titanic dataset, while relatively small, contains a good amount of information, and it’s considered an excellent dataset to start learning machine learning. In my next blog post, I will go through the application of ML using the Titanic dataset. It will be simple and fun! Stay tuned.

Conclusion

Pandas is a library for data manipulation and analysis in Python. It provides data structures and functions for working with structured data, including data frames (similar to tables in a relational database) and series (similar to arrays). It is commonly used for data exploration, cleaning, and transformation. We have seen how to use Pandas to analyse and visualise the Titanic dataset. I hope this helps! Let me know if you have any questions.

In my next post, I will do more in-depth machine-learning experiments to predict the survival odds of Titanic passengers.

Did you like this post? Please let me know if you have any comments or suggestions.

Python posts that might be interesting for you



Disclaimer: I have used chatGPT while preparing this post. This is why I have listed the chatGPT in my references section. However, most of the text is rewritten by me, as a human, and spell-checked with Grammarly. All code snippets were tested in the Google Colab, and available in 
my GitHub repository

References

1. Pandas documentation

2. New Chat (chatGPT by OpenAI)

3. Code in my GitHub repository

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2023) 'Data exploration and analysis with Python Pandas', daehnhardt.com, 20 January 2023. Available at: https://daehnhardt.com/blog/2023/01/20/pandas-tutorial-with-titanic-dataset/
All Posts