We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2683ab5 commit f74e926Copy full SHA for f74e926
bisect/47578.py
@@ -0,0 +1,15 @@
1
+# BUG: Setting a DataFrame as rhs with loc on a single column does not align in the single
2
+# block case #47578
3
+
4
+import numpy as np
5
+import pandas as pd
6
7
+print(pd.__version__)
8
9
+result = pd.DataFrame({"var": [1, 2]}, index=[1, 2])
10
+rhs = pd.DataFrame({"var": [10, 11]}, index=[2, 3])
11
+result.loc[:, "var"] = rhs
12
+print(result)
13
14
+expected = pd.DataFrame({"var": [np.nan, 10]}, index=[1, 2])
15
+pd.testing.assert_frame_equal(result, expected)
0 commit comments