Generation

code to explanationMon, 13 Mar 2023

df['readmitted'] = df.readmitted.apply(lambda x: 0 if x == 'NO' or x == '>30' else 1)

This step converts the column readmitted to numerical 0 and 1.

Questions about programming?Chat with your personal AI assistant