0

I try to convert just the float values to percentages and keep the *- values without change

[data['NPS'] = np.where(( data['Total']<= 3 ) , "*_", df['NPS'])][1]

I try enter image description hereto convert a total less than 3 after converting the percentage but I got an error the ValueError: could not convert string to float: I also use try-except code to do it but it's not working enter image description here

Mha
  • 1
  • 3
  • Error reports should show the full error message. It may help to break the `where` into pieces to identify the exact step. There's a lot going on in that line. – hpaulj Aug 19 '23 at 16:36

0 Answers0