From the official documentation of pandas.to_datetime we can say,
unit : string, default ‘ns’
unit of the arg (D,s,ms,us,ns)
In case you are accessing a particular datetime64
object from the dataframe, chances are that pandas will return a Timestamp
object which is essentially how pandas stores datetime64
objects.
You can use pd.Timestamp.to_datetime64()
method of the pd.Timestamp
object to convert it to numpy.datetime64
object with ns
precision.