Change default decimal separator in pandas read_sql
First of all, python uses "." to write floats so you cant have floats written with ",". If you want floats written with "," they must be strings. However, you can save floats with the decimal "," as you save the .csv, by passing the argument decimal=',' to df.to_csv().
I'm creating a python script, that create csv files as result from sybase queries.
When pandas creates the file, all numeric values inside csv file ends with ".0" (for example, 2.0 instead of 2 )
I can cast to integer in query, but it affects query performance.
In order to solve that, I setted coerce_float parameter to false inside read_sql function.
However all columns are converted to string, and some columns must be floats, and the decimal separator is "." and I need "," as decimal separator.
My question is:
Is there some way to change default  decimal separator as a comma and keep coerce_float to False?
Obs: a simple string replace doesnt solve my problem, because the script will read several query files.