Skip to main content
formatted code
Source Link
I_Play_With_Data
  • 2.1k
  • 3
  • 17
  • 40

df['Served'] = (df.iloc[:, 1:] == 1).idxmax(1)

df['Served'] = (df.iloc[:, 1:] == 1).idxmax(1)

df['Served'] = (df.iloc[:, 1:] == 1).idxmax(1)

df['Served'] = (df.iloc[:, 1:] == 1).idxmax(1)
Source Link
Gene Xu
  • 111
  • 2

df['Served'] = (df.iloc[:, 1:] == 1).idxmax(1)