Javatpoint Logo
Javatpoint Logo

numpy.matlib.zeros()

This function is used to return a new matrix with the values initialized to zeros.

Syntax

Parameters

It accepts the following parameters.

  1. shape: It is the Tuple defining the shape of the matrix.
  2. dtype: It is the data type of the matrix.
  3. order: It is the insertion order of the matrix.

Return

A matrix with uninitialized entries is returned.

Example

Output:

[[0. 0. 0.]
 [0. 0. 0.]
 [0. 0. 0.]]

Example: initializing integer values

Output:

[[0 0 0]
 [0 0 0]
 [0 0 0]]

Example: specifying Insertion order

Output:

[[0 0 0]
 [0 0 0]
 [0 0 0]]

Next Topicnumpy.arrange()





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA