Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 569 Bytes

generate-numpy-zeros-array-with-custom-data-type.md

File metadata and controls

27 lines (21 loc) · 569 Bytes

Generate Numpy zeros array with custom data type

import numpy as np
a = np.zeros((2, 3), dtype='int64')
  • import numpy as np - load lib:Numpy module for Python
  • np.zeros - generates zeros array
  • (2, 3) - generated array dimensions (2x3 in our case)
  • dtype='int64' - Numpy numeric data type to use

group: array_generate

Example:

import numpy as np
a = np.zeros((2, 3), dtype='int64')
print(a)
[[0 0 0]
 [0 0 0]]

link_youtube: https://youtu.be/2-bBdKdPDpw