@@ -79,7 +79,7 @@ def __new__(cls, data, dtype=None, copy=False, name=None):
7979 if (dtype is None
8080 and (lib .is_datetime_array (subarr )
8181 or lib .is_datetime64_array (subarr ))):
82- return DatetimeIndex (subarr .astype ('M8' ), name = name )
82+ return DatetimeIndex (subarr .astype ('M8[us] ' ), name = name )
8383
8484 if lib .is_integer_array (subarr ) and dtype is None :
8585 return Int64Index (subarr .astype ('i8' ), name = name )
@@ -1062,17 +1062,17 @@ def __new__(cls, data, dtype=None, copy=False, name=None):
10621062 data = list (data )
10631063
10641064 # try to make it datetime64
1065- data = np .asarray (data , dtype = np . datetime64 )
1065+ data = np .asarray (data , dtype = 'M8[us]' )
10661066
10671067 if issubclass (data .dtype .type , basestring ):
10681068 raise TypeError ('String dtype not supported, you may need '
10691069 'to explicitly cast to datetime64' )
10701070 elif issubclass (data .dtype .type , np .integer ):
1071- subarr = np .array (data , dtype = np . datetime64 , copy = copy )
1071+ subarr = np .array (data , dtype = 'M8[us]' , copy = copy )
10721072 elif issubclass (data .dtype .type , np .datetime64 ):
1073- subarr = np .array (data , dtype = np . datetime64 , copy = copy )
1073+ subarr = np .array (data , dtype = 'M8[us]' , copy = copy )
10741074 else :
1075- subarr = np .array (data , dtype = np . datetime64 , copy = copy )
1075+ subarr = np .array (data , dtype = 'M8[us]' , copy = copy )
10761076 if len (data ) > 0 :
10771077 test = (subarr != data )
10781078 if (type (test ) == bool and test == True ) or test .any ():
@@ -1112,7 +1112,7 @@ def searchsorted(self, key, side='left'):
11121112 if isinstance (key , datetime ):
11131113 key = _dt_unbox (key )
11141114 elif isinstance (key , np .ndarray ):
1115- key = np .array (key , dtype = np . datetime64 , copy = False )
1115+ key = np .array (key , dtype = 'M8[us]' , copy = False )
11161116 elif not isinstance (key , np .datetime64 ):
11171117 raise TypeError ("Key %s is unrecognized type" % key )
11181118 return self .values .searchsorted (key , side = side )
@@ -1159,7 +1159,7 @@ def equals(self, other):
11591159 other = other .view ('i8' , type = np .ndarray )
11601160 elif other .inferred_type == 'datetime' :
11611161 # TODO: faster conversion from datetime object to datetime64?
1162- other = np .array (other , dtype = 'M8' , copy = False )
1162+ other = np .array (other , dtype = 'M8[us] ' , copy = False )
11631163 other = other .view ('i8' , type = np .ndarray )
11641164 elif len (other ) == 0 and len (self ) == 0 and other .dtype == object :
11651165 # fun corner case
0 commit comments