In my Excel sheet there is a column "InvoiceDate" of type datetime64
. I am trying to extract the date from this column and assign it a new column.
Below is my python code along with an image of the data sheet. It outputs a warning but the operation is completed successfully.
CODE:
df1["InvoiceMonth"] = df1["InvoiceDate"].dt.date
ERROR:
C:\Users\anaconda3\lib\site-packages\ipykernel_launcher.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value