AI engineering glossary · NumPy pandas visualization

What is ravel?

Ravel (also called flatten): Flattening a multi-dimensional array into one dimension by reading its elements in order. It returns a view when possible and a copy only when it must, whereas the similar flatten method always copies. It is used when a model or function expects a flat list of values.

Level: intermediateTopic: NumPy pandas visualization

Ravel: an example

np.array([[1, 2], [3, 4]]).ravel() returns array([1, 2, 3, 4]).

Related terms

More NumPy pandas visualization terms

Where you learn it

Ravel is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.