AI engineering glossary · NumPy pandas visualization

What is fancy indexing?

Fancy indexing: Selecting array elements by passing a list or array of integer positions instead of a slice. It lets you pick arbitrary elements in any order, or repeat them, and unlike slicing it always returns a new copy of the data rather than a view.

Level: intermediateTopic: NumPy pandas visualization

Fancy indexing: an example

a = np.array([10, 20, 30, 40]); a[[3, 0, 0]] returns array([40, 10, 10]).

Related terms

More NumPy pandas visualization terms

Where you learn it

Fancy indexing 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.