This queston is actually linked to a question I have posted 2 days ago. Jut for reference, this is the link to it:Question Version 1
As there is aparently no answer to the way I was thinking about it, my thought is to filter the data.So, I have this dataset:
d = {'Point': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40], 'Interval 1': [92.417, 117.364, 126.302, 121.816, 126.083, 85.267, 84.977, 85.610, 84.909, 84.535, 85.024, 85.059, 84.798, 84.001, 84.157, 104.918,'','','','','','','','','','','','','','','','','','','','','','','',''],'Interval 2':['','','','','','','','','','','','','','','','',157.884,163.604,122.905,84.770,83.386,83.530,83.418,83.423,83.350,83.618,83.486,83.846,83.622,83.796,83.942,84.068,84.379,84.175,84.010,84.439,84.479,84.599,84.998,101.860]}I convert the dataset to a dataframe:
data = pd.DataFrame(d)The data is then filtered so that I only have the lowest 10% of values in Interval 1 and 2.
I look for the min value in both columns:
min_val = min(data['Interval 1'].apply(pd.to_numeric,errors='coerce').min(), data['Interval 2'].apply(pd.to_numeric,errors='coerce').min())Then I need to convert the emty strings to NaN
cols = ['Interval 1', 'Interval 2']data[cols] = data[cols].apply(pd.to_numeric, errors='coerce')The data is looking in an Excel graph like this:
What I am trying to do is to have a python code looking in the data and pick only the low values of both series. Something like looking at first value, then check if next value is higher -> if yes, store first value, if not, store second value temporarily and repeat the process for all data points.Maybe there is some other option, I am open for all sugestions.Thank you!