I want to remove the "Rs." and commas and just get the numeric values of the column. I tried the following code but I'm not getting the output.
def remove_charaters(value):
numbers = []
for word in value.split():
if word.isdigit() or word=='.': #or condition for decimal point
numbers.append(int(word))
num=''.join(numbers)
print(num)
return (float(num))
cm=[]
for i in p_dataset['City_Mileage'].astype(str):
cm.append(remove_charaters(i))
print(cm)
p_dataset['City_Mileage']=cm