I'm a beginner and I'm wondering about this.
For example I have this code:
df = example.get_data
And I only know that the the header will be a date numpy.datetime64 type. How can I only keep the last 2 years data without knowing anything more about it?
I tried something like this:
df.drop(df.columns.year >= date.today().year-2, axis=1, inplace = True
But it's not working. Any suggestions?