vhoang,
Thank you so much for you help! I agree with you I need to learn more about data structures, but I assumed that using numpy and pandas would be the easiest way. But I will do it without them, but I don’t know how. My end goal is to make a schedule for the state of the vertical for each hour and the year for an office room.
I have four sensors in an office room. For each sensor, I have values (based on penalty function) for each hour of the year and for each state (I used for states: 0, 45, 90, 135). So, 487604 values. Here is an image of my results in grasshopper. {sensor;hour;state} So the value 1.7971 represents the value for sensor 0, hour 1, and state 2.

What I would do with the data is:
Step 1: I would like to summate the values for each of the four states from all the four sensors for all the 8760 hours. For example:
state_0_hour_1 = state_0 _hour_1_sensor_1 + state_0 _hour_1_sensor_2 + state_0 _hour_1_sensor_3 + state_0 _hour_1_sensor_4.
state_0_hour_2 = etc…
So this would give me a list of 4 columns and 8760 rows.
Step 2: Subsequently I would like to find the minimum for each hour. This will give me state with the lowest value for each hour.
For example:
Minimum(state_0 _hour_1, state_45 _hour_1, state_90 _hour_1, state_135 _hour_1)
Step 3: Finally, I would like to know from which of the four columns the minimum value is coming from.
For example I would give the columns a number:
1: state_0
2: state_45
3: state_90
4: state_135
This will give a list with 8760 rows and for each row a number (1,2,3 or 4) which represent the state of the blinds.
I hope that it is now a little more clear what my end goal is, but it not very easy to explain it clear.
Do you have advice for me about how I can achieve this with Python in Grasshopper. For example:
How can I select every hourly value for a certain state for all the four sensors and summate them? And how do I pick the minimum value? How do I subsequently track down the list and so the blinding state?
Kind regards,
Kim Bodde