I wrote a program for Python that reads a csv file in pandas, and then does some analysis. Unfortunately some friends that are using my program use European computers, as such their csv files use the comma (,) to delimiter decimals, while I use the point (.) . The general delimiter between columns will in any case the semicolon so there are no problems there.
Right now I have a setting at the beginning of the program that goes like this:
european_decimal=True #False
and then later
if european_decimal:
df1 = pd.read_csv(directory+filename,delimiter=";",decimal=",")
else:
df1 = pd.read_csv(directory+filename,delimiter=";")
This, of course, works. But it is really ugly, and requires my friend who is not a computer programmer to mess with the code. Is there any way in which I can find out if a computer where a python program is running is using comma or fullstop as delimiter?
LATE EDIT: at the end I applied @ALollz solution and I simply converted any string with commas in strings with dots:
for column in list_data_columns:
df1[column]=df1[column].astype(str).str.replace(",",".").astype(float)