Replace missing values with zeros and nonmissing values with one in Dataframe

nonmissing = .!ismissing.(df)
1 Like