Hi,
I’m stuck in the 5th requirement of this project
I have seen and understood the official solution. Just don’t quite get it why mine doesn’t work.
Here is my code for the complete project
I’ve copied the part I don’t understand as well. Would like to know what’s wrong with mine.
My code:
jeopardy_reformatted_copy=jeopardy_reformatted
jeopardy_reformatted_copy[‘values as floats’]=jeopardy_reformatted_copy.apply(lambda row:float(row[‘Value’][-(len(row[‘Value’])-1):].replace(“,”,“”)),axis=1)
Codecademy’s:
jeopardy_reformatted_copy[“Float Value”] = jeopardy_reformatted_copy[“Value”].apply(lambda x: float(x[1:].replace(‘,’,‘’)) if x != “None” else 0)
–
Thanks a lot!