I have the following 3x3x3 (3 rows, 3 columns with 3 elements in each cell) numpy array...
[[[1, 1, 19],
[2, 2, 29],
[3, 3, 39]],
[[4, 4, 49],
[1, 1, 19],
[2, 2, 29]],
[[3, 3, 39],
[9, 9, 99],
[8, 8, 89]]]
and the following pandas dataframe...
col0 col1 col2 col3
1 1 19 10
2 2 29 20
3 3 39 30
4 4 49 40
8 8 89 80
9 9 99 90
I want to generate a new pandas data frame using values from col3, that matches each 3 element array (e.g. [1, 1, 19] or [4, 4. 49]) with col0, col1, col3.
Order of the 3 element array is important, the first element must match to col0, and second to col1 and so on.
The resulting data frame would look like the following...
colA colB colC
10 20 30
40 10 20
30 90 80
80which appears nowhere in the input. Can you clarify how the input maps to the output?