9951 explained code solutions for 126 technologies


python-numpyGenerate Numpy zeros array with custom data type


import numpy as np
a = np.zeros((2, 3), dtype='int64')ctrl + c
import numpy as np

load 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