--

I agree with some things, but especially in a cloud application environment, memory optimization is absolutely key. So you absolutely want to discard previous versions of a dataframe to avoid memory errors.

The inplace=True is a space-saving way to do this.

E.g. instead of

df2 = df1.do_sth()

del df1

, you can simply do

df1 = df1.do_sth(inplace=True)

One line less, memory usage equal or even less.

And chaining is not an option in many cases. It also becomes hard to debug AND hard to read after a couple of chains.

--

--

Lukas Oldenburg
Lukas Oldenburg

Written by Lukas Oldenburg

Digital Analytics Expert. Owner of dim28.ch. Creator of the Adobe Analytics Component Manager for Google Sheets: https://bit.ly/component-manager

Responses (1)