AI engineering glossary · NumPy pandas visualization

What is array slicing?

Array slicing: Selecting a range of elements with the start:stop:step notation, where the stop position is excluded. On NumPy arrays a slice does not copy data; it returns a view onto the original memory, so changing the slice changes the original array too.

Level: beginnerTopic: NumPy pandas visualization

Array slicing: an example

x = np.arange(10); x[2:8:2] returns array([2, 4, 6]) and shares memory with x.

Related terms

More NumPy pandas visualization terms

Where you learn it

Array slicing 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.