How do I read and write tabular data?
Data used for this tutorial:
1
2
3
Sex: Gender of passenger.
Age: Age of passenger in years.
SibSp: Number of siblings or spouses aboard.
Parch: Number of parents or children aboard.
Ticket: Ticket number of passenger.
Fare: Indicating the fare.
Cabin: Cabin number of passenger.
Embarked: Port of embarkation.
To see the first N rows of a DataFrame, use the head() method with
the required number of rows (in this case 8) as argument.
first tutorial
sheet_name
passengers
Sheet1
index=False
memory usage: 83.7+ KB
The method info() provides technical information about a
DataFrame, so let’s explain the output in more detail:
It is indeed a DataFrame.
There are 891 entries, i.e. 891 rows.
Each row has a row label (aka the index) with values ranging from
0 to 890.
The table has 12 columns. Most columns have a value for each of the
rows (all 891 values are non-null). Some columns do have missing
values and less than 891 non-null values.
The columns Name, Sex, Cabin and Embarked consists of
textual data (strings, aka object). The other columns are
numerical data with some of them whole numbers (aka integer) and
others are real numbers (aka float).
The kind of data (characters, integers,…) in the different columns
are summarized by listing the dtypes.
The approximate amount of RAM used to hold the DataFrame is provided
as well.