R Read Csv Thousands Separator
How to read number column with comma as thousands separator in CSV file?
The readr::read_csv
function with locale
option is able to parse numbers in different format.
library(readr)
read_csv("x,y\n123,\"4,567\"", locale = locale(grouping_mark = ","))
## # A tibble: 1 x 2
## x y
## <dbl> <dbl>
## 1 123 4567
A thousands
option is available in the python pandas package.
import pandas as pd
pd.read_csv(file, thousands = ",")
Enjoy Reading This Article?
Here are some more articles you might like to read next: