import
pandas as pd
import
numpy as np
NaN
=
np.nan
dataframe
=
pd.DataFrame({
'Name'
: [
'Shobhit'
,
'Vaibhav'
,
'Vimal'
,
'Sourabh'
,
'Rahul'
,
'Shobhit'
],
'Physics'
: [
11
,
12
,
13
,
14
, NaN,
11
],
'Chemistry'
: [
10
,
14
, NaN,
18
,
20
,
10
],
'Math'
: [
13
,
10
,
15
, NaN, NaN,
13
]})
print
(
"Created Dataframe"
)
print
(dataframe)
print
(
"Count of all values wrt columns"
)
print
(dataframe.count())
print
(
"Count of all values wrt rows"
)
print
(dataframe.count(axis
=
1
))
print
(dataframe.count(axis
=
'columns'
))
print
(
"Null Values counts "
)
print
(dataframe.isnull().
sum
())
print
(
"Total null values"
,
dataframe.isnull().
sum
().
sum
())
print
(
"Count of students with physics marks greater than 11 is->"
,
dataframe[dataframe[
'Physics'
] >
11
][
'Name'
].count())
print
(dataframe[dataframe[
'Physics'
] >
11
])
print
(
"Count of students ->"
,
dataframe[(dataframe[
'Physics'
] >
10
) &
(dataframe[
'Chemistry'
] >
11
) &
(dataframe[
'Math'
] >
9
)][
'Name'
].count())
print
(dataframe[(dataframe[
'Physics'
] >
10
) &
(dataframe[
'Chemistry'
] >
11
) &
(dataframe[
'Math'
] >
9
)])