@@ -556,9 +556,9 @@ def _generate(cls, start, end, periods, name, freq,
556
556
tz ,
557
557
ambiguous = ambiguous )
558
558
559
- arr = arr .view (_NS_DTYPE )
560
559
index = DatetimeIndex (arr )
561
560
561
+
562
562
# index is localized datetime64 array -> have to convert
563
563
# start/end as well to compare
564
564
if start is not None :
@@ -611,8 +611,8 @@ def _simple_new(cls, values, name=None, freq=None, tz=None,
611
611
dtype = dtype , ** kwargs )
612
612
values = np .array (values , copy = False )
613
613
614
- # values should be a numpy array
615
- assert isinstance (values , np . ndarray )
614
+ assert isinstance ( values , np . ndarray ), "values is not an np.ndarray"
615
+ assert is_datetime64_dtype (values )
616
616
617
617
if is_object_dtype (values ):
618
618
return cls (values , name = name , freq = freq , tz = tz ,
@@ -2094,6 +2094,8 @@ def _generate_regular_range(start, end, periods, freq):
2094
2094
"if a 'period' is given." )
2095
2095
2096
2096
data = np .arange (b , e , stride , dtype = np .int64 )
2097
+
2098
+ # _simple_new is getting an array of int64 here
2097
2099
data = DatetimeIndex ._simple_new (data , None , tz = tz )
2098
2100
else :
2099
2101
if isinstance (start , Timestamp ):
0 commit comments