I have a question for a problem I am trying to solve.
I have a rather large array with a series of numbers ranging from 4, 4.2,4.4 and 16, 16.5, 16.7 and so on in column 1 and a series of 0s and 1s in column 2 corresponding to each number such that column 1 will be say 5 and column 2 will be say 0. Below is a very small version of the matrix I am working with:
[5,0;5.10000000000000,0;5.20000000000000,0;5.25000000000000,0;5.30000000000000,0;5.35000000000000,0;5.45000000000000,0;5.50000000000000,0;5.55000000000000,0;5.60000000000000,0;14.2000000000000,0;5.70000000000000,0;5.80000000000000,0;5.90000000000000,0;14.0000000000000,0;14.9500000000000,1;14.8500000000000,1;14.6000000000000,1;14.3500000000000,1;14.3000000000000,1;14.2500000000000,1;14.3500000000000,1;14.2500000000000,1;14.1500000000000,1;14.0500000000000,1;]
What I want to do is write code that averages the 0s and 1s of column 2 for each integer in column 1. I honestly have no idea where to begin, I started to write a for loop, but was unsure of how I would execute a a process on a group of rows in column 2 on the basis of a group of rows in column 1. Does anyone have any ideas? I apologize I do not have any example code just yet, I honestly have no idea what to do at this point.