We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Zeros and Ones
- Discussions
Zeros and Ones
Zeros and Ones
Sort by
recency
|
303 Discussions
|
Please Login in order to post a comment
dtype = depending on the version used
import numpy shape = tuple(map(int, input().strip().split())) print(numpy.zeros(shape, dtype=numpy.int_)) print(numpy.ones(shape, dtype=numpy.int_))
import numpy as np
size = tuple(map(int, input().strip().split())) print(np.zeros(size, dtype=np.int16)) print(np.ones(size, dtype=np.int16))
ar = list(map(int,input().split()))
ex = (np.zeros(ar, dtype = int))
ey = (np.ones(ar, dtype = int))
print(ex)
print(ey)