File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2182,7 +2182,8 @@ def _sequence_to_dt64(
2182
2182
Returns
2183
2183
-------
2184
2184
result : numpy.ndarray
2185
- The sequence converted to a numpy array with dtype ``datetime64[ns]``.
2185
+ The sequence converted to a numpy array with dtype ``datetime64[unit]``.
2186
+ Where `unit` is ns unless specified otherwise.
2186
2187
tz : tzinfo or None
2187
2188
Either the user-provided tzinfo or one inferred from the data.
2188
2189
inferred_freq : Tick or None
@@ -2205,9 +2206,9 @@ def _sequence_to_dt64(
2205
2206
data , copy = maybe_convert_dtype (data , copy , tz = tz )
2206
2207
data_dtype = getattr (data , "dtype" , None )
2207
2208
2208
- out_dtype = DT64NS_DTYPE
2209
- if out_unit is not None :
2210
- out_dtype = np .dtype (f"M8[{ out_unit } ]" )
2209
+ if out_unit is None :
2210
+ out_unit = "ns"
2211
+ out_dtype = np .dtype (f"M8[{ out_unit } ]" )
2211
2212
2212
2213
if data_dtype == object or is_string_dtype (data_dtype ):
2213
2214
# TODO: We do not have tests specific to string-dtypes,
You can’t perform that action at this time.
0 commit comments