SpinTheMic
Pro

Interview practice question

MemoryError when merging two large DataFrames

Data Analyst · Python and Pandas · Experienced

Merging a 30-million-row events DataFrame with a 5-million-row users DataFrame crashes with a MemoryError. What would you do?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Reduce columns and dtypes before merge.
  • Check for key duplication causing explosion.
  • Merge in chunks/partitions.
  • Push join to DuckDB/database.
  • Use categorical/int keys.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics