Login using Social Account
     Continue with GoogleLogin using your credentials
Below are few more special NumPy arrays which you can create to contain random values.
For example:
random.rand()
function of NumPy)empty()
function of NumPy)Note: Please import numpy as np
(1) NumPy array with all its elements values as random values (using random.rand()
function of NumPy)
Create your NumPy array by passing the above the desired dimensions of the array (say (3,4)) to random.rand()
function below
my_rand_array = np.random.<<your code comes here>>(3,4)
The above NumPy array my_rand_array
will have random float values between 0.0 and 1.0
(2) NumPy array with all its elements values as uninitialized values (initialized with some random values which you are not aware of - using the empty()
function of NumPy)
Create a tuple indicating dimensions of the desired array
tup_dim = (3, 4)
Now, create your NumPy array by passing the above tuple (tup_dim
) to empty()
function below
my_uninitialized_array = np.empty( <<your code comes here>>)
The above NumPy array my_uninitialized_array
will be filled with random (also unknown) float values between 0.0 and 1.0
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...