Datawhale- DS- Jun - 第一章:第一节数据载入及初步观察-课程

**复习:**这门课程得主要目的是通过真实的数据,以实战的方式了解数据分析的流程和熟悉数据分析python的基本操作。知道了课程的目的之后,我们接下来我们要正式的开始数据分析的实战教学,完成kaggle上泰坦尼克的任务,实战数据分析全流程。
这里有两份资料:
教材《Python for Data Analysis》和 baidu.com &
google.com(善用搜索引擎)

1 第一章:数据载入及初步观察

1.1 载入数据

数据集下载 https://www.kaggle.com/c/titanic/overview
requirement https://github.com/datawhalechina/hands-on-data-analysis

1.1.1 任务一:导入numpy和pandas

#写入代码
import numpy as np 
import pandas as pd 

【提示】如果加载失败,学会如何在你的python环境下安装numpy和pandas这两个库

1.1.2 任务二:载入数据

(1) 使用相对路径载入数据
(2) 使用绝对路径载入数据

#import train data as relative path
train = pd.read_csv("train.csv")
train.head(3)

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.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S
#import train data as absolute path
train = pd.read_csv('C:\\User\\Desktop\\datawhal_DS_Jun\\train.csv')
train.head(3)
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.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S

【提示】相对路径载入报错时,尝试使用os.getcwd()查看当前工作目录。
【思考】知道数据加载的方法后,试试pd.read_csv()和pd.read_table()的不同,如果想让他们效果一样,需要怎么做?了解一下’.tsv’和’.csv’的不同,如何加载这两个数据集?
【总结】加载的数据是所有工作的第一步,我们的工作会接触到不同的数据格式(eg:.csv;.tsv;.xlsx),但是加载的方法和思路都是一样的,在以后工作和做项目的过程中,遇到之前没有碰到的问题,要多多查资料吗,使用googel,了解业务逻辑,明白输入和输出是什么。

# compare
train = pd.read_table('C:\\Users\\Desktop\\datawhal_DS_Jun\\train.csv')
train.head(3)
PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked
0 1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/...
1 2,1,1,"Cumings, Mrs. John Bradley (Florence Br...
2 3,1,3,"Heikkinen, Miss. Laina",female,26,0,0,S...
train_1 = pd.read_table('C:\\Users\\Desktop\\datawhal_DS_Jun\\train.csv', sep = ",")
train_1.head(3)
# 因为pd.read_csv默认分隔符为,pd_read_table的默认分割符为/t,所以只需要将pd_read.csv的分隔符设置成,就和csv的输出效果一样了
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.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S

1.1.3 任务三:每1000行为一个数据模块,逐块读取

#写入代码
chunker = pd.read_csv('train.csv', chunksize=100)
for chunk in chunker:
    print(chunk)

# 用chunksize将比较大的dataframe分成若干小块来读取,这样占少内存,便于之后的数据处理.
    PassengerId  Survived  Pclass  \
0             1         0       3   
1             2         1       1   
2             3         1       3   
3             4         1       1   
4             5         0       3   
5             6         0       3   
6             7         0       1   
7             8         0       3   
8             9         1       3   
9            10         1       2   
10           11         1       3   
11           12         1       1   
12           13         0       3   
13           14         0       3   
14           15         0       3   
15           16         1       2   
16           17         0       3   
17           18         1       2   
18           19         0       3   
19           20         1       3   
20           21         0       2   
21           22         1       2   
22           23         1       3   
23           24         1       1   
24           25         0       3   
25           26         1       3   
26           27         0       3   
27           28         0       1   
28           29         1       3   
29           30         0       3   
..          ...       ...     ...   
70           71         0       2   
71           72         0       3   
72           73         0       2   
73           74         0       3   
74           75         1       3   
75           76         0       3   
76           77         0       3   
77           78         0       3   
78           79         1       2   
79           80         1       3   
80           81         0       3   
81           82         1       3   
82           83         1       3   
83           84         0       1   
84           85         1       2   
85           86         1       3   
86           87         0       3   
87           88         0       3   
88           89         1       1   
89           90         0       3   
90           91         0       3   
91           92         0       3   
92           93         0       1   
93           94         0       3   
94           95         0       3   
95           96         0       3   
96           97         0       1   
97           98         1       1   
98           99         1       2   
99          100         0       2   

                                                 Name     Sex    Age  SibSp  \
