I read in a file with pandas which looks like:
import pandas as pd
import numpy as np
data = {'first_set_of_numbers': [1,2,3,4,5,np.nan,6,7,np.nan,np.nan,8,9,10,np.nan],
'second_set_of_numbers': [11,12,np.nan,13,14,np.nan,15,16,np.nan,np.nan,17,np.nan,19,np.nan],
'third_set_of_numbers': [20,21,22,23,np.nan,24,np.nan,26,27,np.nan,np.nan,28,29,30]
}
My goal is to go through column three and check if a cell is "nan" and if yes then print the whole row and then the user shall be asked to insert some kind of text.
So something like:
This is not working:
for x in data['third_set_of_numbers']:
if pd.isna(x):
print(data[x])
userinput = input("Enter Name:")
data['third_set_of_numbers'][x] = userinput
Any idea?
Thank you for your help!