I'm trying to create a list which have a values which are either zero or one (if the values in the table's column is Null or not). But my list only contains ones.
list = []
for i in range(len(df['DefaultDate'])):
if df['DefaultDate'][i] == 'nan':
list.append(0)
else:
list.append(1)
print(list)
print(df['DefaultDate'])