import pandas as pd
import numpy as np
#Create dataframe with numpy array
df = pd.DataFrame(data=np.random.randint(-10,100,size=[5,5]),
columns=["c1","c2","c3","c4","c5"])
print("Original dataframe")
print(df)
# Generate NaN values
df1 = df[df>0]
print("Dataframe with NaN values")
print(df1)
# How to drop rows having missing values
print("Dataframe with dropped rows having NaN values")
print(df1.dropna())
'''Output
Original dataframe
c1 c2 c3 c4 c5
0 52 14 0 39 22
1 88 58 66 51 36
2 93 28 87 1 32
3 66 19 61 70 43
4 98 58 64 -10 32
Dataframe with NaN values
c1 c2 c3 c4 c5
0 52 14 NaN 39.0 22
1 88 58 66.0 51.0 36
2 93 28 87.0 1.0 32
3 66 19 61.0 70.0 43
4 98 58 64.0 NaN 32
Dataframe with dropped rows having NaN values
c1 c2 c3 c4 c5
1 88 58 66.0 51.0 36
2 93 28 87.0 1.0 32
3 66 19 61.0 70.0 43
'''