Reputation: 2358
I want to clear all the data from a column within my dataframe but keep the dataframe exactly the same.
The Excel equivalent of this would be to select all the data in a column beneath the header and right-click "Clear Contents".
I tried this:
test = df.replace(to_replace=df('Column Name'), value=NaN)
but got an error stating:
TypeError: 'DataFrame' object is not callable
I don't know what that means or how to think about changing my code.
Upvotes: 1
Views: 928