Answers for "ellipsis in python as index"

0

ellipsis in python as index

#The ellipsis is used in numpy to slice higher-dimensional data structures.
#It's designed to mean at this point, insert as many full slices (:) 
#to extend the multi-dimensional slice to all dimensions. so e.g.
a = np.zeros((3,3,3))
a[::, 0]
#gives the same as
a[..., 0]
Posted by: Guest on July-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language