Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from physics import *
- N = 3.0
- x = ones(N)
- for i in x:
- x[i] = i * uniform(10)
- >>> import random
- >>> array = [1]*random.randint(1, 10)
- >>> array
- [1, 1, 1, 1, 1]
- >>> for i, j in enumerate(array):
- ... array[i] = j*random.randint(1, 10)
- ...
- >>> array
- [3, 7, 5, 1, 2]
- >>>
- from physics import *
- N = 3.0
- x = ones(N)
- for i in range(len(x)):
- x[i]=i*uniform(10)
- import numpy as np
- x = np.random.uniform(0, 10, N) * np.arnage(N)
- N = 10
- x = numpy.ones(N)
- x *= numpy.random.uniform(10, size=N)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement