Note: Set numpy random seed value 100
• Define a random 3-D array x2 of shape (x, y, z) and of numbers between 0 and 1
• Print the value of x2
✓ Sample Case
Sample Input For Custom Testing
3 4 2
Sample Output
[[[0.00568851 0.25242635]
0.01525497]
[0.79566251 [0.59884338 0.60380454]
[0.10514769 0.38194344]]
[[0.03647606
0.89041156]
[0.98092086 8.05994199]
[0.89054594
0.5769015 ]
[0.74247969 0.63018394]]
[[0.58184219
0.02043913]
[8.21002658
0.54468488]
[0.76911517 0.25069523]
[0.28589569
0.85239509]]]
# Python Program illustrating
# numpy.random.rand() method
import numpy as geek
# 3D Array
array = geek.random.rand(2, 2 ,2)
print("\n\n3D Array filled with random values : \n", array);
Comments
Leave a comment