6 """Convert seconds since midnight to a datetime.time"""
7 m, s = divmod(seconds, 60)
9 return datetime.time(h, m, s)
13 """Convert a datetime.time to seconds since midnight"""
16 return 3600 * time.hour + 60 * time.minute + time.second
20 """Convert epoch time value into s, ms, us, ns"""
21 base = datetime.datetime(1970, 1, 1)
23 return base + datetime.timedelta(seconds=epoch)
25 seconds, modulus = divmod(epoch, 1000)
26 return base + datetime.timedelta(seconds=seconds, milliseconds=modulus)
28 seconds, modulus = divmod(epoch, 1000000)
29 return base + datetime.timedelta(seconds=seconds, microseconds=modulus)
31 return np.datetime64(epoch,
'ns')
33 raise TypeError(
"Invalid timestamp precision: {}".format(precision))
37 """Converts date into seconds"""
39 return arr.apply(
lambda x: np.datetime64(x,
"s").astype(int))
45 'SMALLINT':
'int_col',
52 'TIMESTAMP':
'int_col',
57 'MULTIPOINT':
'str_col',
58 'LINESTRING':
'str_col',
59 'MULTILINESTRING':
'str_col',
61 'MULTIPOLYGON':
'str_col',
63 'GEOMETRY':
'str_col',
64 'GEOGRAPHY':
'str_col',
73 'INTEGER': -2147483648,
74 'BIGINT': -9223372036854775808,
78 'TIMESTAMP': -9223372036854775808,
79 'DATE': -9223372036854775808,
80 'TIME': -9223372036854775808,
85 'MULTILINESTRING':
'',
def datetime_in_precisions