It isn't numpy, it's Python.

In Python, there are slices for sequence/iterable, which come in the following syntax

seq[start:stop:step] => a slice from start to stop, stepping step each time.

All the arguments are optional, but a : has to be there for Python to recognize this as a slice.

Negative values, for step, also work to make a copy of the same sequence/iterable in reverse order:

>>> L = range(10)
>>> L[::-1] 
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]

And numpy follows that "rule" like any good 3rd party library..

>>> a = numpy.array(range(10))
>>> a[::-1]
array([9, 8, 7, 6, 5, 4, 3, 2, 1, 0])

See this link

Answer from pradyunsg on Stack Overflow
🌐
w3resource
w3resource.com › python-exercises › numpy › python-numpy-exercise-6.php
NumPy: Reverse an array - w3resource
August 29, 2025 - Write a NumPy program to reverse an array (the first element becomes the last). ... # Importing the NumPy library with an alias 'np' import numpy as np # Creating an array 'x' using arange() function with values from 12 to 37 (inclusive) x = np.arange(12, 38) # Printing the original array 'x' containing values from 12 to 37 print("Original array:") print(x) # Reversing the elements in the array 'x' and printing the reversed array print("Reverse array:") x = x[::-1] print(x)
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.flip.html
numpy.flip — NumPy v2.4 Manual
A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time. ... Flip an array vertically (axis=0). ... Flip an array horizontally (axis=1). ... Try it in your browser! >>> import numpy as np >>> A = np.arange(8).reshape((2,2,2)) >>> A ...
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: arange() and linspace() to generate evenly spaced values | note.nkmk.me
February 2, 2024 - source: numpy_linspace.py · Generating ... print(np.arange(9, 2, -2)) # [9 7 5 3] source: numpy_arange.py · Using the slice [::-1] or np.flip() allows for easy reversal of the result....
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.flip.html
numpy.flip — NumPy v2.5.dev0 Manual
A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time. ... Flip an array vertically (axis=0). ... Flip an array horizontally (axis=1). ... Try it in your browser! >>> import numpy as np >>> A = np.arange(8).reshape((2,2,2)) >>> A ...
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › flip
Python Numpy flip() - Reverse Array Order | Vultr Docs
November 18, 2024 - Use the flip() function to reverse the array. ... import numpy as np arr_1d = np.array([1, 2, 3, 4, 5]) reversed_arr_1d = np.flip(arr_1d) print(reversed_arr_1d) Explain Code
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.arange.html
numpy.arange — NumPy v2.4 Manual
arange(start, stop, step) Values are generated within the half-open interval [start, stop), with spacing between values given by step. For integer arguments the function is roughly equivalent to the Python built-in range, but returns an ndarray rather than a range instance. When using a non-integer step, such as 0.1, it is often better to use numpy.linspace.
🌐
w3resource
w3resource.com › python-exercises › numpy › python-numpy-exercise-177.php
Python NumPy: Create an array of 4,5 shape and to reverse the rows of the said array - w3resource
After reversing 1st row will be 4th and 4th will be 1st, 2nd row will be 3rd row and 3rd row will be 2nd row. ... # Importing NumPy library import numpy as np # Creating a NumPy array using arange from 0 to 19 and reshaping it to a 4x5 array array_nums = np.arange(20).reshape(4, 5) # Printing the original array print("Original array:") print(array_nums) # Reversing the order of rows in the array print("\nAfter reversing:") array_nums[:] = array_nums[3::-1] print(array_nums)
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.flip.html
numpy.flip — NumPy v2.1 Manual
A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time. ... Flip an array vertically (axis=0). ... Flip an array horizontally (axis=1). ... >>> import numpy as np >>> A = np.arange(8).reshape((2,2,2)) >>> A array([[[0, 1], [2, 3]], [[4, ...
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python numpy reverse array
Python NumPy Reverse Array - Spark By {Examples}
March 27, 2024 - The numpy.flipud() function specifically flips the array along its first axis, which corresponds to the up-down direction. It maintains the shape of the array while reversing the order of elements along that axis.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reverse-a-numpy-array
Reverse a Numpy Array - Python - GeeksforGeeks
September 20, 2025 - The numpy.flip() function reverses the order of array elements along the specified axis.
🌐
JAX Documentation
docs.jax.dev › en › latest › _autosummary › jax.numpy.flip.html
jax.numpy.flip — JAX documentation
>>> jnp.flip(x1, axis=1) Array([[2, ... 3], [2, 1]]], dtype=int32) When axis is specified with a sequence of integers, then jax.numpy.flip reverses the array along the specified axes....
🌐
Real Python
realpython.com › how-to-use-numpy-arange
NumPy arange(): How to Use np.arange() – Real Python
July 31, 2023 - You can find more information on the parameters and the return value of arange() in the official documentation. ... The arguments of NumPy arange() that define the values contained in the array correspond to the numeric parameters start, stop, and step.
🌐
GeeksforGeeks
geeksforgeeks.org › python-reverse-a-numpy-array
Python | Reverse a numpy array - GeeksforGeeks
September 16, 2022 - The numpy.flip() function reverses the order of array elements along the specified axis, preserving the shape of the array.
🌐
Scaler
scaler.com › home › topics › what are the different ways to reverse a numpy array?
What are the Different Ways to Reverse a NumPy Array? - Scaler Topics
May 4, 2023 - After that, we used the slicing notation on the array (arr) to get the results in reverse order. As you may expect from the result, slicing does not destroy the original list. Slicing a NumPy array is slower than in-place approaches (like the reverse() function; It is explained in detail in the next to next section) because it creates a shallow duplicate of all entries and requires adequate memory to finish the procedure.
🌐
w3resource
w3resource.com › numpy › manipulation › flip.php
NumPy: numpy.flip() function - w3resource
March 24, 2023 - Example: Flipping and Reversing NumPy Arrays with numpy.flip() >>> import numpy as np >>> X = np.arange(8).reshape((2,2,2)) >>> np.flip(X, 0) array([[[4, 5], [6, 7]], [[0, 1], [2, 3]]]) >>> np.flip(X, 1) array([[[2, 3], [0, 1]], [[6, 7], [4, 5]]]) >>> np.flip(X) array([[[7, 6], [5, 4]], [[3, 2], [1, 0]]]) >>> np.flip(X, (0, 2)) array([[[5, 4], [7, 6]], [[1, 0], [3, 2]]]) >>> X = np.random.randn(3,4,5) >>> np.all(flip(X,2) == X[:,:,::-1,...]) True ·
🌐
Nickmccullum
nickmccullum.com › how-to-use-numpy-arange
np.arange() - How To Use the NumPy arange() Method | Nick McCullum
April 25, 2020 - In this article, I teach you how to use Numpy's np.arange method. Learn how to use np.arange() the right way by following my step-by-step code in this tutorial.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.flip.html
numpy.flip — NumPy v2.2 Manual
A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time. ... Flip an array vertically (axis=0). ... Flip an array horizontally (axis=1). ... >>> import numpy as np >>> A = np.arange(8).reshape((2,2,2)) >>> A array([[[0, 1], [2, 3]], [[4, ...
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.arange.html
numpy.arange — NumPy v2.5.dev0 Manual
arange(start, stop, step) Values are generated within the half-open interval [start, stop), with spacing between values given by step. For integer arguments the function is roughly equivalent to the Python built-in range, but returns an ndarray rather than a range instance. When using a non-integer step, such as 0.1, it is often better to use numpy.linspace.