NumPy - NumPy Array Manipulation - numpy.squeeze - NumPy

Explain the function of numpy.squeeze

From the shape of the given array, one-dimensional entyry is removed by this function. The function requires two parameters.

Where,

S.No
Parameter & Description
1.
arr
Input array
2.
axis
int or tuple of int. selects a subset of single dimensional entries in the shape

Example

The output appears as:

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

NumPy Topics