0

I am reading other's code and saw this line:

pos_encoding = angle_rads[np.newaxis, ...]

This is the firs time I saw [xyz, ...]. What does the 3 dots mean in this list notation?

marlon
  • 6,029
  • 8
  • 42
  • 76
  • @don'ttalkjustcode That won't tell you anything about how `angle_rads.__getitem__` interprets it. – chepner Sep 02 '21 at 00:03
  • You don't need to know what `...` is, only what `angle_rads` is to find its definition. (Knowing that `...` is the sole instance of the `ellipsis` class won't help you find that documentation.) – chepner Sep 02 '21 at 00:08
  • It's called an [Ellipsis](https://docs.python.org/3/library/constants.html#Ellipsis). It's used to do extended slicing in `numpy` as explained in its documentation [here](https://numpy.org/doc/stable/reference/arrays.indexing.html#indexing). – martineau Sep 02 '21 at 00:10

0 Answers0