Question 5
>>> import pandas as pd>>> df = pd.read_csv('titanic.csv')>>> print(df)| sex | age | sibsp | parch | fare | class | embark_town | alive | alone | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | male | 22.0 | 1 | 0 | 7.2500 | Third | Southampton | no | False |
| 1 | female | 38.0 | 1 | 0 | 71.2833 | First | Cherbourg | yes | False |
| 2 | female | 26.0 | 0 | 0 | 7.9250 | Third | Southampton | yes | True |
| 3 | female | 35.0 | 1 | 0 | 53.1000 | First | Southampton | yes | False |
| 4 | male | 35.0 | 0 | 0 | 8.0500 | Third | Southampton | no | True |
| 5 | male | NaN | 0 | 0 | 8.4583 | Third | Queenstown | no | True |
| 6 | male | 54.0 | 0 | 0 | 51.8625 | First | Southampton | no | True |
| 7 | male | 2.0 | 3 | 1 | 21.0750 | Third | Southampton | no | False |
| 8 | female | 27.0 | 0 | 2 | 11.1333 | Third | Southampton | yes | False |
| 9 | female | 14.0 | 1 | 0 | 30.0708 | Second | Cherbourg | yes | False |
| 10 | female | 4.0 | 1 | 1 | 16.7000 | Third | Southampton | yes | False |
| 11 | female | 58.0 | 0 | 0 | 26.5500 | First | Southampton | yes | True |
| 12 | male | 20.0 | 0 | 0 | 8.0500 | Third | Southampton | no | True |
| 13 | male | 39.0 | 1 | 5 | 31.2750 | Third | Southampton | no | False |
| 14 | female | 14.0 | 0 | 0 | 7.8542 | Third | Southampton | no | True |
| 15 | female | 55.0 | 0 | 0 | 16.0000 | Second | Southampton | yes | True |
Based on the above data, answer the given subquestions.
What is the given code below trying to accomplish for the given titanic dataset ?