Advertisements
Advertisements
Question
How can you check whether a given DataFrame has any missing value or not?
Code Writing
Advertisements
Solution
import pandas as pd
import numpy as np
df = pd.DataFrame({
'A': [10, 20, np.nan],
'B': [40, 50, 60]
})
print(df.isnull().values.any())
Output:
0, there are no missing values; otherwise, missing values are present.
shaalaa.com
Is there an error in this question or solution?
