Flash Sale: **Flat 70% + Addl. 25% Off** on all Courses | Use Coupon **DS25** in Checkout | Offer Expires In

- Home
- Assessment

Below are few more special NumPy arrays which you can create to contain random values.

For example:

- NumPy array with all its elements values as random values (using
`random.rand()`

function of NumPy) - NumPy array with all its elements values as uninitialized values
(initialized with some random values which you are not aware of -
using
`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

XP

Checking Please wait.

Success

Error

No hints are availble for this assesment

Answer is not availble for this assesment

**Note - **Having trouble with the assessment engine? Follow the steps listed
here

## Loading comments...