Skip to content

Commit 268d705

Browse files
code sample for pandas-dev#44190
1 parent 14dd5a2 commit 268d705

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bisect/44190.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUG: .equals method returns true when comparing floats with dtype object to None #44190
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
print(pd.__version__)
7+
8+
left = pd.Series([-np.inf, np.nan, -1.0, 0.0, 1.0, 10 / 3, np.inf], dtype=object)
9+
right = pd.Series([None] * len(left))
10+
11+
print(pd.DataFrame(dict(left=left, right=right)))
12+
13+
print(f"{left.equals(right)=}")
14+
15+
print(f"{right.equals(left)=}")
16+
17+
assert not left.equals(right)
18+
assert not right.equals(left)

0 commit comments

Comments
 (0)