Below is the code i am trying to use in python, have tried everything.Can anyone please help ..
import pandas as pd
# Using DataFrame.astype() function
df["Date"] = df["Date"].astype('datetime64[ns]')
print (df.dtypes)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[24], line 3
1 import pandas as pd
2 # Using DataFrame.astype() function
----> 3 df["Date"] = df["Date"].astype('datetime64[ns]')
4 print (df.dtypes)
NameError: name 'df' is not defined
I had tried to import library and other google solution but not solved.
df.