I am trying do convert a datetime field to date in pandas.
My code
final_result['DATE_TO'] = pd.to_datetime(final_result['DATE_TO'], utc=True, dayfirst=True).dt.date
Warning Message from Python
/opt/app-root/lib/python3.6/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 instead
Sampledata
final_result['DATE_TO_']
0 2020-01-26 10:07:02
1 2019-11-27 06:12:12
2 2019-12-11 08:00:08
3 2019-12-05 11:20:03
4 2019-12-07 04:50:10
How to fix this .