0                             Braund, Mr. Owen Harris    male  22.00      1   
1   Cumings, Mrs. John Bradley (Florence Briggs Th...  female  38.00      1   
2                              Heikkinen, Miss. Laina  female  26.00      0   
3        Futrelle, Mrs. Jacques Heath (Lily May Peel)  female  35.00      1   
4                            Allen, Mr. William Henry    male  35.00      0   
5                                    Moran, Mr. James    male    NaN      0   
6                             McCarthy, Mr. Timothy J    male  54.00      0   
7                      Palsson, Master. Gosta Leonard    male   2.00      3   
8   Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)  female  27.00      0   
9                 Nasser, Mrs. Nicholas (Adele Achem)  female  14.00      1   
10                    Sandstrom, Miss. Marguerite Rut  female   4.00      1   
11                           Bonnell, Miss. Elizabeth  female  58.00      0   
12                     Saundercock, Mr. William Henry    male  20.00      0   
13                        Andersson, Mr. Anders Johan    male  39.00      1   
14               Vestrom, Miss. Hulda Amanda Adolfina  female  14.00      0   
15                   Hewlett, Mrs. (Mary D Kingcome)   female  55.00      0   
16                               Rice, Master. Eugene    male   2.00      4   
17                       Williams, Mr. Charles Eugene    male    NaN      0   
18  Vander Planke, Mrs. Julius (Emelia Maria Vande...  female  31.00      1   
19                            Masselmani, Mrs. Fatima  female    NaN      0   
20                               Fynney, Mr. Joseph J    male  35.00      0   
21                              Beesley, Mr. Lawrence    male  34.00      0   
22                        McGowan, Miss. Anna "Annie"  female  15.00      0   
23                       Sloper, Mr. William Thompson    male  28.00      0   
24                      Palsson, Miss. Torborg Danira  female   8.00      3   
25  Asplund, Mrs. Carl Oscar (Selma Augusta Emilia...  female  38.00      1   
26                            Emir, Mr. Farred Chehab    male    NaN      0   
27                     Fortune, Mr. Charles Alexander    male  19.00      3   
28                      O'Dwyer, Miss. Ellen "Nellie"  female    NaN      0   
29                                Todoroff, Mr. Lalio    male    NaN      0   
..                                                ...     ...    ...    ...   
70                         Jenkin, Mr. Stephen Curnow    male  32.00      0   
71                         Goodwin, Miss. Lillian Amy  female  16.00      5   
72                               Hood, Mr. Ambrose Jr    male  21.00      0   
73                        Chronopoulos, Mr. Apostolos    male  26.00      1   
74                                      Bing, Mr. Lee    male  32.00      0   
75                            Moen, Mr. Sigurd Hansen    male  25.00      0   
76                                  Staneff, Mr. Ivan    male    NaN      0   
77                           Moutal, Mr. Rahamin Haim    male    NaN      0   
78                      Caldwell, Master. Alden Gates    male   0.83      0   
79                           Dowdell, Miss. Elizabeth  female  30.00      0   
80                               Waelens, Mr. Achille    male  22.00      0   
81                        Sheerlinck, Mr. Jan Baptist    male  29.00      0   
82                     McDermott, Miss. Brigdet Delia  female    NaN      0   
83                            Carrau, Mr. Francisco M    male  28.00      0   
84                                Ilett, Miss. Bertha  female  17.00      0   
85  Backstrom, Mrs. Karl Alfred (Maria Mathilda Gu...  female  33.00      3   
86                             Ford, Mr. William Neal    male  16.00      1   
87                      Slocovski, Mr. Selman Francis    male    NaN      0   
88                         Fortune, Miss. Mabel Helen  female  23.00      3   
89                             Celotti, Mr. Francesco    male  24.00      0   
90                               Christmann, Mr. Emil    male  29.00      0   
91                         Andreasson, Mr. Paul Edvin    male  20.00      0   
92                        Chaffee, Mr. Herbert Fuller    male  46.00      1   
93                            Dean, Mr. Bertram Frank    male  26.00      1   
94                                  Coxon, Mr. Daniel    male  59.00      0   
95                        Shorney, Mr. Charles Joseph    male    NaN      0   
96                          Goldschmidt, Mr. George B    male  71.00      0   
97                    Greenfield, Mr. William Bertram    male  23.00      0   
98               Doling, Mrs. John T (Ada Julia Bone)  female  34.00      0   
99                                  Kantor, Mr. Sinai    male  34.00      1   

    Parch            Ticket      Fare        Cabin Embarked  
0       0         A/5 21171    7.2500          NaN        S  
1       0          PC 17599   71.2833          C85        C  
2       0  STON/O2. 3101282    7.9250          NaN        S  
3       0            113803   53.1000         C123        S  
4       0            373450    8.0500          NaN        S  
5       0            330877    8.4583          NaN        Q  
6       0             17463   51.8625          E46        S  
7       1            349909   21.0750          NaN        S  
8       2            347742   11.1333          NaN        S  
9       0            237736   30.0708          NaN        C  
10      1           PP 9549   16.7000           G6        S  
11      0            113783   26.5500         C103        S  
12      0         A/5. 2151    8.0500          NaN        S  
13      5            347082   31.2750          NaN        S  
14      0            350406    7.8542          NaN        S  
15      0            248706   16.0000          NaN        S  
16      1            382652   29.1250          NaN        Q  
17      0            244373   13.0000          NaN        S  
18      0            345763   18.0000          NaN        S  
19      0              2649    7.2250          NaN        C  
20      0            239865   26.0000          NaN        S  
21      0            248698   13.0000          D56        S  
22      0            330923    8.0292          NaN        Q  
23      0            113788   35.5000           A6        S  
24      1            349909   21.0750          NaN        S  
25      5            347077   31.3875          NaN        S  
26      0              2631    7.2250          NaN        C  
27      2             19950  263.0000  C23 C25 C27        S  
28      0            330959    7.8792          NaN        Q  
29      0            349216    7.8958          NaN        S  
..    ...               ...       ...          ...      ...  
70      0        C.A. 33111   10.5000          NaN        S  
71      2           CA 2144   46.9000          NaN        S  
72      0      S.O.C. 14879   73.5000          NaN        S  
73      0              2680   14.4542          NaN        C  
74      0              1601   56.4958          NaN        S  
75      0            348123    7.6500        F G73        S  
76      0            349208    7.8958          NaN        S  
77      0            374746    8.0500          NaN        S  
78      2            248738   29.0000          NaN        S  
79      0            364516   12.4750          NaN        S  
80      0            345767    9.0000          NaN        S  
81      0            345779    9.5000          NaN        S  
82      0            330932    7.7875          NaN        Q  
83      0            113059   47.1000          NaN        S  
84      0        SO/C 14885   10.5000          NaN        S  
85      0           3101278   15.8500          NaN        S  
86      3        W./C. 6608   34.3750          NaN        S  
87      0   SOTON/OQ 392086    8.0500          NaN        S  
88      2             19950  263.0000  C23 C25 C27        S  
89      0            343275    8.0500          NaN        S  
90      0            343276    8.0500          NaN        S  
91      0            347466    7.8542          NaN        S  
92      0       W.E.P. 5734   61.1750          E31        S  
93      2         C.A. 2315   20.5750          NaN        S  
94      0            364500    7.2500          NaN        S  
95      0            374910    8.0500          NaN        S  
96      0          PC 17754   34.6542           A5        C  
97      1          PC 17759   63.3583      D10 D12        C  
98      1            231919   23.0000          NaN        S  
99      0            244367   26.0000          NaN        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
100          101         0       3   
101          102         0       3   
102          103         0       1   
103          104         0       3   
104          105         0       3   
105          106         0       3   
106          107         1       3   
107          108         1       3   
108          109         0       3   
109          110         1       3   
110          111         0       1   
111          112         0       3   
112          113         0       3   
113          114         0       3   
114          115         0       3   
115          116         0       3   
116          117         0       3   
117          118         0       2   
118          119         0       1   
119          120         0       3   
120          121         0       2   
121          122         0       3   
122          123         0       2   
123          124         1       2   
124          125         0       1   
125          126         1       3   
126          127         0       3   
127          128         1       3   
128          129         1       3   
129          130         0       3   
..           ...       ...     ...   
170          171         0       1   
171          172         0       3   
172          173         1       3   
173          174         0       3   
174          175         0       1   
175          176         0       3   
176          177         0       3   
177          178         0       1   
178          179         0       2   
179          180         0       3   
180          181         0       3   
181          182         0       2   
182          183         0       3   
183          184         1       2   
184          185         1       3   
185          186         0       1   
186          187         1       3   
187          188         1       1   
188          189         0       3   
189          190         0       3   
190          191         1       2   
191          192         0       2   
192          193         1       3   
193          194         1       2   
194          195         1       1   
195          196         1       1   
196          197         0       3   
197          198         0       3   
198          199         1       3   
199          200         0       2   

                                                Name     Sex   Age  SibSp  \
100                          Petranec, Miss. Matilda  female  28.0      0   
101                 Petroff, Mr. Pastcho ("Pentcho")    male   NaN      0   
102                        White, Mr. Richard Frasar    male  21.0      0   
103                       Johansson, Mr. Gustaf Joel    male  33.0      0   
104                   Gustafsson, Mr. Anders Vilhelm    male  37.0      2   
105                            Mionoff, Mr. Stoytcho    male  28.0      0   
106                 Salkjelsvik, Miss. Anna Kristine  female  21.0      0   
107                           Moss, Mr. Albert Johan    male   NaN      0   
108                                  Rekic, Mr. Tido    male  38.0      0   
109                              Moran, Miss. Bertha  female   NaN      1   
110                   Porter, Mr. Walter Chamberlain    male  47.0      0   
111                             Zabour, Miss. Hileni  female  14.5      1   
112                           Barton, Mr. David John    male  22.0      0   
113                          Jussila, Miss. Katriina  female  20.0      1   
114                            Attalah, Miss. Malake  female  17.0      0   
115                            Pekoniemi, Mr. Edvard    male  21.0      0   
116                             Connors, Mr. Patrick    male  70.5      0   
117                  Turpin, Mr. William John Robert    male  29.0      1   
118                         Baxter, Mr. Quigg Edmond    male  24.0      0   
119                Andersson, Miss. Ellis Anna Maria  female   2.0      4   
120                      Hickman, Mr. Stanley George    male  21.0      2   
121                       Moore, Mr. Leonard Charles    male   NaN      0   
122                             Nasser, Mr. Nicholas    male  32.5      1   
123                              Webber, Miss. Susan  female  32.5      0   
124                      White, Mr. Percival Wayland    male  54.0      0   
125                     Nicola-Yarred, Master. Elias    male  12.0      1   
126                              McMahon, Mr. Martin    male   NaN      0   
127                        Madsen, Mr. Fridtjof Arne    male  24.0      0   
128                                Peter, Miss. Anna  female   NaN      1   
129                               Ekstrom, Mr. Johan    male  45.0      0   
..                                               ...     ...   ...    ...   
170                        Van der hoef, Mr. Wyckoff    male  61.0      0   
171                             Rice, Master. Arthur    male   4.0      4   
172                     Johnson, Miss. Eleanor Ileen  female   1.0      1   
173                        Sivola, Mr. Antti Wilhelm    male  21.0      0   
174                          Smith, Mr. James Clinch    male  56.0      0   
175                           Klasen, Mr. Klas Albin    male  18.0      1   
176                    Lefebre, Master. Henry Forbes    male   NaN      3   
177                       Isham, Miss. Ann Elizabeth  female  50.0      0   
178                               Hale, Mr. Reginald    male  30.0      0   
179                              Leonard, Mr. Lionel    male  36.0      0   
180                     Sage, Miss. Constance Gladys  female   NaN      8   
181                                 Pernot, Mr. Rene    male   NaN      0   
182            Asplund, Master. Clarence Gustaf Hugo    male   9.0      4   
183                        Becker, Master. Richard F    male   1.0      2   
184              Kink-Heilmann, Miss. Luise Gretchen  female   4.0      0   
185                            Rood, Mr. Hugh Roscoe    male   NaN      0   
186  O'Brien, Mrs. Thomas (Johanna "Hannah" Godfrey)  female   NaN      1   
187    Romaine, Mr. Charles Hallace ("Mr C Rolmane")    male  45.0      0   
188                                 Bourke, Mr. John    male  40.0      1   
189                              Turcin, Mr. Stjepan    male  36.0      0   
190                              Pinsky, Mrs. (Rosa)  female  32.0      0   
191                            Carbines, Mr. William    male  19.0      0   
192  Andersen-Jensen, Miss. Carla Christine Nielsine  female  19.0      1   
193                       Navratil, Master. Michel M    male   3.0      1   
194        Brown, Mrs. James Joseph (Margaret Tobin)  female  44.0      0   
195                             Lurette, Miss. Elise  female  58.0      0   
196                              Mernagh, Mr. Robert    male   NaN      0   
197                 Olsen, Mr. Karl Siegwart Andreas    male  42.0      0   
198                 Madigan, Miss. Margaret "Maggie"  female   NaN      0   
199           Yrois, Miss. Henriette ("Mrs Harbeck")  female  24.0      0   

     Parch             Ticket      Fare    Cabin Embarked  
100      0             349245    7.8958      NaN        S  
101      0             349215    7.8958      NaN        S  
102      1              35281   77.2875      D26        S  
103      0               7540    8.6542      NaN        S  
104      0            3101276    7.9250      NaN        S  
105      0             349207    7.8958      NaN        S  
106      0             343120    7.6500      NaN        S  
107      0             312991    7.7750      NaN        S  
108      0             349249    7.8958      NaN        S  
109      0             371110   24.1500      NaN        Q  
110      0             110465   52.0000     C110        S  
111      0               2665   14.4542      NaN        C  
112      0             324669    8.0500      NaN        S  
113      0               4136    9.8250      NaN        S  
114      0               2627   14.4583      NaN        C  
115      0  STON/O 2. 3101294    7.9250      NaN        S  
116      0             370369    7.7500      NaN        Q  
117      0              11668   21.0000      NaN        S  
118      1           PC 17558  247.5208  B58 B60        C  
119      2             347082   31.2750      NaN        S  
120      0       S.O.C. 14879   73.5000      NaN        S  
121      0          A4. 54510    8.0500      NaN        S  
122      0             237736   30.0708      NaN        C  
123      0              27267   13.0000     E101        S  
124      1              35281   77.2875      D26        S  
125      0               2651   11.2417      NaN        C  
126      0             370372    7.7500      NaN        Q  
127      0            C 17369    7.1417      NaN        S  
128      1               2668   22.3583    F E69        C  
129      0             347061    6.9750      NaN        S  
..     ...                ...       ...      ...      ...  
170      0             111240   33.5000      B19        S  
171      1             382652   29.1250      NaN        Q  
172      1             347742   11.1333      NaN        S  
173      0  STON/O 2. 3101280    7.9250      NaN        S  
174      0              17764   30.6958       A7        C  
175      1             350404    7.8542      NaN        S  
176      1               4133   25.4667      NaN        S  
177      0           PC 17595   28.7125      C49        C  
178      0             250653   13.0000      NaN        S  
179      0               LINE    0.0000      NaN        S  
180      2           CA. 2343   69.5500      NaN        S  
181      0      SC/PARIS 2131   15.0500      NaN        C  
182      2             347077   31.3875      NaN        S  
183      1             230136   39.0000       F4        S  
184      2             315153   22.0250      NaN        S  
185      0             113767   50.0000      A32        S  
186      0             370365   15.5000      NaN        Q  
187      0             111428   26.5500      NaN        S  
188      1             364849   15.5000      NaN        Q  
189      0             349247    7.8958      NaN        S  
190      0             234604   13.0000      NaN        S  
191      0              28424   13.0000      NaN        S  
192      0             350046    7.8542      NaN        S  
193      1             230080   26.0000       F2        S  
194      0           PC 17610   27.7208       B4        C  
195      0           PC 17569  146.5208      B80        C  
196      0             368703    7.7500      NaN        Q  
197      1               4579    8.4042      NaN        S  
198      0             370370    7.7500      NaN        Q  
199      0             248747   13.0000      NaN        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
200          201         0       3   
201          202         0       3   
202          203         0       3   
203          204         0       3   
204          205         1       3   
205          206         0       3   
206          207         0       3   
207          208         1       3   
208          209         1       3   
209          210         1       1   
210          211         0       3   
211          212         1       2   
212          213         0       3   
213          214         0       2   
214          215         0       3   
215          216         1       1   
216          217         1       3   
217          218         0       2   
218          219         1       1   
219          220         0       2   
220          221         1       3   
221          222         0       2   
222          223         0       3   
223          224         0       3   
224          225         1       1   
225          226         0       3   
226          227         1       2   
227          228         0       3   
228          229         0       2   
229          230         0       3   
..           ...       ...     ...   
270          271         0       1   
271          272         1       3   
272          273         1       2   
273          274         0       1   
274          275         1       3   
275          276         1       1   
276          277         0       3   
277          278         0       2   
278          279         0       3   
279          280         1       3   
280          281         0       3   
281          282         0       3   
282          283         0       3   
283          284         1       3   
284          285         0       1   
285          286         0       3   
286          287         1       3   
287          288         0       3   
288          289         1       2   
289          290         1       3   
290          291         1       1   
291          292         1       1   
292          293         0       2   
293          294         0       3   
294          295         0       3   
295          296         0       1   
296          297         0       3   
297          298         0       1   
298          299         1       1   
299          300         1       1   

                                                Name     Sex   Age  SibSp  \
200                   Vande Walle, Mr. Nestor Cyriel    male  28.0      0   
201                              Sage, Mr. Frederick    male   NaN      8   
202                       Johanson, Mr. Jakob Alfred    male  34.0      0   
203                             Youseff, Mr. Gerious    male  45.5      0   
204                         Cohen, Mr. Gurshon "Gus"    male  18.0      0   
205                       Strom, Miss. Telma Matilda  female   2.0      0   
206                       Backstrom, Mr. Karl Alfred    male  32.0      1   
207                      Albimona, Mr. Nassef Cassem    male  26.0      0   
208                        Carr, Miss. Helen "Ellen"  female  16.0      0   
209                                 Blank, Mr. Henry    male  40.0      0   
210                                   Ali, Mr. Ahmed    male  24.0      0   
211                       Cameron, Miss. Clear Annie  female  35.0      0   
212                           Perkin, Mr. John Henry    male  22.0      0   
213                      Givard, Mr. Hans Kristensen    male  30.0      0   
214                              Kiernan, Mr. Philip    male   NaN      1   
215                          Newell, Miss. Madeleine  female  31.0      1   
216                           Honkanen, Miss. Eliina  female  27.0      0   
217                     Jacobsohn, Mr. Sidney Samuel    male  42.0      1   
218                            Bazzani, Miss. Albina  female  32.0      0   
219                               Harris, Mr. Walter    male  30.0      0   
220                   Sunderland, Mr. Victor Francis    male  16.0      0   
221                             Bracken, Mr. James H    male  27.0      0   
222                          Green, Mr. George Henry    male  51.0      0   
223                             Nenkoff, Mr. Christo    male   NaN      0   
224                     Hoyt, Mr. Frederick Maxfield    male  38.0      1   
225                     Berglund, Mr. Karl Ivar Sven    male  22.0      0   
226                        Mellors, Mr. William John    male  19.0      0   
227                  Lovell, Mr. John Hall ("Henry")    male  20.5      0   
228                        Fahlstrom, Mr. Arne Jonas    male  18.0      0   
229                          Lefebre, Miss. Mathilde  female   NaN      3   
..                                               ...     ...   ...    ...   
270                            Cairns, Mr. Alexander    male   NaN      0   
271                     Tornquist, Mr. William Henry    male  25.0      0   
272        Mellinger, Mrs. (Elizabeth Anne Maidment)  female  41.0      0   
273                            Natsch, Mr. Charles H    male  37.0      0   
274                       Healy, Miss. Hanora "Nora"  female   NaN      0   
275                Andrews, Miss. Kornelia Theodosia  female  63.0      1   
276                Lindblom, Miss. Augusta Charlotta  female  45.0      0   
277                      Parkes, Mr. Francis "Frank"    male   NaN      0   
278                               Rice, Master. Eric    male   7.0      4   
279                 Abbott, Mrs. Stanton (Rosa Hunt)  female  35.0      1   
280                                 Duane, Mr. Frank    male  65.0      0   
281                 Olsson, Mr. Nils Johan Goransson    male  28.0      0   
282                        de Pelsmaeker, Mr. Alfons    male  16.0      0   
283                       Dorking, Mr. Edward Arthur    male  19.0      0   
284                       Smith, Mr. Richard William    male   NaN      0   
285                              Stankovic, Mr. Ivan    male  33.0      0   
286                          de Mulder, Mr. Theodore    male  30.0      0   
287                             Naidenoff, Mr. Penko    male  22.0      0   
288                             Hosono, Mr. Masabumi    male  42.0      0   
289                             Connolly, Miss. Kate  female  22.0      0   
290                     Barber, Miss. Ellen "Nellie"  female  26.0      0   
291          Bishop, Mrs. Dickinson H (Helen Walton)  female  19.0      1   
292                           Levy, Mr. Rene Jacques    male  36.0      0   
293                              Haas, Miss. Aloisia  female  24.0      0   
294                                 Mineff, Mr. Ivan    male  24.0      0   
295                                Lewy, Mr. Ervin G    male   NaN      0   
296                               Hanna, Mr. Mansour    male  23.5      0   
297                     Allison, Miss. Helen Loraine  female   2.0      1   
298                            Saalfeld, Mr. Adolphe    male   NaN      0   
299  Baxter, Mrs. James (Helene DeLaudeniere Chaput)  female  50.0      0   

     Parch              Ticket      Fare    Cabin Embarked  
200      0              345770    9.5000      NaN        S  
201      2            CA. 2343   69.5500      NaN        S  
202      0             3101264    6.4958      NaN        S  
203      0                2628    7.2250      NaN        C  
204      0            A/5 3540    8.0500      NaN        S  
205      1              347054   10.4625       G6        S  
206      0             3101278   15.8500      NaN        S  
207      0                2699   18.7875      NaN        C  
208      0              367231    7.7500      NaN        Q  
209      0              112277   31.0000      A31        C  
210      0  SOTON/O.Q. 3101311    7.0500      NaN        S  
211      0        F.C.C. 13528   21.0000      NaN        S  
212      0           A/5 21174    7.2500      NaN        S  
213      0              250646   13.0000      NaN        S  
214      0              367229    7.7500      NaN        Q  
215      0               35273  113.2750      D36        C  
216      0    STON/O2. 3101283    7.9250      NaN        S  
217      0              243847   27.0000      NaN        S  
218      0               11813   76.2917      D15        C  
219      0           W/C 14208   10.5000      NaN        S  
220      0     SOTON/OQ 392089    8.0500      NaN        S  
221      0              220367   13.0000      NaN        S  
222      0               21440    8.0500      NaN        S  
223      0              349234    7.8958      NaN        S  
224      0               19943   90.0000      C93        S  
225      0             PP 4348    9.3500      NaN        S  
226      0           SW/PP 751   10.5000      NaN        S  
227      0           A/5 21173    7.2500      NaN        S  
228      0              236171   13.0000      NaN        S  
229      1                4133   25.4667      NaN        S  
..     ...                 ...       ...      ...      ...  
270      0              113798   31.0000      NaN        S  
271      0                LINE    0.0000      NaN        S  
272      1              250644   19.5000      NaN        S  
273      1            PC 17596   29.7000     C118        C  
274      0              370375    7.7500      NaN        Q  
275      0               13502   77.9583       D7        S  
276      0              347073    7.7500      NaN        S  
277      0              239853    0.0000      NaN        S  
278      1              382652   29.1250      NaN        Q  
279      1           C.A. 2673   20.2500      NaN        S  
280      0              336439    7.7500      NaN        Q  
281      0              347464    7.8542      NaN        S  
282      0              345778    9.5000      NaN        S  
283      0          A/5. 10482    8.0500      NaN        S  
284      0              113056   26.0000      A19        S  
285      0              349239    8.6625      NaN        C  
286      0              345774    9.5000      NaN        S  
287      0              349206    7.8958      NaN        S  
288      0              237798   13.0000      NaN        S  
289      0              370373    7.7500      NaN        Q  
290      0               19877   78.8500      NaN        S  
291      0               11967   91.0792      B49        C  
292      0       SC/Paris 2163   12.8750        D        C  
293      0              349236    8.8500      NaN        S  
294      0              349233    7.8958      NaN        S  
295      0            PC 17612   27.7208      NaN        C  
296      0                2693    7.2292      NaN        C  
297      2              113781  151.5500  C22 C26        S  
298      0               19988   30.5000     C106        S  
299      1            PC 17558  247.5208  B58 B60        C  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
300          301         1       3   
301          302         1       3   
302          303         0       3   
303          304         1       2   
304          305         0       3   
305          306         1       1   
306          307         1       1   
307          308         1       1   
308          309         0       2   
309          310         1       1   
310          311         1       1   
311          312         1       1   
312          313         0       2   
313          314         0       3   
314          315         0       2   
315          316         1       3   
316          317         1       2   
317          318         0       2   
318          319         1       1   
319          320         1       1   
320          321         0       3   
321          322         0       3   
322          323         1       2   
323          324         1       2   
324          325         0       3   
325          326         1       1   
326          327         0       3   
327          328         1       2   
328          329         1       3   
329          330         1       1   
..           ...       ...     ...   
370          371         1       1   
371          372         0       3   
372          373         0       3   
373          374         0       1   
374          375         0       3   
375          376         1       1   
376          377         1       3   
377          378         0       1   
378          379         0       3   
379          380         0       3   
380          381         1       1   
381          382         1       3   
382          383         0       3   
383          384         1       1   
384          385         0       3   
385          386         0       2   
386          387         0       3   
387          388         1       2   
388          389         0       3   
389          390         1       2   
390          391         1       1   
391          392         1       3   
392          393         0       3   
393          394         1       1   
394          395         1       3   
395          396         0       3   
396          397         0       3   
397          398         0       2   
398          399         0       2   
399          400         1       2   

                                                  Name     Sex    Age  SibSp  \
300           Kelly, Miss. Anna Katherine "Annie Kate"  female    NaN      0   
301                                 McCoy, Mr. Bernard    male    NaN      2   
302                    Johnson, Mr. William Cahoone Jr    male  19.00      0   
303                                Keane, Miss. Nora A  female    NaN      0   
304                  Williams, Mr. Howard Hugh "Harry"    male    NaN      0   
305                     Allison, Master. Hudson Trevor    male   0.92      1   
306                            Fleming, Miss. Margaret  female    NaN      0   
307  Penasco y Castellana, Mrs. Victor de Satode (M...  female  17.00      1   
308                                Abelson, Mr. Samuel    male  30.00      1   
309                     Francatelli, Miss. Laura Mabel  female  30.00      0   
310                     Hays, Miss. Margaret Bechstein  female  24.00      0   
311                         Ryerson, Miss. Emily Borie  female  18.00      2   
312              Lahtinen, Mrs. William (Anna Sylfven)  female  26.00      1   
313                             Hendekovic, Mr. Ignjac    male  28.00      0   
314                                 Hart, Mr. Benjamin    male  43.00      1   
315                    Nilsson, Miss. Helmina Josefina  female  26.00      0   
316                Kantor, Mrs. Sinai (Miriam Sternin)  female  24.00      1   
317                               Moraweck, Dr. Ernest    male  54.00      0   
318                           Wick, Miss. Mary Natalie  female  31.00      0   
319  Spedden, Mrs. Frederic Oakley (Margaretta Corn...  female  40.00      1   
320                                 Dennis, Mr. Samuel    male  22.00      0   
321                                   Danoff, Mr. Yoto    male  27.00      0   
322                          Slayter, Miss. Hilda Mary  female  30.00      0   
323  Caldwell, Mrs. Albert Francis (Sylvia Mae Harb...  female  22.00      1   
324                           Sage, Mr. George John Jr    male    NaN      8   
325                           Young, Miss. Marie Grice  female  36.00      0   
326                          Nysveen, Mr. Johan Hansen    male  61.00      0   
327                            Ball, Mrs. (Ada E Hall)  female  36.00      0   
328     Goldsmith, Mrs. Frank John (Emily Alice Brown)  female  31.00      1   
329                       Hippach, Miss. Jean Gertrude  female  16.00      0   
..                                                 ...     ...    ...    ...   
370                        Harder, Mr. George Achilles    male  25.00      1   
371                          Wiklund, Mr. Jakob Alfred    male  18.00      1   
372                         Beavan, Mr. William Thomas    male  19.00      0   
373                                Ringhini, Mr. Sante    male  22.00      0   
374                         Palsson, Miss. Stina Viola  female   3.00      3   
375              Meyer, Mrs. Edgar Joseph (Leila Saks)  female    NaN      1   
376                    Landergren, Miss. Aurora Adelia  female  22.00      0   
377                          Widener, Mr. Harry Elkins    male  27.00      0   
378                                Betros, Mr. Tannous    male  20.00      0   
379                        Gustafsson, Mr. Karl Gideon    male  19.00      0   
380                              Bidois, Miss. Rosalie  female  42.00      0   
381                        Nakid, Miss. Maria ("Mary")  female   1.00      0   
382                                 Tikkanen, Mr. Juho    male  32.00      0   
383  Holverson, Mrs. Alexander Oskar (Mary Aline To...  female  35.00      1   
384                             Plotcharsky, Mr. Vasil    male    NaN      0   
385                          Davies, Mr. Charles Henry    male  18.00      0   
386                    Goodwin, Master. Sidney Leonard    male   1.00      5   
387                                   Buss, Miss. Kate  female  36.00      0   
388                               Sadlier, Mr. Matthew    male    NaN      0   
389                              Lehmann, Miss. Bertha  female  17.00      0   
390                         Carter, Mr. William Ernest    male  36.00      1   
391                             Jansson, Mr. Carl Olof    male  21.00      0   
392                       Gustafsson, Mr. Johan Birger    male  28.00      2   
393                             Newell, Miss. Marjorie  female  23.00      1   
394  Sandstrom, Mrs. Hjalmar (Agnes Charlotta Bengt...  female  24.00      0   
395                                Johansson, Mr. Erik    male  22.00      0   
396                                Olsson, Miss. Elina  female  31.00      0   
397                            McKane, Mr. Peter David    male  46.00      0   
398                                   Pain, Dr. Alfred    male  23.00      0   
399                   Trout, Mrs. William H (Jessie L)  female  28.00      0   

     Parch             Ticket      Fare            Cabin Embarked  
300      0               9234    7.7500              NaN        Q  
301      0             367226   23.2500              NaN        Q  
302      0               LINE    0.0000              NaN        S  
303      0             226593   12.3500             E101        Q  
304      0           A/5 2466    8.0500              NaN        S  
305      2             113781  151.5500          C22 C26        S  
306      0              17421  110.8833              NaN        C  
307      0           PC 17758  108.9000              C65        C  
308      0          P/PP 3381   24.0000              NaN        C  
309      0           PC 17485   56.9292              E36        C  
310      0              11767   83.1583              C54        C  
311      2           PC 17608  262.3750  B57 B59 B63 B66        C  
312      1             250651   26.0000              NaN        S  
313      0             349243    7.8958              NaN        S  
314      1       F.C.C. 13529   26.2500              NaN        S  
315      0             347470    7.8542              NaN        S  
316      0             244367   26.0000              NaN        S  
317      0              29011   14.0000              NaN        S  
318      2              36928  164.8667               C7        S  
319      1              16966  134.5000              E34        C  
320      0          A/5 21172    7.2500              NaN        S  
321      0             349219    7.8958              NaN        S  
322      0             234818   12.3500              NaN        Q  
323      1             248738   29.0000              NaN        S  
324      2           CA. 2343   69.5500              NaN        S  
325      0           PC 17760  135.6333              C32        C  
326      0             345364    6.2375              NaN        S  
327      0              28551   13.0000                D        S  
328      1             363291   20.5250              NaN        S  
329      1             111361   57.9792              B18        C  
..     ...                ...       ...              ...      ...  
370      0              11765   55.4417              E50        C  
371      0            3101267    6.4958              NaN        S  
372      0             323951    8.0500              NaN        S  
373      0           PC 17760  135.6333              NaN        C  
374      1             349909   21.0750              NaN        S  
375      0           PC 17604   82.1708              NaN        C  
376      0             C 7077    7.2500              NaN        S  
377      2             113503  211.5000              C82        C  
378      0               2648    4.0125              NaN        C  
379      0             347069    7.7750              NaN        S  
380      0           PC 17757  227.5250              NaN        C  
381      2               2653   15.7417              NaN        C  
382      0  STON/O 2. 3101293    7.9250              NaN        S  
383      0             113789   52.0000              NaN        S  
384      0             349227    7.8958              NaN        S  
385      0       S.O.C. 14879   73.5000              NaN        S  
386      2            CA 2144   46.9000              NaN        S  
387      0              27849   13.0000              NaN        S  
388      0             367655    7.7292              NaN        Q  
389      0            SC 1748   12.0000              NaN        C  
390      2             113760  120.0000          B96 B98        S  
391      0             350034    7.7958              NaN        S  
392      0            3101277    7.9250              NaN        S  
393      0              35273  113.2750              D36        C  
394      2            PP 9549   16.7000               G6        S  
395      0             350052    7.7958              NaN        S  
396      0             350407    7.8542              NaN        S  
397      0              28403   26.0000              NaN        S  
398      0             244278   10.5000              NaN        S  
399      0             240929   12.6500              NaN        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
400          401         1       3   
401          402         0       3   
402          403         0       3   
403          404         0       3   
404          405         0       3   
405          406         0       2   
406          407         0       3   
407          408         1       2   
408          409         0       3   
409          410         0       3   
410          411         0       3   
411          412         0       3   
412          413         1       1   
413          414         0       2   
414          415         1       3   
415          416         0       3   
416          417         1       2   
417          418         1       2   
418          419         0       2   
419          420         0       3   
420          421         0       3   
421          422         0       3   
422          423         0       3   
423          424         0       3   
424          425         0       3   
425          426         0       3   
426          427         1       2   
427          428         1       2   
428          429         0       3   
429          430         1       3   
..           ...       ...     ...   
470          471         0       3   
471          472         0       3   
472          473         1       2   
473          474         1       2   
474          475         0       3   
475          476         0       1   
476          477         0       2   
477          478         0       3   
478          479         0       3   
479          480         1       3   
480          481         0       3   
481          482         0       2   
482          483         0       3   
483          484         1       3   
484          485         1       1   
485          486         0       3   
486          487         1       1   
487          488         0       1   
488          489         0       3   
489          490         1       3   
490          491         0       3   
491          492         0       3   
492          493         0       1   
493          494         0       1   
494          495         0       3   
495          496         0       3   
496          497         1       1   
497          498         0       3   
498          499         0       1   
499          500         0       3   

                                                  Name     Sex   Age  SibSp  \
400                                 Niskanen, Mr. Juha    male  39.0      0   
401                                    Adams, Mr. John    male  26.0      0   
402                           Jussila, Miss. Mari Aina  female  21.0      1   
403                     Hakkarainen, Mr. Pekka Pietari    male  28.0      1   
404                            Oreskovic, Miss. Marija  female  20.0      0   
405                                 Gale, Mr. Shadrach    male  34.0      1   
406                   Widegren, Mr. Carl/Charles Peter    male  51.0      0   
407                     Richards, Master. William Rowe    male   3.0      1   
408                  Birkeland, Mr. Hans Martin Monsen    male  21.0      0   
409                                 Lefebre, Miss. Ida  female   NaN      3   
410                                 Sdycoff, Mr. Todor    male   NaN      0   
411                                    Hart, Mr. Henry    male   NaN      0   
412                             Minahan, Miss. Daisy E  female  33.0      1   
413                     Cunningham, Mr. Alfred Fleming    male   NaN      0   
414                          Sundman, Mr. Johan Julian    male  44.0      0   
415            Meek, Mrs. Thomas (Annie Louise Rowley)  female   NaN      0   
416    Drew, Mrs. James Vivian (Lulu Thorne Christian)  female  34.0      1   
417                      Silven, Miss. Lyyli Karoliina  female  18.0      0   
418                         Matthews, Mr. William John    male  30.0      0   
419                          Van Impe, Miss. Catharina  female  10.0      0   
420                             Gheorgheff, Mr. Stanio    male   NaN      0   
421                                Charters, Mr. David    male  21.0      0   
422                                 Zimmerman, Mr. Leo    male  29.0      0   
423  Danbom, Mrs. Ernst Gilbert (Anna Sigrid Maria ...  female  28.0      1   
424                        Rosblom, Mr. Viktor Richard    male  18.0      1   
425                             Wiseman, Mr. Phillippe    male   NaN      0   
426        Clarke, Mrs. Charles V (Ada Maria Winfield)  female  28.0      1   
427  Phillips, Miss. Kate Florence ("Mrs Kate Louis...  female  19.0      0   
428                                   Flynn, Mr. James    male   NaN      0   
429                 Pickard, Mr. Berk (Berk Trembisky)    male  32.0      0   
..                                                 ...     ...   ...    ...   
470                                  Keefe, Mr. Arthur    male   NaN      0   
471                                    Cacic, Mr. Luka    male  38.0      0   
472            West, Mrs. Edwy Arthur (Ada Mary Worth)  female  33.0      1   
473       Jerwan, Mrs. Amin S (Marie Marthe Thuillard)  female  23.0      0   
474                        Strandberg, Miss. Ida Sofia  female  22.0      0   
475                        Clifford, Mr. George Quincy    male   NaN      0   
476                            Renouf, Mr. Peter Henry    male  34.0      1   
477                          Braund, Mr. Lewis Richard    male  29.0      1   
478                          Karlsson, Mr. Nils August    male  22.0      0   
479                           Hirvonen, Miss. Hildur E  female   2.0      0   
480                     Goodwin, Master. Harold Victor    male   9.0      5   
481                   Frost, Mr. Anthony Wood "Archie"    male   NaN      0   
482                           Rouse, Mr. Richard Henry    male  50.0      0   
483                             Turkula, Mrs. (Hedwig)  female  63.0      0   
484                            Bishop, Mr. Dickinson H    male  25.0      1   
485                             Lefebre, Miss. Jeannie  female   NaN      3   
486    Hoyt, Mrs. Frederick Maxfield (Jane Anne Forby)  female  35.0      1   
487                            Kent, Mr. Edward Austin    male  58.0      0   
488                      Somerton, Mr. Francis William    male  30.0      0   
489              Coutts, Master. Eden Leslie "Neville"    male   9.0      1   
490               Hagland, Mr. Konrad Mathias Reiersen    male   NaN      1   
491                                Windelov, Mr. Einar    male  21.0      0   
492                         Molson, Mr. Harry Markland    male  55.0      0   
493                            Artagaveytia, Mr. Ramon    male  71.0      0   
494                         Stanley, Mr. Edward Roland    male  21.0      0   
495                              Yousseff, Mr. Gerious    male   NaN      0   
496                     Eustis, Miss. Elizabeth Mussey  female  54.0      1   
497                    Shellard, Mr. Frederick William    male   NaN      0   
498    Allison, Mrs. Hudson J C (Bessie Waldo Daniels)  female  25.0      1   
499                                 Svensson, Mr. Olof    male  24.0      0   

     Parch             Ticket      Fare    Cabin Embarked  
400      0  STON/O 2. 3101289    7.9250      NaN        S  
401      0             341826    8.0500      NaN        S  
402      0               4137    9.8250      NaN        S  
403      0   STON/O2. 3101279   15.8500      NaN        S  
404      0             315096    8.6625      NaN        S  
405      0              28664   21.0000      NaN        S  
406      0             347064    7.7500      NaN        S  
407      1              29106   18.7500      NaN        S  
408      0             312992    7.7750      NaN        S  
409      1               4133   25.4667      NaN        S  
410      0             349222    7.8958      NaN        S  
411      0             394140    6.8583      NaN        Q  
412      0              19928   90.0000      C78        Q  
413      0             239853    0.0000      NaN        S  
414      0  STON/O 2. 3101269    7.9250      NaN        S  
415      0             343095    8.0500      NaN        S  
416      1              28220   32.5000      NaN        S  
417      2             250652   13.0000      NaN        S  
418      0              28228   13.0000      NaN        S  
419      2             345773   24.1500      NaN        S  
420      0             349254    7.8958      NaN        C  
421      0         A/5. 13032    7.7333      NaN        Q  
422      0             315082    7.8750      NaN        S  
423      1             347080   14.4000      NaN        S  
424      1             370129   20.2125      NaN        S  
425      0         A/4. 34244    7.2500      NaN        S  
426      0               2003   26.0000      NaN        S  
427      0             250655   26.0000      NaN        S  
428      0             364851    7.7500      NaN        Q  
429      0  SOTON/O.Q. 392078    8.0500      E10        S  
..     ...                ...       ...      ...      ...  
470      0             323592    7.2500      NaN        S  
471      0             315089    8.6625      NaN        S  
472      2         C.A. 34651   27.7500      NaN        S  
473      0    SC/AH Basle 541   13.7917        D        C  
474      0               7553    9.8375      NaN        S  
475      0             110465   52.0000      A14        S  
476      0              31027   21.0000      NaN        S  
477      0               3460    7.0458      NaN        S  
478      0             350060    7.5208      NaN        S  
479      1            3101298   12.2875      NaN        S  
480      2            CA 2144   46.9000      NaN        S  
481      0             239854    0.0000      NaN        S  
482      0           A/5 3594    8.0500      NaN        S  
483      0               4134    9.5875      NaN        S  
484      0              11967   91.0792      B49        C  
485      1               4133   25.4667      NaN        S  
486      0              19943   90.0000      C93        S  
487      0              11771   29.7000      B37        C  
488      0         A.5. 18509    8.0500      NaN        S  
489      1         C.A. 37671   15.9000      NaN        S  
490      0              65304   19.9667      NaN        S  
491      0   SOTON/OQ 3101317    7.2500      NaN        S  
492      0             113787   30.5000      C30        S  
493      0           PC 17609   49.5042      NaN        C  
494      0          A/4 45380    8.0500      NaN        S  
495      0               2627   14.4583      NaN        C  
496      0              36947   78.2667      D20        C  
497      0          C.A. 6212   15.1000      NaN        S  
498      2             113781  151.5500  C22 C26        S  
499      0             350035    7.7958      NaN        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
500          501         0       3   
501          502         0       3   
502          503         0       3   
503          504         0       3   
504          505         1       1   
505          506         0       1   
506          507         1       2   
507          508         1       1   
508          509         0       3   
509          510         1       3   
510          511         1       3   
511          512         0       3   
512          513         1       1   
513          514         1       1   
514          515         0       3   
515          516         0       1   
516          517         1       2   
517          518         0       3   
518          519         1       2   
519          520         0       3   
520          521         1       1   
521          522         0       3   
522          523         0       3   
523          524         1       1   
524          525         0       3   
525          526         0       3   
526          527         1       2   
527          528         0       1   
528          529         0       3   
529          530         0       2   
..           ...       ...     ...   
570          571         1       2   
571          572         1       1   
572          573         1       1   
573          574         1       3   
574          575         0       3   
575          576         0       3   
576          577         1       2   
577          578         1       1   
578          579         0       3   
579          580         1       3   
580          581         1       2   
581          582         1       1   
582          583         0       2   
583          584         0       1   
584          585         0       3   
585          586         1       1   
586          587         0       2   
587          588         1       1   
588          589         0       3   
589          590         0       3   
590          591         0       3   
591          592         1       1   
592          593         0       3   
593          594         0       3   
594          595         0       2   
595          596         0       3   
596          597         1       2   
597          598         0       3   
598          599         0       3   
599          600         1       1   

                                                  Name     Sex   Age  SibSp  \
500                                   Calic, Mr. Petar    male  17.0      0   
501                                Canavan, Miss. Mary  female  21.0      0   
502                     O'Sullivan, Miss. Bridget Mary  female   NaN      0   
503                     Laitinen, Miss. Kristina Sofia  female  37.0      0   
504                              Maioni, Miss. Roberta  female  16.0      0   
505         Penasco y Castellana, Mr. Victor de Satode    male  18.0      1   
506      Quick, Mrs. Frederick Charles (Jane Richards)  female  33.0      0   
507      Bradley, Mr. George ("George Arthur Brayton")    male   NaN      0   
508                           Olsen, Mr. Henry Margido    male  28.0      0   
509                                     Lang, Mr. Fang    male  26.0      0   
510                           Daly, Mr. Eugene Patrick    male  29.0      0   
511                                  Webber, Mr. James    male   NaN      0   
512                          McGough, Mr. James Robert    male  36.0      0   
513     Rothschild, Mrs. Martin (Elizabeth L. Barrett)  female  54.0      1   
514                                  Coleff, Mr. Satio    male  24.0      0   
515                       Walker, Mr. William Anderson    male  47.0      0   
516                       Lemore, Mrs. (Amelia Milley)  female  34.0      0   
517                                  Ryan, Mr. Patrick    male   NaN      0   
518  Angle, Mrs. William A (Florence "Mary" Agnes H...  female  36.0      1   
519                                Pavlovic, Mr. Stefo    male  32.0      0   
520                              Perreault, Miss. Anne  female  30.0      0   
521                                    Vovk, Mr. Janko    male  22.0      0   
522                                 Lahoud, Mr. Sarkis    male   NaN      0   
523    Hippach, Mrs. Louis Albert (Ida Sophia Fischer)  female  44.0      0   
524                                  Kassem, Mr. Fared    male   NaN      0   
525                                 Farrell, Mr. James    male  40.5      0   
526                               Ridsdale, Miss. Lucy  female  50.0      0   
527                                 Farthing, Mr. John    male   NaN      0   
528                          Salonen, Mr. Johan Werner    male  39.0      0   
529                        Hocking, Mr. Richard George    male  23.0      2   
..                                                 ...     ...   ...    ...   
570                                 Harris, Mr. George    male  62.0      0   
571      Appleton, Mrs. Edward Dale (Charlotte Lamson)  female  53.0      2   
572                   Flynn, Mr. John Irwin ("Irving")    male  36.0      0   
573                                  Kelly, Miss. Mary  female   NaN      0   
574                       Rush, Mr. Alfred George John    male  16.0      0   
575                               Patchett, Mr. George    male  19.0      0   
576                               Garside, Miss. Ethel  female  34.0      0   
577          Silvey, Mrs. William Baird (Alice Munger)  female  39.0      1   
578                   Caram, Mrs. Joseph (Maria Elias)  female   NaN      1   
579                                Jussila, Mr. Eiriik    male  32.0      0   
580                        Christy, Miss. Julie Rachel  female  25.0      1   
581  Thayer, Mrs. John Borland (Marian Longstreth M...  female  39.0      1   
582                         Downton, Mr. William James    male  54.0      0   
583                                Ross, Mr. John Hugo    male  36.0      0   
584                                Paulner, Mr. Uscher    male   NaN      0   
585                                Taussig, Miss. Ruth  female  18.0      0   
586                            Jarvis, Mr. John Denzil    male  47.0      0   
587                   Frolicher-Stehli, Mr. Maxmillian    male  60.0      1   
588                              Gilinski, Mr. Eliezer    male  22.0      0   
589                                Murdlin, Mr. Joseph    male   NaN      0   
590                               Rintamaki, Mr. Matti    male  35.0      0   
591    Stephenson, Mrs. Walter Bertram (Martha Eustis)  female  52.0      1   
592                         Elsbury, Mr. William James    male  47.0      0   
593                                 Bourke, Miss. Mary  female   NaN      0   
594                            Chapman, Mr. John Henry    male  37.0      1   
595                        Van Impe, Mr. Jean Baptiste    male  36.0      1   
596                         Leitch, Miss. Jessie Wills  female   NaN      0   
597                                Johnson, Mr. Alfred    male  49.0      0   
598                                  Boulos, Mr. Hanna    male   NaN      0   
599       Duff Gordon, Sir. Cosmo Edmund ("Mr Morgan")    male  49.0      1   

     Parch             Ticket      Fare Cabin Embarked  
500      0             315086    8.6625   NaN        S  
501      0             364846    7.7500   NaN        Q  
502      0             330909    7.6292   NaN        Q  
503      0               4135    9.5875   NaN        S  
504      0             110152   86.5000   B79        S  
505      0           PC 17758  108.9000   C65        C  
506      2              26360   26.0000   NaN        S  
507      0             111427   26.5500   NaN        S  
508      0             C 4001   22.5250   NaN        S  
509      0               1601   56.4958   NaN        S  
510      0             382651    7.7500   NaN        Q  
511      0   SOTON/OQ 3101316    8.0500   NaN        S  
512      0           PC 17473   26.2875   E25        S  
513      0           PC 17603   59.4000   NaN        C  
514      0             349209    7.4958   NaN        S  
515      0              36967   34.0208   D46        S  
516      0         C.A. 34260   10.5000   F33        S  
517      0             371110   24.1500   NaN        Q  
518      0             226875   26.0000   NaN        S  
519      0             349242    7.8958   NaN        S  
520      0              12749   93.5000   B73        S  
521      0             349252    7.8958   NaN        S  
522      0               2624    7.2250   NaN        C  
523      1             111361   57.9792   B18        C  
524      0               2700    7.2292   NaN        C  
525      0             367232    7.7500   NaN        Q  
526      0        W./C. 14258   10.5000   NaN        S  
527      0           PC 17483  221.7792   C95        S  
528      0            3101296    7.9250   NaN        S  
529      1              29104   11.5000   NaN        S  
..     ...                ...       ...   ...      ...  
570      0        S.W./PP 752   10.5000   NaN        S  
571      0              11769   51.4792  C101        S  
572      0           PC 17474   26.3875   E25        S  
573      0              14312    7.7500   NaN        Q  
574      0         A/4. 20589    8.0500   NaN        S  
575      0             358585   14.5000   NaN        S  
576      0             243880   13.0000   NaN        S  
577      0              13507   55.9000   E44        S  
578      0               2689   14.4583   NaN        C  
579      0  STON/O 2. 3101286    7.9250   NaN        S  
580      1             237789   30.0000   NaN        S  
581      1              17421  110.8833   C68        C  
582      0              28403   26.0000   NaN        S  
583      0              13049   40.1250   A10        C  
584      0               3411    8.7125   NaN        C  
585      2             110413   79.6500   E68        S  
586      0             237565   15.0000   NaN        S  
587      1              13567   79.2000   B41        C  
588      0              14973    8.0500   NaN        S  
589      0         A./5. 3235    8.0500   NaN        S  
590      0  STON/O 2. 3101273    7.1250   NaN        S  
591      0              36947   78.2667   D20        C  
592      0           A/5 3902    7.2500   NaN        S  
593      2             364848    7.7500   NaN        Q  
594      0        SC/AH 29037   26.0000   NaN        S  
595      1             345773   24.1500   NaN        S  
596      0             248727   33.0000   NaN        S  
597      0               LINE    0.0000   NaN        S  
598      0               2664    7.2250   NaN        C  
599      0           PC 17485   56.9292   A20        C  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
600          601         1       2   
601          602         0       3   
602          603         0       1   
603          604         0       3   
604          605         1       1   
605          606         0       3   
606          607         0       3   
607          608         1       1   
608          609         1       2   
609          610         1       1   
610          611         0       3   
611          612         0       3   
612          613         1       3   
613          614         0       3   
614          615         0       3   
615          616         1       2   
616          617         0       3   
617          618         0       3   
618          619         1       2   
619          620         0       2   
620          621         0       3   
621          622         1       1   
622          623         1       3   
623          624         0       3   
624          625         0       3   
625          626         0       1   
626          627         0       2   
627          628         1       1   
628          629         0       3   
629          630         0       3   
..           ...       ...     ...   
670          671         1       2   
671          672         0       1   
672          673         0       2   
673          674         1       2   
674          675         0       2   
675          676         0       3   
676          677         0       3   
677          678         1       3   
678          679         0       3   
679          680         1       1   
680          681         0       3   
681          682         1       1   
682          683         0       3   
683          684         0       3   
684          685         0       2   
685          686         0       2   
686          687         0       3   
687          688         0       3   
688          689         0       3   
689          690         1       1   
690          691         1       1   
691          692         1       3   
692          693         1       3   
693          694         0       3   
694          695         0       1   
695          696         0       2   
696          697         0       3   
697          698         1       3   
698          699         0       1   
699          700         0       3   

                                                  Name     Sex   Age  SibSp  \
600  Jacobsohn, Mrs. Sidney Samuel (Amy Frances Chr...  female  24.0      2   
601                               Slabenoff, Mr. Petco    male   NaN      0   
602                          Harrington, Mr. Charles H    male   NaN      0   
603                          Torber, Mr. Ernst William    male  44.0      0   
604                    Homer, Mr. Harry ("Mr E Haven")    male  35.0      0   
605                      Lindell, Mr. Edvard Bengtsson    male  36.0      1   
606                                  Karaic, Mr. Milan    male  30.0      0   
607                        Daniel, Mr. Robert Williams    male  27.0      0   
608  Laroche, Mrs. Joseph (Juliette Marie Louise La...  female  22.0      1   
609                          Shutes, Miss. Elizabeth W  female  40.0      0   
610  Andersson, Mrs. Anders Johan (Alfrida Konstant...  female  39.0      1   
611                              Jardin, Mr. Jose Neto    male   NaN      0   
612                        Murphy, Miss. Margaret Jane  female   NaN      1   
613                                   Horgan, Mr. John    male   NaN      0   
614                    Brocklebank, Mr. William Alfred    male  35.0      0   
615                                Herman, Miss. Alice  female  24.0      1   
616                          Danbom, Mr. Ernst Gilbert    male  34.0      1   
617    Lobb, Mrs. William Arthur (Cordelia K Stanlick)  female  26.0      1   
618                        Becker, Miss. Marion Louise  female   4.0      2   
619                                Gavey, Mr. Lawrence    male  26.0      0   
620                                Yasbeck, Mr. Antoni    male  27.0      1   
621                       Kimball, Mr. Edwin Nelson Jr    male  42.0      1   
622                                   Nakid, Mr. Sahid    male  20.0      1   
623                        Hansen, Mr. Henry Damsgaard    male  21.0      0   
624                        Bowen, Mr. David John "Dai"    male  21.0      0   
625                              Sutton, Mr. Frederick    male  61.0      0   
626                     Kirkland, Rev. Charles Leonard    male  57.0      0   
627                      Longley, Miss. Gretchen Fiske  female  21.0      0   
628                          Bostandyeff, Mr. Guentcho    male  26.0      0   
629                           O'Connell, Mr. Patrick D    male   NaN      0   
..                                                 ...     ...   ...    ...   
670  Brown, Mrs. Thomas William Solomon (Elizabeth ...  female  40.0      1   
671                             Davidson, Mr. Thornton    male  31.0      1   
672                        Mitchell, Mr. Henry Michael    male  70.0      0   
673                              Wilhelms, Mr. Charles    male  31.0      0   
674                         Watson, Mr. Ennis Hastings    male   NaN      0   
675                     Edvardsson, Mr. Gustaf Hjalmar    male  18.0      0   
676                      Sawyer, Mr. Frederick Charles    male  24.5      0   
677                            Turja, Miss. Anna Sofia  female  18.0      0   
678            Goodwin, Mrs. Frederick (Augusta Tyler)  female  43.0      1   
679                 Cardeza, Mr. Thomas Drake Martinez    male  36.0      0   
680                                Peters, Miss. Katie  female   NaN      0   
681                                 Hassab, Mr. Hammad    male  27.0      0   
682                        Olsvigen, Mr. Thor Anderson    male  20.0      0   
683                        Goodwin, Mr. Charles Edward    male  14.0      5   
684                  Brown, Mr. Thomas William Solomon    male  60.0      1   
685             Laroche, Mr. Joseph Philippe Lemercier    male  25.0      1   
686                           Panula, Mr. Jaako Arnold    male  14.0      4   
687                                  Dakic, Mr. Branko    male  19.0      0   
688                    Fischer, Mr. Eberhard Thelander    male  18.0      0   
689                  Madill, Miss. Georgette Alexandra  female  15.0      0   
690                            Dick, Mr. Albert Adrian    male  31.0      1   
691                                 Karun, Miss. Manca  female   4.0      0   
692                                       Lam, Mr. Ali    male   NaN      0   
693                                   Saad, Mr. Khalil    male  25.0      0   
694                                    Weir, Col. John    male  60.0      0   
695                         Chapman, Mr. Charles Henry    male  52.0      0   
696                                   Kelly, Mr. James    male  44.0      0   
697                   Mullens, Miss. Katherine "Katie"  female   NaN      0   
698                           Thayer, Mr. John Borland    male  49.0      1   
699           Humblen, Mr. Adolf Mathias Nicolai Olsen    male  42.0      0   

     Parch              Ticket      Fare        Cabin Embarked  
600      1              243847   27.0000          NaN        S  
601      0              349214    7.8958          NaN        S  
602      0              113796   42.4000          NaN        S  
603      0              364511    8.0500          NaN        S  
604      0              111426   26.5500          NaN        C  
605      0              349910   15.5500          NaN        S  
606      0              349246    7.8958          NaN        S  
607      0              113804   30.5000          NaN        S  
608      2       SC/Paris 2123   41.5792          NaN        C  
609      0            PC 17582  153.4625         C125        S  
610      5              347082   31.2750          NaN        S  
611      0  SOTON/O.Q. 3101305    7.0500          NaN        S  
612      0              367230   15.5000          NaN        Q  
613      0              370377    7.7500          NaN        Q  
614      0              364512    8.0500          NaN        S  
615      2              220845   65.0000          NaN        S  
616      1              347080   14.4000          NaN        S  
617      0           A/5. 3336   16.1000          NaN        S  
618      1              230136   39.0000           F4        S  
619      0               31028   10.5000          NaN        S  
620      0                2659   14.4542          NaN        C  
621      0               11753   52.5542          D19        S  
622      1                2653   15.7417          NaN        C  
623      0              350029    7.8542          NaN        S  
624      0               54636   16.1000          NaN        S  
625      0               36963   32.3208          D50        S  
626      0              219533   12.3500          NaN        Q  
627      0               13502   77.9583           D9        S  
628      0              349224    7.8958          NaN        S  
629      0              334912    7.7333          NaN        Q  
..     ...                 ...       ...          ...      ...  
670      1               29750   39.0000          NaN        S  
671      0          F.C. 12750   52.0000          B71        S  
672      0          C.A. 24580   10.5000          NaN        S  
673      0              244270   13.0000          NaN        S  
674      0              239856    0.0000          NaN        S  
675      0              349912    7.7750          NaN        S  
676      0              342826    8.0500          NaN        S  
677      0                4138    9.8417          NaN        S  
678      6             CA 2144   46.9000          NaN        S  
679      1            PC 17755  512.3292  B51 B53 B55        C  
680      0              330935    8.1375          NaN        Q  
681      0            PC 17572   76.7292          D49        C  
682      0                6563    9.2250          NaN        S  
683      2             CA 2144   46.9000          NaN        S  
684      1               29750   39.0000          NaN        S  
685      2       SC/Paris 2123   41.5792          NaN        C  
686      1             3101295   39.6875          NaN        S  
687      0              349228   10.1708          NaN        S  
688      0              350036    7.7958          NaN        S  
689      1               24160  211.3375           B5        S  
690      0               17474   57.0000          B20        S  
691      1              349256   13.4167          NaN        C  
692      0                1601   56.4958          NaN        S  
693      0                2672    7.2250          NaN        C  
694      0              113800   26.5500          NaN        S  
695      0              248731   13.5000          NaN        S  
696      0              363592    8.0500          NaN        S  
697      0               35852    7.7333          NaN        Q  
698      1               17421  110.8833          C68        C  
699      0              348121    7.6500        F G63        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
700          701         1       1   
701          702         1       1   
702          703         0       3   
703          704         0       3   
704          705         0       3   
705          706         0       2   
706          707         1       2   
707          708         1       1   
708          709         1       1   
709          710         1       3   
710          711         1       1   
711          712         0       1   
712          713         1       1   
713          714         0       3   
714          715         0       2   
715          716         0       3   
716          717         1       1   
717          718         1       2   
718          719         0       3   
719          720         0       3   
720          721         1       2   
721          722         0       3   
722          723         0       2   
723          724         0       2   
724          725         1       1   
725          726         0       3   
726          727         1       2   
727          728         1       3   
728          729         0       2   
729          730         0       3   
..           ...       ...     ...   
770          771         0       3   
771          772         0       3   
772          773         0       2   
773          774         0       3   
774          775         1       2   
775          776         0       3   
776          777         0       3   
777          778         1       3   
778          779         0       3   
779          780         1       1   
780          781         1       3   
781          782         1       1   
782          783         0       1   
783          784         0       3   
784          785         0       3   
785          786         0       3   
786          787         1       3   
787          788         0       3   
788          789         1       3   
789          790         0       1   
790          791         0       3   
791          792         0       2   
792          793         0       3   
793          794         0       1   
794          795         0       3   
795          796         0       2   
796          797         1       1   
797          798         1       3   
798          799         0       3   
799          800         0       3   

                                                  Name     Sex   Age  SibSp  \
700  Astor, Mrs. John Jacob (Madeleine Talmadge Force)  female  18.0      1   
701                   Silverthorne, Mr. Spencer Victor    male  35.0      0   
702                              Barbara, Miss. Saiide  female  18.0      0   
703                              Gallagher, Mr. Martin    male  25.0      0   
704                            Hansen, Mr. Henrik Juul    male  26.0      1   
705     Morley, Mr. Henry Samuel ("Mr Henry Marshall")    male  39.0      0   
706                      Kelly, Mrs. Florence "Fannie"  female  45.0      0   
707                  Calderhead, Mr. Edward Pennington    male  42.0      0   
708                               Cleaver, Miss. Alice  female  22.0      0   
709  Moubarek, Master. Halim Gonios ("William George")    male   NaN      1   
710   Mayne, Mlle. Berthe Antonine ("Mrs de Villiers")  female  24.0      0   
711                                 Klaber, Mr. Herman    male   NaN      0   
712                           Taylor, Mr. Elmer Zebley    male  48.0      1   
713                         Larsson, Mr. August Viktor    male  29.0      0   
714                              Greenberg, Mr. Samuel    male  52.0      0   
715         Soholt, Mr. Peter Andreas Lauritz Andersen    male  19.0      0   
716                      Endres, Miss. Caroline Louise  female  38.0      0   
717                Troutt, Miss. Edwina Celia "Winnie"  female  27.0      0   
718                                McEvoy, Mr. Michael    male   NaN      0   
719                       Johnson, Mr. Malkolm Joackim    male  33.0      0   
720                  Harper, Miss. Annie Jessie "Nina"  female   6.0      0   
721                          Jensen, Mr. Svend Lauritz    male  17.0      1   
722                       Gillespie, Mr. William Henry    male  34.0      0   
723                            Hodges, Mr. Henry Price    male  50.0      0   
724                      Chambers, Mr. Norman Campbell    male  27.0      1   
725                                Oreskovic, Mr. Luka    male  20.0      0   
726        Renouf, Mrs. Peter Henry (Lillian Jefferys)  female  30.0      3   
727                           Mannion, Miss. Margareth  female   NaN      0   
728                    Bryhl, Mr. Kurt Arnold Gottfrid    male  25.0      1   
729                      Ilmakangas, Miss. Pieta Sofia  female  25.0      1   
..                                                 ...     ...   ...    ...   
770                             Lievens, Mr. Rene Aime    male  24.0      0   
771                            Jensen, Mr. Niels Peder    male  48.0      0   
772                                  Mack, Mrs. (Mary)  female  57.0      0   
773                                    Elias, Mr. Dibo    male   NaN      0   
774              Hocking, Mrs. Elizabeth (Eliza Needs)  female  54.0      1   
775            Myhrman, Mr. Pehr Fabian Oliver Malkolm    male  18.0      0   
776                                   Tobin, Mr. Roger    male   NaN      0   
777                      Emanuel, Miss. Virginia Ethel  female   5.0      0   
778                            Kilgannon, Mr. Thomas J    male   NaN      0   
779  Robert, Mrs. Edward Scott (Elisabeth Walton Mc...  female  43.0      0   
780                               Ayoub, Miss. Banoura  female  13.0      0   
781          Dick, Mrs. Albert Adrian (Vera Gillespie)  female  17.0      1   
782                             Long, Mr. Milton Clyde    male  29.0      0   
783                             Johnston, Mr. Andrew G    male   NaN      1   
784                                   Ali, Mr. William    male  25.0      0   
785                 Harmer, Mr. Abraham (David Lishin)    male  25.0      0   
786                          Sjoblom, Miss. Anna Sofia  female  18.0      0   
787                          Rice, Master. George Hugh    male   8.0      4   
788                         Dean, Master. Bertram Vere    male   1.0      1   
789                           Guggenheim, Mr. Benjamin    male  46.0      0   
790                           Keane, Mr. Andrew "Andy"    male   NaN      0   
791                                Gaskell, Mr. Alfred    male  16.0      0   
792                            Sage, Miss. Stella Anna  female   NaN      8   
793                           Hoyt, Mr. William Fisher    male   NaN      0   
794                              Dantcheff, Mr. Ristiu    male  25.0      0   
795                                 Otter, Mr. Richard    male  39.0      0   
796                        Leader, Dr. Alice (Farnham)  female  49.0      0   
797                                   Osman, Mrs. Mara  female  31.0      0   
798                       Ibrahim Shawah, Mr. Yousseff    male  30.0      0   
799  Van Impe, Mrs. Jean Baptiste (Rosalie Paula Go...  female  30.0      1   

     Parch              Ticket      Fare    Cabin Embarked  
700      0            PC 17757  227.5250  C62 C64        C  
701      0            PC 17475   26.2875      E24        S  
702      1                2691   14.4542      NaN        C  
703      0               36864    7.7417      NaN        Q  
704      0              350025    7.8542      NaN        S  
705      0              250655   26.0000      NaN        S  
706      0              223596   13.5000      NaN        S  
707      0            PC 17476   26.2875      E24        S  
708      0              113781  151.5500      NaN        S  
709      1                2661   15.2458      NaN        C  
710      0            PC 17482   49.5042      C90        C  
711      0              113028   26.5500     C124        S  
712      0               19996   52.0000     C126        S  
713      0                7545    9.4833      NaN        S  
714      0              250647   13.0000      NaN        S  
715      0              348124    7.6500    F G73        S  
716      0            PC 17757  227.5250      C45        C  
717      0               34218   10.5000     E101        S  
718      0               36568   15.5000      NaN        Q  
719      0              347062    7.7750      NaN        S  
720      1              248727   33.0000      NaN        S  
721      0              350048    7.0542      NaN        S  
722      0               12233   13.0000      NaN        S  
723      0              250643   13.0000      NaN        S  
724      0              113806   53.1000       E8        S  
725      0              315094    8.6625      NaN        S  
726      0               31027   21.0000      NaN        S  
727      0               36866    7.7375      NaN        Q  
728      0              236853   26.0000      NaN        S  
729      0    STON/O2. 3101271    7.9250      NaN        S  
..     ...                 ...       ...      ...      ...  
770      0              345781    9.5000      NaN        S  
771      0              350047    7.8542      NaN        S  
772      0         S.O./P.P. 3   10.5000      E77        S  
773      0                2674    7.2250      NaN        C  
774      3               29105   23.0000      NaN        S  
775      0              347078    7.7500      NaN        S  
776      0              383121    7.7500      F38        Q  
777      0              364516   12.4750      NaN        S  
778      0               36865    7.7375      NaN        Q  
779      1               24160  211.3375       B3        S  
780      0                2687    7.2292      NaN        C  
781      0               17474   57.0000      B20        S  
782      0              113501   30.0000       D6        S  
783      2          W./C. 6607   23.4500      NaN        S  
784      0  SOTON/O.Q. 3101312    7.0500      NaN        S  
785      0              374887    7.2500      NaN        S  
786      0             3101265    7.4958      NaN        S  
787      1              382652   29.1250      NaN        Q  
788      2           C.A. 2315   20.5750      NaN        S  
789      0            PC 17593   79.2000  B82 B84        C  
790      0               12460    7.7500      NaN        Q  
791      0              239865   26.0000      NaN        S  
792      2            CA. 2343   69.5500      NaN        S  
793      0            PC 17600   30.6958      NaN        C  
794      0              349203    7.8958      NaN        S  
795      0               28213   13.0000      NaN        S  
796      0               17465   25.9292      D17        S  
797      0              349244    8.6833      NaN        S  
798      0                2685    7.2292      NaN        C  
799      1              345773   24.1500      NaN        S  

[100 rows x 12 columns]
     PassengerId  Survived  Pclass  \
800          801         0       2   
801          802         1       2   
802          803         1       1   
803          804         1       3   
804          805         1       3   
805          806         0       3   
806          807         0       1   
807          808         0       3   
808          809         0       2   
809          810         1       1   
810          811         0       3   
811          812         0       3   
812          813         0       2   
813          814         0       3   
814          815         0       3   
815          816         0       1   
816          817         0       3   
817          818         0       2   
818          819         0       3   
819          820         0       3   
820          821         1       1   
821          822         1       3   
822          823         0       1   
823          824         1       3   
824          825         0       3   
825          826         0       3   
826          827         0       3   
827          828         1       2   
828          829         1       3   
829          830         1       1   
..           ...       ...     ...   
861          862         0       2   
862          863         1       1   
863          864         0       3   
864          865         0       2   
865          866         1       2   
866          867         1       2   
867          868         0       1   
868          869         0       3   
869          870         1       3   
870          871         0       3   
871          872         1       1   
872          873         0       1   
873          874         0       3   
874          875         1       2   
875          876         1       3   
876          877         0       3   
877          878         0       3   
878          879         0       3   
879          880         1       1   
880          881         1       2   
881          882         0       3   
882          883         0       3   
883          884         0       2   
884          885         0       3   
885          886         0       3   
886          887         0       2   
887          888         1       1   
888          889         0       3   
889          890         1       1   
890          891         0       3   

                                                  Name     Sex    Age  SibSp  \
800                               Ponesell, Mr. Martin    male  34.00      0   
801        Collyer, Mrs. Harvey (Charlotte Annie Tate)  female  31.00      1   
802                Carter, Master. William Thornton II    male  11.00      1   
803                    Thomas, Master. Assad Alexander    male   0.42      0   
804                            Hedman, Mr. Oskar Arvid    male  27.00      0   
805                          Johansson, Mr. Karl Johan    male  31.00      0   
806                             Andrews, Mr. Thomas Jr    male  39.00      0   
807                    Pettersson, Miss. Ellen Natalia  female  18.00      0   
808                                  Meyer, Mr. August    male  39.00      0   
809     Chambers, Mrs. Norman Campbell (Bertha Griggs)  female  33.00      1   
810                             Alexander, Mr. William    male  26.00      0   
811                                  Lester, Mr. James    male  39.00      0   
812                          Slemen, Mr. Richard James    male  35.00      0   
813                 Andersson, Miss. Ebba Iris Alfrida  female   6.00      4   
814                         Tomlin, Mr. Ernest Portage    male  30.50      0   
815                                   Fry, Mr. Richard    male    NaN      0   
816                       Heininen, Miss. Wendla Maria  female  23.00      0   
817                                 Mallet, Mr. Albert    male  31.00      1   
818                   Holm, Mr. John Fredrik Alexander    male  43.00      0   
819                       Skoog, Master. Karl Thorsten    male  10.00      3   
820  Hays, Mrs. Charles Melville (Clara Jennings Gr...  female  52.00      1   
821                                  Lulic, Mr. Nikola    male  27.00      0   
822                    Reuchlin, Jonkheer. John George    male  38.00      0   
823                                 Moor, Mrs. (Beila)  female  27.00      0   
824                       Panula, Master. Urho Abraham    male   2.00      4   
825                                    Flynn, Mr. John    male    NaN      0   
826                                       Lam, Mr. Len    male    NaN      0   
827                              Mallet, Master. Andre    male   1.00      0   
828                       McCormack, Mr. Thomas Joseph    male    NaN      0   
829          Stone, Mrs. George Nelson (Martha Evelyn)  female  62.00      0   
..                                                 ...     ...    ...    ...   
861                        Giles, Mr. Frederick Edward    male  21.00      1   
862  Swift, Mrs. Frederick Joel (Margaret Welles Ba...  female  48.00      0   
863                  Sage, Miss. Dorothy Edith "Dolly"  female    NaN      8   
864                             Gill, Mr. John William    male  24.00      0   
865                           Bystrom, Mrs. (Karolina)  female  42.00      0   
866                       Duran y More, Miss. Asuncion  female  27.00      1   
867               Roebling, Mr. Washington Augustus II    male  31.00      0   
868                        van Melkebeke, Mr. Philemon    male    NaN      0   
869                    Johnson, Master. Harold Theodor    male   4.00      1   
870                                  Balkic, Mr. Cerin    male  26.00      0   
871   Beckwith, Mrs. Richard Leonard (Sallie Monypeny)  female  47.00      1   
872                           Carlsson, Mr. Frans Olof    male  33.00      0   
873                        Vander Cruyssen, Mr. Victor    male  47.00      0   
874              Abelson, Mrs. Samuel (Hannah Wizosky)  female  28.00      1   
875                   Najib, Miss. Adele Kiamie "Jane"  female  15.00      0   
876                      Gustafsson, Mr. Alfred Ossian    male  20.00      0   
877                               Petroff, Mr. Nedelio    male  19.00      0   
878                                 Laleff, Mr. Kristo    male    NaN      0   
879      Potter, Mrs. Thomas Jr (Lily Alexenia Wilson)  female  56.00      0   
880       Shelley, Mrs. William (Imanita Parrish Hall)  female  25.00      0   
881                                 Markun, Mr. Johann    male  33.00      0   
882                       Dahlberg, Miss. Gerda Ulrika  female  22.00      0   
883                      Banfield, Mr. Frederick James    male  28.00      0   
884                             Sutehall, Mr. Henry Jr    male  25.00      0   
885               Rice, Mrs. William (Margaret Norton)  female  39.00      0   
886                              Montvila, Rev. Juozas    male  27.00      0   
887                       Graham, Miss. Margaret Edith  female  19.00      0   
888           Johnston, Miss. Catherine Helen "Carrie"  female    NaN      1   
889                              Behr, Mr. Karl Howell    male  26.00      0   
890                                Dooley, Mr. Patrick    male  32.00      0   

     Parch            Ticket      Fare        Cabin Embarked  
800      0            250647   13.0000          NaN        S  
801      1        C.A. 31921   26.2500          NaN        S  
802      2            113760  120.0000      B96 B98        S  
803      1              2625    8.5167          NaN        C  
804      0            347089    6.9750          NaN        S  
805      0            347063    7.7750          NaN        S  
806      0            112050    0.0000          A36        S  
807      0            347087    7.7750          NaN        S  
808      0            248723   13.0000          NaN        S  
809      0            113806   53.1000           E8        S  
810      0              3474    7.8875          NaN        S  
811      0         A/4 48871   24.1500          NaN        S  
812      0             28206   10.5000          NaN        S  
813      2            347082   31.2750          NaN        S  
814      0            364499    8.0500          NaN        S  
815      0            112058    0.0000         B102        S  
816      0  STON/O2. 3101290    7.9250          NaN        S  
817      1   S.C./PARIS 2079   37.0042          NaN        C  
818      0            C 7075    6.4500          NaN        S  
819      2            347088   27.9000          NaN        S  
820      1             12749   93.5000          B69        S  
821      0            315098    8.6625          NaN        S  
822      0             19972    0.0000          NaN        S  
823      1            392096   12.4750         E121        S  
824      1           3101295   39.6875          NaN        S  
825      0            368323    6.9500          NaN        Q  
826      0              1601   56.4958          NaN        S  
827      2   S.C./PARIS 2079   37.0042          NaN        C  
828      0            367228    7.7500          NaN        Q  
829      0            113572   80.0000          B28      NaN  
..     ...               ...       ...          ...      ...  
861      0             28134   11.5000          NaN        S  
862      0             17466   25.9292          D17        S  
863      2          CA. 2343   69.5500          NaN        S  
864      0            233866   13.0000          NaN        S  
865      0            236852   13.0000          NaN        S  
866      0     SC/PARIS 2149   13.8583          NaN        C  
867      0          PC 17590   50.4958          A24        S  
868      0            345777    9.5000          NaN        S  
869      1            347742   11.1333          NaN        S  
870      0            349248    7.8958          NaN        S  
871      1             11751   52.5542          D35        S  
872      0               695    5.0000  B51 B53 B55        S  
873      0            345765    9.0000          NaN        S  
874      0         P/PP 3381   24.0000          NaN        C  
875      0              2667    7.2250          NaN        C  
876      0              7534    9.8458          NaN        S  
877      0            349212    7.8958          NaN        S  
878      0            349217    7.8958          NaN        S  
879      1             11767   83.1583          C50        C  
880      1            230433   26.0000          NaN        S  
881      0            349257    7.8958          NaN        S  
882      0              7552   10.5167          NaN        S  
883      0  C.A./SOTON 34068   10.5000          NaN        S  
884      0   SOTON/OQ 392076    7.0500          NaN        S  
885      5            382652   29.1250          NaN        Q  
886      0            211536   13.0000          NaN        S  
887      0            112053   30.0000          B42        S  
888      2        W./C. 6607   23.4500          NaN        S  
889      0            111369   30.0000         C148        C  
890      0            370376    7.7500          NaN        Q  

[91 rows x 12 columns]

【思考】什么是逐块读取?为什么要逐块读取呢?

1.1.4 任务四:将表头改成中文,索引改为乘客ID [对于某些英文资料,我们可以通过翻译来更直观的熟悉我们的数据]

PassengerId => 乘客ID
Survived => 是否幸存
Pclass => 乘客等级(1/2/3等舱位)
Name => 乘客姓名
Sex => 性别
Age => 年龄
SibSp => 堂兄弟/妹个数
Parch => 父母与小孩个数
Ticket => 船票信息
Fare => 票价
Cabin => 客舱
Embarked => 登船港口

#写入代码
df = pd.read_csv('train.csv', names=['乘客ID','是否幸存','仓位等级','姓名','性别','年龄','兄弟姐妹个数','父母子女个数','船票信息','票价','客舱','登船港口'],header=0)
df.head()

乘客ID 是否幸存 仓位等级 姓名 性别 年龄 兄弟姐妹个数 父母子女个数 船票信息 票价 客舱 登船港口
0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1000 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.0500 NaN S

【思考】所谓将表头改为中文其中一个思路是:将英文额度表头替换成中文。还有其他的方法吗?

# 另外一种方法修改index
print(df.columns) #确定是行名还是列名  行名index
df.columns = ['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp', 'Parch', 'Ticket', 'Fare', 'Cabin','Embarked']
df.head()
Index(['乘客ID', '是否幸存', '仓位等级', '姓名', '性别', '年龄', '兄弟姐妹个数', '父母子女个数', '船票信息',
       '票价', '客舱', '登船港口'],
      dtype='object')
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.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1000 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.0500 NaN S

1.2 初步观察

导入数据后,你可能要对数据的整体结构和样例进行概览,比如说,数据大小、有多少列,各列都是什么格式的,是否包含null等

1.2.1 任务一:查看数据的基本信息

#写入代码
df.info()


RangeIndex: 891 entries, 0 to 890
Data columns (total 12 columns):
PassengerId    891 non-null int64
Survived       891 non-null int64
Pclass         891 non-null int64
Name           891 non-null object
Sex            891 non-null object
Age            714 non-null float64
SibSp          891 non-null int64
Parch          891 non-null int64
Ticket         891 non-null object
Fare           891 non-null float64
Cabin          204 non-null object
Embarked       889 non-null object
dtypes: float64(2), int64(5), object(5)
memory usage: 83.6+ KB

【提示】有多个函数可以这样做,你可以做一下总结

1.2.2 任务二:观察表格前10行的数据和后15行的数据

#写入代码

df.head(10)
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.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... 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.9250 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1000 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.0500 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.0750 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
#写入代码

df.tail(15)
PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
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.0000 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.5000 NaN S
884 885 0 3 Sutehall, Mr. Henry Jr male 25.0 0 0 SOTON/OQ 392076 7.0500 NaN S
885 886 0 3 Rice, Mrs. William (Margaret Norton) female 39.0 0 5 382652 29.1250 NaN Q
886 887 0 2 Montvila, Rev. Juozas male 27.0 0 0 211536 13.0000 NaN S
887 888 1 1 Graham, Miss. Margaret Edith female 19.0 0 0 112053 30.0000 B42 S
888 889 0 3 Johnston, Miss. Catherine Helen "Carrie" female NaN 1 2 W./C. 6607 23.4500 NaN S
889 890 1 1 Behr, Mr. Karl Howell male 26.0 0 0 111369 30.0000 C148 C
890 891 0 3 Dooley, Mr. Patrick male 32.0 0 0 370376 7.7500 NaN Q

1.2.4 任务三:判断数据是否为空,为空的地方返回True,其余地方返回False

#写入代码
df.isnull().head()

PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 False False False False False False False False False False True False
1 False False False False False False False False False False False False
2 False False False False False False False False False False True False
3 False False False False False False False False False False False False
4 False False False False False False False False False False True False

【总结】上面的操作都是数据分析中对于数据本身的观察

【思考】对于一个数据,还可以从哪些方面来观察?找找答案,这个将对下面的数据分析有很大的帮助

# 查看某一列数据类型
print(df['Name'].dtypes)
object

1.3 保存数据

1.3.1 任务一:将你加载并做出改变的数据,在工作目录下保存为一个新文件train_chinese.csv

#写入代码
df_c = pd.read_csv('train.csv', names=['乘客ID','是否幸存','仓位等级','姓名','性别','年龄','兄弟姐妹个数','父母子女个数','船票信息','票价','客舱','登船港口'],header=0)
df_c.to_csv('train_chinese.csv', encoding='utf_8_sig') # encoding='utf_8_sig'  防止保存csv中中文有乱码

【总结】数据的加载以及入门,接下来就要接触数据本身的运算,我们将主要掌握numpy和pandas在工作和项目场景的运用。

你可能感兴趣的:(Python,Datawhale,DS,数据分析,python)