Experiment 2
Experiment 2
In [3]: df = pd.read_csv(r"D:\College\TE\SEM-2\Practical\DSBDA\2\AcademicPerformance.csv")
In [4]: print(df)
0 72.0
1 NaN
2 90.0
3 NaN
4 76.0
...
2235 NaN
2236 NaN
2237 NaN
2238 NaN
2239 NaN
Name: math score, Length: 2240, dtype: float64
0 False
1 True
2 False
3 True
4 False
...
2235 True
2236 True
2237 True
2238 True
2239 True
Name: math score, Length: 2240, dtype: bool
0 72
1 na
2 95
3 NaN
4 78
...
2235 NaN
2236 NaN
2237 NaN
2238 NaN
2239 NaN
Name: reading score, Length: 2240, dtype: object
0 False
1 False
2 False
3 True
4 False
...
2235 True
2236 True
2237 True
2238 True
2239 True
Name: reading score, Length: 2240, dtype: bool
In [9]: missing_values = ["n/a", "na", "--"]
df = pd.read_csv(r"D:\College\TE\SEM-2\Practical\DSBDA\2\AcademicPerformance.csv", na_v
0 72.0
1 NaN
2 95.0
3 NaN
4 78.0
...
2235 NaN
2236 NaN
2237 NaN
2238 NaN
2239 NaN
Name: reading score, Length: 2240, dtype: float64
0 False
1 True
2 False
3 True
4 False
...
2235 True
2236 True
2237 True
2238 True
2239 True
Name: reading score, Length: 2240, dtype: bool
In [13]: sorted(dataset)
Out[13]: [3, 6, 11, 20, 41, 55, 68, 97, 99, 101]
13.25 89.75
In [17]: print(iqr_value)
76.5
-101.5 204.5
In [23]: df.head(5)
Out[23]:
parental test
math reading writing
gender race/ethnicity level of lunch preparation Year_Birth Dt_Admi
score score score
education course
bachelor's
0 female group B standard none 1970.0 72.0 72.0 74 6/
degree
some
1 female group C standard completed 1961.0 NaN NaN A 6/
college
master's
2 female group B standard none 1958.0 90.0 95.0 93 5/
degree
associate's
3 male group A free/reduced none 1967.0 NaN NaN 44 05-11
degree
some
4 male group C standard none 1989.0 76.0 78.0 75 04-08
college
In [25]: df.head(5)
Out[25]:
parental test
math reading writing
gender race/ethnicity level of lunch preparation Year_Birth Dt_Admi
score score score
education course
bachelor's
0 female group B standard none 1970.0 72.0 72.0 74 6/
degree
some
1 female group C standard completed 1961.0 NaN NaN A 6/
college
master's
2 female group B standard none 1958.0 90.0 95.0 93 5/
degree
associate's
3 male group A free/reduced none 1967.0 NaN NaN 44 05-11
degree
some
4 male group C standard none 1989.0 76.0 78.0 75 04-08
college
In [ ]: