In [1]:
import pandas as pd
In [2]:
df = pd.read_csv('data/src/titanic_train.csv')
In [3]:
print(df.head())
In [4]:
df.info()
In [5]:
print(len(df))
In [6]:
print(len(df.columns))
In [7]:
print(df.shape)
In [8]:
print(df.shape[0])
In [9]:
print(df.shape[1])
In [10]:
row, col = df.shape
print(row)
In [11]:
print(col)
In [12]:
print(df.size)
In [13]:
print(df.shape[0] * df.shape[1])
In [14]:
s = df['PassengerId']
print(s.head())
In [15]:
print(len(s))
In [16]:
print(s.size)
In [17]:
print(s.shape)
In [18]:
df_multiindex = df.set_index(['Sex', 'Pclass', 'Embarked', 'PassengerId'])
In [19]:
print(len(df_multiindex))
In [20]:
print(len(df_multiindex.columns))
In [21]:
print(df_multiindex.shape)
In [22]:
print(df_multiindex.size)