1

I have a dataframe (df) which I would like to recycle. It's full of data and I would like to remove everything from this dataframe. Would df.drop() work?

2
  • 3
    Can't you just call del df or just reassign? Commented Aug 3, 2016 at 15:38
  • 1
    If you want an empty dataframe: df = pd.Dataframe([], df.index, df.columns) Commented Aug 3, 2016 at 15:54

1 Answer 1

1

if you want to free some space

import gc

del adios_df
gc.collect()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.