i'm using a dataset that contains a column "Streams" dtype: object and i just need to replace "," by "." to later use pandas.to_numeric() and convert String by float64. Is there a way to replace only the characters and keep the numbers?
Example: 48,633,449 to 48.633.449
Code:
import pandas as pd
import numpy as np
dados = pd.read_csv("spotify_dataset.csv")
dados.dropna()
dados['Streams'].replace(",", ".")
dados['Streams'] = pd.to_numeric(dados['Streams'])
dados.head()
and got this:
ValueError: Unable to parse string "48,633,449" at position 0
[Error]