Answers for "how to create an array with the same value in python numpy"

1

create an array with same value python

>> import numpy as np
>> fives = np.repeat(5, 10)
#This creates an array of the number 5 repeated 10 times.
Posted by: Guest on June-28-2021
0

create an array of n same value python

>> import numpy as np

>> np.full(
    shape=10,
    fill_value=3,
    dtype=np.int)

array([3, 3, 3, 3, 3, 3, 3, 3, 3, 3])
Posted by: Guest on May-07-2020

Code answers related to "how to create an array with the same value in python numpy"

Python Answers by Framework

Browse Popular Code Answers by Language