0 points

convertToInt


dashboard

Sat Sep 19 2020 19:51:29 GMT+0000 (UTC)

Posted by @Nick.Kolowich@gmail.com #python

# creates a list of numbers

numbers = ['1','2','3','4','5','6','7','8','9','0'] 

# a function that removes the string characters such as "$" or "," by using the list created above

def convertToInt(column):
    return int(''.join(filter(lambda x: x in numbers, column)))
content_copy Copy