``````

In [1]:

import numpy as np

``````
``````

In [2]:

print(np.zeros(3))

``````
``````

[ 0.  0.  0.]

``````
``````

In [3]:

print(np.zeros((2, 3)))

``````
``````

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

``````
``````

In [4]:

print(np.zeros(3).dtype)

``````
``````

float64

``````
``````

In [5]:

print(np.zeros(3, dtype=np.int))

``````
``````

[0 0 0]

``````
``````

In [6]:

print(np.zeros(3, dtype=np.int).dtype)

``````
``````

int64

``````
``````

In [7]:

print(np.ones(3))

``````
``````

[ 1.  1.  1.]

``````
``````

In [8]:

print(np.ones((2, 3)))

``````
``````

[[ 1.  1.  1.]
[ 1.  1.  1.]]

``````
``````

In [9]:

print(np.ones(3).dtype)

``````
``````

float64

``````
``````

In [10]:

print(np.ones(3, dtype=np.int))

``````
``````

[1 1 1]

``````
``````

In [11]:

print(np.ones(3, dtype=np.int).dtype)

``````
``````

int64

``````
``````

In [12]:

print(np.full(3, 100))

``````
``````

[100 100 100]

``````
``````

In [13]:

print(np.full(3, np.pi))

``````
``````

[ 3.14159265  3.14159265  3.14159265]

``````
``````

In [14]:

print(np.full((2, 3), 100))

``````
``````

[[100 100 100]
[100 100 100]]

``````
``````

In [15]:

print(np.full((2, 3), np.pi))

``````
``````

[[ 3.14159265  3.14159265  3.14159265]
[ 3.14159265  3.14159265  3.14159265]]

``````
``````

In [16]:

print(np.full(3, 100).dtype)

``````
``````

int64

``````
``````

In [17]:

print(np.full(3, 100.0).dtype)

``````
``````

float64

``````
``````

In [18]:

print(np.full(3, np.pi).dtype)

``````
``````

float64

``````
``````

In [19]:

print(np.full(3, 100, dtype=float))

``````
``````

[ 100.  100.  100.]

``````
``````

In [20]:

print(np.full(3, np.pi, dtype=int))

``````
``````

[3 3 3]

``````