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.
question from:
https://stackoverflow.com/questions/65910188/change-default-decimal-separator-in-pandas-read-sql 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…