Currently, I am facing an issue while plotting a temperature chart as I have two arrays:
a, which consists of registered temperature values throughout the day. For example:
a=[22.1, 23.4, 21.7,...];
and b, containing the corresponding timestamps for each temperature value. For instance:
b= ["2016-12-15 16:50","2016-12-15 16:55","2016-12-15 17:00",...]
These two arrays are interconnected! If I pick the temperature value from
a[2],
it correlates to the timestamp in
b[2]
Here's what I aim to achieve:
I want to "merge" similar values. For instance, if my array a contains values like 22.1 at index 3, 4, 5, 6, and 7, I wish to combine them into one single 22.1 at index 3 of array a. Subsequently, I aim to eliminate all items from array b that correspond to indexes 4, 5, 6, and 7. Furthermore, I want to maintain the order within both array a and array b. Please note that this is just an example, and my actual intention is not always to remove elements indexed from 4 to 7.