Photo by Christian Dubovan on Unsplash

How to Write Memory-Efficient Classes in Python

Three tricks to prevent your data project from memory overflow

Siavash Yasini
Towards Data Science
7 min readJan 13, 2024

--

A few years ago, I wrote a blog post on how to write memory-efficient loops in Python which became quite popular. The positive response encouraged me to write a second part, where I delve into additional memory optimization methods.

--

--

Ungifted Amateur, Python Enthusiast, Latte Artist, Ex-Cosmologist, Sr Data Scientist @ Fanatics