1.

How will you reverse the numpy array using one line of code?

Answer»

This can be done as shown in the following:

reversed_array = arr[::-1]

where arr = ORIGINAL given array, reverse_array is the RESULTANT after reversing all ELEMENTS in the INPUT.



Discussion

No Comment Found