I am trying to convert a DataFrame to datetime format using pd.datetime() but then if I try to convert the attribute further I get the following error:
AttributeError: Can only use .dt accessor with datetime like values
this is my script:
exms_data = pd.read_csv(r"C:\Users\MandijaE\Downloads\pdwh[VE249977].csv", sep=";")```
exms_data['CHANGE_TIME.1'] = pd.to_datetime(exms_data['CHANGE_TIME.1'], format='%d.%m.%y %H:%M:%S,%f %z')
exms_data['CHANGE_TIME.1'] = exms_data['CHANGE_TIME.1'].dt.tz_convert('UTC')
pd.to_datetime(exms_data['CHANGE_TIME.1'], format='%d.%m.%y %H:%M:%S,%f %z', utc=True)to avoid the issue.