Skip to content

Commit 2714184

Browse files
code sample for pandas-dev#40946
1 parent ec113a0 commit 2714184

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bisect/40946.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# BUG: total_seconds() method returns zero for timedeltas smaller then 1 microsecond
2+
# #40946
3+
4+
import pandas as pd
5+
6+
print(pd.__version__)
7+
8+
# create 500ns Timedelta - it is not converted successfully to float - result is zero
9+
b = pd.Timedelta("500ns")
10+
print(b)
11+
12+
result = b.total_seconds()
13+
print(result)
14+
15+
assert result == 5e-07

0 commit comments

Comments
 (0)