I have a column with about 5000 indexes. In each row, there is numeric value. However, for some rows the numbers contain decimal points, meaning that it contains dots. For example, 1000 is expressed like 1.000. How would i fix this with pandas?
Asked
Active
Viewed 4,656 times
0
-
`df['column'].str.replace('\.','').astype(int)` – Umar.H Jan 03 '20 at 11:35
-
your code shows following error : Can only use .str accessor with string values, which use np.object_ dtype in pandas – Poryui jax Jan 03 '20 at 11:36
-
2Use `df.read_csv(file, thousands='.')` – jezrael Jan 03 '20 at 11:37