The Real Python Podcast

Thinking in Pandas: Python Data Analysis the Right Way

Jul 3, 2020
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Pandas Iteration

  • Avoid looping over Pandas DataFrames for better performance.
  • Use vectorized operations, NumPy, or list comprehensions instead.
ADVICE

Avoid .apply()

  • Avoid using .apply() in Pandas unless necessary, as it's slow.
  • It iterates over rows/columns, impacting performance.
ADVICE

Optimizing .apply()

  • When you must use .apply(), optimize it for performance.
  • Consider Cython or Numba to compile your code to C for speed.
Get the Snipd Podcast app to discover more snips from this episode
Get the app