# Numpy random.rand to generate multidimensional random array in Python

Python Numpy random.rand can generate a multidimensional random array matrix of size equal to the provided input tuple. So, for example, if you provide (3,2) then it will generate a matrix of 3 rows and 2 columns. Similarly, for 3 tuples like (4,3,2), it will generate a matrix with 4 matrixes of size (3,2).

``np.random.rand(4,3)``

The output of `np.random.rand(4,3)` will be –

``````array([
[0.57357548, 0.19444858, 0.75578484],
[0.93784862, 0.24637747, 0.67862654],
[0.92367486, 0.16787733, 0.92856422],
[0.23546244, 0.23296524, 0.99945754],
])``````

You can see there are 4 rows and 3 columns.

Get only the best articles delivered to your mail

## valueerror: expected object or value – Python Pandas

When reading JSON as pandas dataframe, we sometimes get the valueerror: expected object or value. The primary reasons for this error are – JSON file path is not correct. Error…

## ‘return’ outside function – Python Error

Python throws error, ‘return’ outside function, if you use return statement without defining a function. return statement can only be used within function definition and not outside it. Consider this…

## ‘int’ object is not iterable – Python Error

Python throws the error ‘int’ object is not iterable, when we try to use an integer value as an array or list. If you want to make your variable iterable,…

## ‘method’ object is not subscriptable – Python Error

Python throws error, ‘method’ object is not subscriptable, when a class method is indexed or subscripted using square brackets [] like if its a list or tuple or array. Consider…

## ‘conda’ is not recognized as an internal or external command, operable program or batch file.

You get the Python Anaconda error, ‘conda’ is not recognized as an internal or external command, operable program or batch file, when the path variable in environment is not set…

## ‘function’ object is not subscriptable – Python Error

Python throws the error, ‘function’ object is not subscriptable, when we try to index or subscript a python function. Only iterables like array, list, tuples, dictionaries etc. are allowed to…