Challenge: NumPy Essentials
Complete this challenge to practice what you’ve learned about NumPy essentials so far.
We'll cover the following
Perform the following tasks:
- Generate a vector array of 25 numbers using
arange()
. - Write a code to convert the vector array into a 2-D matrix using reshape.
- Add a scalar value to all the values in the array.
- Return the array.
Input
N/A
Output
The method should return a matrix of numbers containing values from 100 to 124.
Sample output
[[100 101 102 103 104] [105 106 107 108 109] [110 111 112 113 114] [115 116 117 118 119] [120 121 122 123 124]]
Get hands-on with 1400+ tech skills courses.