The Real Python Podcast cover image

Using NumPy and Linear Algebra for Faster Python Code

The Real Python Podcast

00:00

Is There a Disadvantage to a for Loop?

An array is structurally, they're the same. They're homogenous or whatever you want to call it, the same style or data type across that whole thing. So I imagine what's happening, but it could be wrong, is that there's a bunch of shuffling happening under the hood where basically things are being moved around to free up sequential memory space. And that potentially just eats up a lot of the time that you would have gained by doing it in a vectorized fashion.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app