-2

Just a quick question,

I came across a NumPy array operation which is important for the code and i cannot understand what this does.

Probs = Y[ ... , 0]

Code for reference Python code

Any help will be appreciated.

1 Answers1

0

In a 2d numpy array this should give you the first element of each nested list, so for example:

import numpy as np
Y = np.asarray([[1,2,3,4], [1,2,3,4], [2,3,4,5]])
Y[..., 0]
>>> array([1, 1, 2])
nickyfot
  • 1,932
  • 17
  • 25