**The problem**: 
I have a 3-D Numpy Array:

`X`

`X.shape: (1797, 2, 500)`

```
z=X[..., -1]
print(len(z))
print(z.shape)
count = 0
for bot in z:
    print(bot)
    count+=1
    if count == 3: break

```

Above code yields following output:

```
1797
(1797, 2)
[23.293915 36.37388 ]
[21.594519 32.874397]
[27.29872  26.798382]

```

So, there are 1797 data points - each with a X and a Y coordinate
and, there are 500 iterations of these 1797 points.

I want a DataFrame such that:

```
Index Column       |  X-coordinate  |  Y-coordinate
0                  |  X[0][0][0]    |  X[0][1][0]
0                  |  X[1][0][0]    |  X[1][1][0]
0                  |  X[2][0][0]    |  X[2][1][0]
('0') 1797 times
1                  |  X[0][0][1]    |  X[0][1][1]
1                  |  X[1][0][1]    |  X[1][1][1]
1                  |  X[2][0][1]    |  X[2][1][1]
('1' 1797 times)
.
.
.
and so on
till 500

```

I tried techniques mentioned here, but numpy/pandas is really escaping me:

1. [How To Convert a 3D Array To a Dataframe](https://stackoverflow.com/questions/52195426/how-to-convert-a-3d-array-to-a-dataframe)
2. [How to transform a 3d arrays into a dataframe in python](https://stackoverflow.com/questions/35525028/how-to-transform-a-3d-arrays-into-a-dataframe-in-python)
3. [Convert numpy array to pandas dataframe](https://stackoverflow.com/questions/50624046/convert-numpy-array-to-pandas-dataframe)
4. [easy multidimensional numpy ndarray to pandas dataframe method?](https://stackoverflow.com/questions/36853594/easy-multidimensional-numpy-ndarray-to-pandas-dataframe-method)
5. [numpy rollaxis - how exactly does it work?](https://stackoverflow.com/questions/22583792/numpy-rollaxis-how-exactly-does-it-work)

Please help me out.
Hope I am adhering to the question-asking discipline.