Skip to content

Commit 55eeeb1

Browse files
committed
Arrow ext: fix assignment by repeated key
1 parent 983eb1d commit 55eeeb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/arrays/arrow/array.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,8 @@ def __setitem__(self, key, value) -> None:
18801880
raise ValueError("Length of indexer and values mismatch")
18811881
if len(indices) == 0:
18821882
return
1883-
argsort = np.argsort(indices)
1883+
# GH#58530 wrong item assignment by repeated key
1884+
_, argsort = np.unique(indices, return_index=True)
18841885
indices = indices[argsort]
18851886
value = value.take(argsort)
18861887
mask = np.zeros(len(self), dtype=np.bool_)

0 commit comments

Comments
 (0)