I've been trying to get all my data from a dynamodb database with boto3. After receiving all the data im trying to export the data to .csv The problem is that all my decimal numbers loose their comma. For example 3.457 becomes : 3457 Which is a big difference for further calculations. I tried to use df.values.round(4) but that does nothing. When im printing the dataframe to the console i can see that all values are correct. Something goes wrong with the exporting part.
This is the code that i'm using:
#Get all items from Dynamodb
response = vopak_table.scan()
data = response['Items']
while 'LastEvaluatedKey' in response:
response = vopak_table.scan(ExclusiveStartKey=response['LastEvaluatedKey'])
data.extend(response['Items'])
#Write data to CSV
df = pd.DataFrame(data)
#Time column first in sheet
first_column = df.pop('time')
df.insert(0,'time',first_column)
#Save as CSV
df.to_csv(r'C:\***\export.csv',index=False, header=True)
print(df)
Printing to the console the result is like this:
before the save :
after the save : 3:
Thanks!