# Specify NaN encoding in np.where() logic

I have data that looks like this: id case2_q6 0 300 3.0 1 304 4.0 2 306 3.0 3 309 1.0 4 311 3.0 5 312 4.0 6 314 NaN 7 315 2.0 8 316 3.0 9 317 3.0 And using this np.where() function call to generate new variables: df[‘fluid_2’] = np.where((df[‘case2_q6’] == 1) |… Read More Specify NaN encoding in np.where() logic