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