I have a NetCDF4 file that i'm handling using xarray. The dataset has a "time" coordinate as dtype=object and i would like to convert it ot datetime64 in order to simplify plotting of the variables contained in the file. My plan was to create a new time coordinate called "time1" using
ds.assign_coords(time1=pd.to_datetime(ds.time.values,infer_datetime_format=True))
and then delete the old one. But i get a new coordinate still as dtype=object. here's how the new dataset looks like
What am i doing wrong?