@@ -265,17 +265,25 @@ def time_lookup_and_cleanup(self):
265
265
266
266
class ToDatetimeFromIntsFloats :
267
267
def setup (self ):
268
- self .timestamp_seconds_int = Series (
269
- range (1521080307 , 1521685107 ), dtype = "int64"
270
- )
271
- self .timestamp_seconds_float = self .timestamp_seconds_int .astype ("float64" )
268
+ self .ts_sec = Series (range (1521080307 , 1521685107 ), dtype = "int64" )
269
+ self .ts_sec_float = self .ts_sec .astype ("float64" )
270
+
271
+ self .ts_nanosec = 1_000_000 * self .ts_sec
272
+ self .ts_nanosec .float = self .ts_nanosec .astype ("float64" )
273
+
274
+ # speed of int64 and float64 paths should be comparable
275
+
276
+ def time_nanosec_int64 (self ):
277
+ to_datetime (self .ts_nanosec , unit = "ns" )
278
+
279
+ def time_nanosec_float64 (self ):
280
+ to_datetime (self .ts_nanosec_float , unit = "ns" )
272
281
273
- def to_datetime_int (self ):
274
- to_datetime (self .timestamp_seconds_int , unit = "s" )
282
+ def time_sec_int64 (self ):
283
+ to_datetime (self .ts_sec , unit = "s" )
275
284
276
- # float64 should about the same as int64
277
- def to_datetime_float (self ):
278
- to_datetime (self .timestamp_seconds_float , unit = "s" )
285
+ def time_sec_float64 (self ):
286
+ to_datetime (self .ts_sec_float , unit = "s" )
279
287
280
288
281
289
class ToDatetimeYYYYMMDD :
0 commit comments