Skip to content Skip to sidebar Skip to footer

Remove $ From A Column Of Salaries Python 3

I am trying to print the min and max from a list of salaries that I am reading from a csv file, but first I must remove the $ from the value and don't know how. I tried iterating t

Solution 1:

Hard to know the exact problem without the code, but you could try one of these:

new_salary = [s.replace("$", "") for s in salary]

or:

new_salary = [s[1:] for s in salary]

Post a Comment for "Remove $ From A Column Of Salaries Python 3"