File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -2192,21 +2192,17 @@ class Timedelta(_Timedelta):
21922192 ns = kwargs.get(" nanoseconds" , 0 )
21932193 us = kwargs.get(" microseconds" , 0 )
21942194 ms = kwargs.get(" milliseconds" , 0 )
2195+ total_ns = (
2196+ int (ns)
2197+ + int (us * 1 _000)
2198+ + int (ms * 1 _000_000)
2199+ + seconds
2200+ )
2201+
21952202 try :
2196- value = np.timedelta64(
2197- int (ns)
2198- + int (us * 1 _000)
2199- + int (ms * 1 _000_000)
2200- + seconds, " ns"
2201- )
2203+ value = np.timedelta64(total_ns, " ns" )
22022204 except OverflowError :
22032205 # GH#46587 - fall back to coarser resolutions
2204- total_ns = (
2205- int (ns)
2206- + int (us * 1 _000)
2207- + int (ms * 1 _000_000)
2208- + seconds
2209- )
22102206 if total_ns % 1 _000 != 0 :
22112207 reso_value, reso_abbrev = total_ns, " ns"
22122208 elif total_ns % 1 _000_000 != 0 :
You can’t perform that action at this time.
0 commit comments