numpy.random.randn (d0, d1, … , DN) is to return one or more sample values from the standard normal distribution.
numpy.random.rand (d0, d1, … , DN) in [0,1].
numpy.random.rand (d0,d1,… ,dn)
The rand function generates data between [0,1] according to the given dimension, including 0 and excluding 1DN table. The return value of each dimension is the array of the specified dimension
np.random.rand(4,2)
array([[0.64959905, 0.14584702],
[0.56862369, 0.5992007 ],
[0.42512475, 0.83075541],
[0.75685279, 0.00910825]])
np.random.rand(4,3,2) # shape: 4*3*2
array([[[0.07304796, 0.48810928],
[0.59523586, 0.83281804],
[0.47530734, 0.50402275]],
[[0.63153869, 0.19636159],
[0.93727986, 0.13564719],
[0.11122609, 0.59646316]],
[[0.17276155, 0.66621767],
[0.81926792, 0.28781293],
[0.20228714, 0.72412133]],
[[0.29365696, 0.53956076],
[0.19105394, 0.47044441],
[0.85930046, 0.3867359 ]]])
Read More:
- Matlab: Three forms of random number generated (Rand, Randi and Randn)
- Numpy adds a new dimension: newaxis
- Tensorflow image random_ There seems to be something wrong with the shift function
- Tensorflow: How to use expand_Dim() to add dimensions
- [Python] numpy library array splicing np.concatenate Detailed explanation and examples of official documents
- [solved] error: valueerror: expected 2D array, got scalar array instead
- Lua — using remove to delete table data
- “Typeerror: invalid dimensions for image data” in Matplotlib drawing imshow() function
- Numpy realizes the forward propagation process of CNN
- Error: improvement of not enough values to unpack (expected 2, got 1)
- How to Find the Standard Deviation in Minitab
- The usage details of SVM
- The usage of Matlab function downsample
- Python TypeError: return arrays must be of ArrayType
- Ctfhub error injection
- RuntimeError: log_vml_cpu not implemented for ‘Long’
- R language notes – sample() function
- Unable to call numpy in pychar, module notfounderror: no module named ‘numpy’
- Dataframe to numpy.ndarray Related issues of
- Statistical learning: ANOVA (analysis of variance) (1)