I'd like to transform my numpy array ( shape=(27, 77, 77) ) :
[[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
...,
[1., 1., 1., ..., 2., 2., 2.],
[1., 1., 1., ..., 2., 2., 2.],
[1., 1., 1., ..., 1., 2., 2.]],
...,
[[1., 1., 1., ..., 1., 1., 0.],
[1., 1., 1., ..., 1., 1., 0.],
[1., 1., 1., ..., 1., 1., 0.],
...,
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.]])
into a pandas dataframe with columns 'x' = index 2 (right), 'y' = index 1 (down), 'z' = index 0 ( the 27 "different" arrays) and 'v' = the values in it. df.columns=['x','y','z','v']
I'm relatively new to python, do you know how I should code this?
Thanks !