We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 584f9cf commit f6ca227Copy full SHA for f6ca227
bisect/47294.py
@@ -0,0 +1,17 @@
1
+# BUG: uint16 inserted as int16 when assigning row with dict #47294
2
+
3
+import pandas as pd
4
+import numpy as np
5
6
+print(pd.__version__)
7
8
+df = pd.DataFrame(columns=["actual", "reference"])
9
+df.loc[0] = {"actual": np.uint16(40_000), "reference": "nope"}
10
11
+print(df)
12
+print(df.dtypes)
13
14
+expected = pd.DataFrame(
15
+ {"actual": [np.uint16(40_000)], "reference": ["nope"]}, dtype=object
16
+)
17
+pd.testing.assert_frame_equal(df, expected)
0 commit comments