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