Skip to content

Commit 40ac031

Browse files
committed
Update tslib.pyx
Added 'julian' unit for Timestamp
1 parent a11346b commit 40ac031

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/tslib.pyx

+4
Original file line numberDiff line numberDiff line change
@@ -3230,6 +3230,10 @@ cpdef inline int64_t cast_from_unit(object ts, object unit) except? -1:
32303230
cdef:
32313231
int64_t m
32323232
int p
3233+
3234+
if unit == 'julian':
3235+
unit = 'D'
3236+
ts = ts - Timestamp(0).to_julian_date()
32333237

32343238
if unit == 'D' or unit == 'd':
32353239
m = 1000000000L * 86400

0 commit comments

Comments
 (0)