Numpy expand_dims() method expands the shape of an array. The np expand_dims inserts a new axis that will appear at the axis position in the expanded array shape.

Np expand_dims

Python Numpy expand_dims() method expands the array by inserting a new axis at the specified position. This function requires two parameters.

Syntax

np.expand_dims(arr, axis)

#numpy #python

Np expand_dims | Numpy expand_dims() Example in Python
29.50 GEEK