Python Pandas memory management
When we delete/drop a dataframe and use gc.collect(), Does the python empty the ram occupied?


Yes, it will be empty space in the RAM.


If we do df.to_csv(filename), will that df be referring to the file after that or the data still being referred from in-memory(RAM)?
No, it will be not refer from the file it will still refer to the df variable.
2 questions :

When we delete/drop a dataframe and use gc.collect(), Does the python empty the ram occupied?

if we do df.to_csv(filename), will that df be referring to the file after that or the data still being referred from in-memory(RAM)?