Search code examples
arrayscell-array

Extracting arrays from array


I am currently working on machine learning, and as so I have an array in which the first column is the data and the second column is the label. Data was originally a cell array from Matlab (Not sure if that is important). [My Array of arrays] https://i.sstatic.net/JFpWO.png

To make sure that everything is as it should be I would like to extract one of the arrays in index 0 and check its dimensions with the numpy.shape function. Currently, if I try that I just get the shape of the bigger array IE. (394,2)

Any ideas?


Solution

  • There are different ways.: Try..

    arr[:,1,:]
    

    or

    arr[:,1]
    

    or

    [a[1] for a in arr]