Skip to content

Commit 330a3b5

Browse files
code sample for pandas-dev#46922
1 parent 58f97c7 commit 330a3b5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bisect/46922.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# BUG: Concatenation of None with numerical values no longer converts None to Nan. #46922
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
df1 = pd.DataFrame({"A": [None], "B": [12.34]})
8+
df2 = pd.DataFrame({"A": [12.34], "B": [12.34]})
9+
10+
result = pd.concat([df1, df2])
11+
print(result)
12+
print(result.dtypes)
13+
14+
expected = pd.DataFrame(
15+
{"A": [None, 12.34], "B": [12.34, 12.34]}, dtype=float, index=[0, 0]
16+
)
17+
pd.testing.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)