I have two dataframes. One represents the minimum values and the other the maximum values. As below:
df_Min = pd.DataFrame({'IDsensor': [1, 2, 3],
'Sensor_SYS1_Min': [54, 55, 75],
'Sensor_SYS2_Min': [320, 315, 400]})
df_Max = pd.DataFrame({'IDsensor': [1, 2, 3],
'Sensor_SYS1_Max': [55, 60, 80],
'Sensor_SYS2_Max': [320, 320, 800]})
I would like to calculate the variation between them. That is, the oscillation between the maximum value and the minimum value.
I tried to do the following operation (This operation is incorrect):
df_Oscillation = abs(df_Max - df_Min)
I would like the output to be like this:
df_Oscillation = pd.DataFrame({'IDsensor': [1, 2, 3],
'Sensor_SYS1_Oscillation': [1, 5, 5],
'Sensor_Oscillation': [0, 5, 400]})