My goal
I`m writing a python script which reads data from EXCEL calibration protocols and summarize all relevant data in a Pandas dataframe. For the visualize I tryed pandasgui and dtale. For example, I want to visualize which device classes have a better accuracy, how many calibration protocols do I have in a specific time periode and also look at the calibration data of a specific evice to see where does it have the biggest error.
My problem
The extraction works quite good, but I have a little Problem with the visualization, maybe someone of you has a good idea.
Every row in the Dataframe represents the data of one calibration protocol, so it contains for example the device name, serial number or accuracy but also the reference value and the actual measured value.(See the example code below) I can filter and generate diagrams with the most data really nice. The only problem I have is, if I try to make a diagram with the reference value on the x-axis and the actual value on the y-axis. This is not possible.(Example 1) I think this is because datafames can not handle lists or it interprets lists as strings. So i tried to put every value in a separate column in the dataframe (Example 2) this is much more confusing than the first attempt but still ok. But now I haven´t found a way to put multiple rows at the x and y axis of the diagrams.
My question
Do you have any idea how I could realise this. Maybe I don`t know all the functionality of those 2 gui´s maybe you know another gui or another array type.
A idea was to make a dataframe where the data is summarized and for each device a separate dataframe with the calibration data itself(reference value, actual value, error, ...) and import all dataframes in pandasGui. Than It would be nice if I could have a link from the entry in the summary table to the Dataframe with the calibration data. But I don´t know how I could realise this.
Thanks for your help.
Example 1:
import numpy as np
import pandas as pd
from pandasgui import show
import dtale
DeviceData1 =([ 'Device1',
'123456',
'14.07.2022',
0.1,
[1,2,3,4,5],
[0.99, 2.1,3.2,4, 4.8],
[-0.01,0.1,0.2,0,-0.2]
])
DeviceData2 =([ 'Device2',
'654321',
'11.07.2022',
0.3,
[1,2,3,4,5],
[0.98, 2.2,3.1,4.2, 5],
[-0.02,0.2,0.1,0.2,0]
])
Database_lst= [DeviceData1,DeviceData2]
colName = ['Device name', 'Serialnumber','Date of calibration', 'Accuracy', 'Reference value', 'Actual value', 'Error' ]
df=pd.DataFrame(Database_lst,columns=colName)
show(df)
d1=dtale.show(df).open_browser()
Example 2:
import pandas as pd
from pandasgui import show
import dtale
DeviceData3 =([ 'Device1',
'123456',
'14.07.2022',
0.1,
1,2,3,4,5,
0.99, 2.1,3.2,4, 4.8,
-0.01,0.1,0.2,0,-0.2
])
DeviceData4 =([ 'Device2',
'654321',
'11.07.2022',
0.3,
1,2,3,4,5,
0.98, 2.2,3.1,4.2, 5,
-0.02,0.2,0.1,0.2,0
])
Database_lst1= [DeviceData3,DeviceData4]
colName1 = ['Device name', 'Serialnumber','Date of calibration', 'Accuracy']
colName1.extend(['ref1','ref2','ref3','ref4','ref5'])
colName1.extend(['act1','act2','act3','act4','act5'])
colName1.extend(['err1','err2','err3','err4','err5'])
df1=pd.DataFrame(Database_lst1,columns=colName1)
show(df1)
d2=dtale.show(df1).open_browser()