I have a DataFrame with 6676 rows and 40 columns. This is a truncated version of the two columns of interest.
user_id pos
0 1520304915 0.3612
1 1520304915 0.0000
2 1520278540 0.0000
3 1520302105 0.4404
4 1520278547 -0.1531
5 1520303294 0.4404
6 1520278540 -0.1027
7 1522888020 0.9512
8 1520302847 0.7192
9 1523490451 0.8689
I also have a separate list of user_id's.
0 1528106864
1 1520303069
2 1520305391
3 1521519315
4 1520303294
5 1520302954
6 1520302702
7 1528108709
8 1520278540
9 1520304915
I want to iteratively extract individual numpy arrays for the 'pos' values for each 'user_id' if the 'user_id' is present in the list. This should return 10 individual arrays.
The arrays would be of differing lengths as there are variable user_id's in the DataFrame.
Here are two examples of what the arrays would look like drawn from the truncated data above... this is mainly just a visualisation aid based on the values above I can see.
1520304915: ([0.3612, 0.0000, ...
1520278540: ([0.0000, -0.1027, ...