0

I'm uploading my data from a dictionary.

my_dict={}
for n, number in enumerate(list_of_cc_serialnumbers):    
    temp_dict={}
    temp_dict.update({'c1':dm_NO2_CC_dict[number].parameters['c1'].value})
    temp_dict.update({'c2':dm_NO2_CC_dict[number].parameters['c2'].value})
    temp_dict.update({'c3':dm_NO2_CC_dict[number].parameters['c3'].value})
    temp_dict.update({'c4':dm_NO2_CC_dict[number].parameters['c4'].value})
    temp_dict.update({'NO2_1_TEMP_CAL':dm_NO2_CC_dict[number].parameters['NO2_1_TEMP_CAL'].value})
    my_dict.update({number:temp_dict})

    print(my_dict[number])

df=pd.DataFrame(data=my_dict)
writer = pd.ExcelWriter(r'CC_DATA_NEW-file-2.xlsx')
df_sensor_data = pd.DataFrame(my_dict).T
print(df_sensor_data)
df_sensor_data.to_excel(writer,sheet_name='Configuration_data')
writer.save() 
df 

But the actual data in my_dict is as mentioned above "input data", which is getting rounded off when I upload it into excel(excelsheet). Please do let me know how to upload the exact precise value as it is in my_dict into excel.

excelsheet = 0 0.3679525873392738 Name: c1, dtype: object input Data = 0.36795258733927383 0 False

Name: c1, dtype: bool excelsheet = 1 1.246956941462581 Name: c1, dtype: object input Data = 1.2469569414625805 1 False

Name: c1, dtype: bool excelsheet = 2 1.253324791464017 Name: c1, dtype: object input Data = 1.253324791464017

Please do let me know your inputs.

deeksha
  • 1
  • 3
  • Have you seen this answer, it may help. – live405 Jul 25 '22 at 11:25
  • I'm facing this problem with excel when writing into it, and I donot have particular value to mention about precision value because the dataframe holds different lengths of data. So, I need a solution where I can upload the exact data as it is in my_dict into excel. @live405 – deeksha Jul 25 '22 at 11:40

0 Answers0