0

I have DataFrame holds 2 columns. The first one has lower case letter and the other one has True/False values. I'm trying to create third column that changes a lower case letter into an upper case if it marked as True at the second column.

this line won't work for some reason.

df['result_seq'] = df['Letters'].apply(lambda x: x.upper() if df['bool_array'] is True else x)

Thanks!

U13-Forward
  • 69,221
  • 14
  • 89
  • 114

0 Answers0