What is the best way to delete a column without running out of memory in pandas?
I have a large dataset and after some variable manipulation I need to delete about half the variables. I tried using df.drop(vars, axis=1, inplace=True) but discovered that my memory usage shot up quite a bit. Same without the inplace patameter.
This is the exact topic discussed in this old pandas issue thread but it was closed without giving an answer. There are many similar questions on SO but I have not found an answer to this, which is specifically how to avoid a large memory increase when dropping many variables from a large data frame. Thanks!