Correct
laptops["weight"] = laptops["weight"].str.replace("kgs","").str.replace("kg","").astype(float)
Results in error : ValueError: could not convert string to float: ‘4s’
laptops["weight"] = laptops["weight"].str.replace("kg","").str.replace("kgs","").astype(float)
Why does flipping the order of kg and kgs causes the error? Thanks for the guidance
Prem
#2
Hi @genesix32
Please go through the below post, and it will help you to understand why flipping the order gives an error.
Thank You 
1 Like