Use this array to complete the assignment: Array for assignment Directions
Begin by creating a NumPy array with the values shown above Now
manipulate the array in the following ways (overwrite the original
array) : Print it to the console Transpose it and print it to the
console Swap the axes and print it to the console (look familiar?)
Flip the array across the horizontal axis (first row should be
5,2,1 afterwards) and print to console Add the following to the
array: A row at the bottom of the array with these values 3,4,5 and
print to console A column at the right of the array with these
values 7,8,9,0 and print to console You should now have a NumPy
array that looks like this (If you don't and can't figure
it out, just build this array to complete the rest of the
assignment): Partial complete array Now do the following with this
array: Remove the last column in the array Reshape the array so it
is two columns and 6 rows and print to console Split the array into
three 2x2 arrays and print the middle array Flatten the third array
and print to console
Use this array to complete the assignment: Array for assignment Directions Begin by creating a NumPy array with the valu
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am