The dictionary meaning for ravel is

to become unwoven, untwisted, or unwound

We tend to use unravel in same way

to separate or undo the texture of : UNRAVEL

https://www.merriam-webster.com/dictionary/ravel

In numpy flatten does the same thing, except it always makes a copy. ravel is more like reshape(-1), returning a view where possible

It's use for computational arrays may trace back to apl in the 1960s.

https://aplwiki.com/wiki/Ravel.

Answer from hpaulj on Stack Overflow
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.2 Manual
When a view is desired in as many cases as possible, arr.reshape(-1) may be preferable. However, ravel supports K in the optional order argument while reshape does not. ... It is equivalent to reshape(-1, order=order). >>> import numpy as np >>> x = np.array([[1, 2, 3], [4, 5, 6]]) >>> np.ravel(x) array([1, 2, 3, 4, 5, 6])
User Guide
Fundamentals and usage · Advanced usage and interoperability
numpy.squeeze
Remove axes of length one from a · Selects a subset of the entries of length one in the shape. If an axis is selected with shape entry greater than one, an error is raised
numpy.asarray
Convert the input to an array · Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays
numpy.transpose
Returns an array with axes transposed · For a 1-D array, this returns an unchanged view of the original array, as a transposed vector is simply the same vector. To convert a 1-D array into a 2-D column vector, an additional dimension must be added, e.g., np.atleast_2d(a).T achieves this, as ...
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.4 Manual
numpy.ravel(a, order='C')[source]# Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-ravel-python
numpy.ravel() in Python - GeeksforGeeks
December 23, 2024 - The numpy.ravel() functions returns contiguous flattened array(1D array with all the input-array elements and with the same type as it). A copy is made only if needed.
🌐
Programiz
programiz.com › python-programming › numpy › methods › ravel
NumPy ravel()
The ravel() method flattens a NumPy array without changing its data. The ravel() method flattens a NumPy array without changing its data. Example import numpy as np array1 = np.array([[0, 1], [2, 3]]) # flatten an array array2 = np.ravel(array1) print(array2) # Output : [0 1 2 3] ravel() Syntax ...
🌐
Medium
medium.com › @whyamit101 › numpy-ravel-in-python-4da4f282986e
numpy.ravel() in Python. If you think you need to spend $2,000… | by why amit | Medium
February 26, 2025 - That’s where numpy.ravel() steps in—your trusty tool for flattening arrays effortlessly.
🌐
w3resource
w3resource.com › numpy › manipulation › ravel.php
NumPy: numpy.ravel() function - w3resource
March 24, 2023 - The numpy.ravel() function is used to create a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array.
🌐
Codecademy
codecademy.com › docs › python:numpy › ndarray › .ravel()
Python:NumPy | ndarray | .ravel() | Codecademy
May 30, 2025 - The .ravel() method returns a contiguous flattened array. It is used to convert a multi-dimensional array into a one-dimensional array.
Find elsewhere
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.1 Manual
When a view is desired in as many cases as possible, arr.reshape(-1) may be preferable. However, ravel supports K in the optional order argument while reshape does not. ... It is equivalent to reshape(-1, order=order). >>> import numpy as np >>> x = np.array([[1, 2, 3], [4, 5, 6]]) >>> np.ravel(x) array([1, 2, 3, 4, 5, 6])
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_ndarray_ravel.htm
Numpy ravel() Function
The Numpy ravel() Function returns a flattened array by providing a 1-D array containing the same elements as the input but with only one dimension. When compared to flatten() function the ravel() returns a flattened view of the input array whenever
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › ravel
Python Numpy ravel() - Flatten Array | Vultr Docs
November 14, 2024 - The ravel() function is a versatile tool in NumPy for flattening arrays into a one-dimensional structure. Whether dealing with simple two-dimensional arrays or more complex ones, utilizing this function ensures that data manipulation becomes ...
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ravel_multi_index.html
numpy.ravel_multi_index — NumPy v2.1 Manual
raveled_indicesndarray · An array of indices into the flattened version of an array of dimensions dims. See also · unravel_index · Notes · New in version 1.6.0. Examples · >>> import numpy as np >>> arr = np.array([[3,6,6],[4,5,1]]) >>> np.ravel_multi_index(arr, (7,6)) array([22, 41, 37]) >>> np.ravel_multi_index(arr, (7,6), order='F') array([31, 41, 13]) >>> np.ravel_multi_index(arr, (4,6), mode='clip') array([22, 23, 19]) >>> np.ravel_multi_index(arr, (4,4), mode=('clip','wrap')) array([12, 13, 13]) >>> np.ravel_multi_index((3,1,4,1), (6,7,8,9)) 1621 ·
🌐
JAX Documentation
docs.jax.dev › en › latest › _autosummary › jax.numpy.ravel.html
jax.numpy.ravel — JAX documentation
jax.numpy.ravel(a, order='C', *, out_sharding=None)[source]# Flatten array into a 1-dimensional shape. JAX implementation of numpy.ravel(), implemented in terms of jax.lax.reshape(). ravel(arr, order=order) is equivalent to reshape(arr, -1, order=order). Parameters: a (ArrayLike) – array ...
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.5.dev0 Manual
numpy.ravel(a, order='C')[source]# Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned ...
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.3 Manual
numpy.ravel(a, order='C')[source]# Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned. A copy is made only if needed. As of NumPy 1.10, the returned array will have the same type as the input array. (for example, a masked array will be returned ...
🌐
Educative
educative.io › answers › what-is-the-numpyravel-function-from-numpy-in-python
What is the numpy.ravel() function from NumPy in Python?
The ravel() function returns an array of the same subtype and shape as that of the input array a that is passed to it. ... Line 1: We import the numpy module.
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.ravel.html
numpy.ravel — NumPy v2.0 Manual
>>> a = np.arange(12).reshape(2,3,2).swapaxes(1,2); a array([[[ 0, 2, 4], [ 1, 3, 5]], [[ 6, 8, 10], [ 7, 9, 11]]]) >>> a.ravel(order='C') array([ 0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11]) >>> a.ravel(order='K') array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])