I have two arrays. Shown below is a preview of each:
[0.25 0.5 0.75 ... 0. 0. 0.25]
[0.51725357 0.51725357 0.51725357 ... 0.56406901 0.51725357 0.51725357]
You may notice that the second array has values that repeat often. What I would like to do is create two new arrays of the same length. One array would be comprised of all of the unique values from the second array I have listed. The other array would be comprised of the sum of all values from the first array that correspond to a unique value from the second array.
For example, in the arrays I have shown, 0.51725357 has a cumulative sum of 1.75 from the first array, so if 0.51725357 were the first entry in the first of the new arrays, then 1.75 would be the first value in the second of the new arrays.
I understand that I have not worded this well, but hopefully my question is clear enough. Thank you. The usage of any package is fine.