Sep-05-2022, 06:35 PM
(This post was last modified: Sep-05-2022, 09:33 PM by deanhystad.)
It is telling you that you cannot do this:
https://pandas.pydata.org/pandas-docs/st....drop.html
df3=pd.DataFrame(None)Which is what you are doing because df2 == None. df2 == None because you cannot do this:
df2 = df.drop(["Unnamed: 0", "timestamp"], axis=1, inplace=True)From the pandas documentation
https://pandas.pydata.org/pandas-docs/st....drop.html
Quote:inplacebool, default FalseSo either you can do this:
If False, return a copy. Otherwise, do operation inplace and return None.
df2 = df.drop(["Unnamed: 0", "timestamp"], axis=1)Or you can do this:
df.drop(["Unnamed: 0", "timestamp"], axis=1, inplace=True)Assignment of the result, and using "inplace=True" can never be used together