Q:

Write a NumPy program to create a 3x3x3 array with random values

0

Write a NumPy program to create a 3x3x3 array with random values.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.random.random((3,3,3))
print(x)

Sample Output:

[[[ 0.08372197  0.09089865  0.54581268]                                
  [ 0.62831932  0.06252404  0.1108799 ]                                
  [ 0.25040264  0.80817908  0.37027715]]                               
                                                                       
 [[ 0.44916756  0.66390614  0.83100662]                                
  [ 0.87831954  0.17075539  0.7506945 ]                                
  [ 0.56165801  0.72280907  0.22771692]]                               
                                                                       
 [[ 0.04956428  0.7143399   0.37042941]                                
  [ 0.78875282  0.27425369  0.88486919]                                
  [ 0.13395418  0.86087257  0.36234729]]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now