QST: Does pandas merge guarantee that row order is preserved from both tables, even if duplicate keys exist? #37927
Labels
Bug
Needs Discussion
Requires discussion from core team before further action
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Suppose I left join a DataFrame
B
ontoA
(withsort=False
) such that some keys are duplicated in both A and B. Is the resulting DataFrame guaranteed to be lex-sorted based on the occurrence of rows in A and then B? For example...If I make two DataFrames
A
andB
like thisand then I left-join
B
ontoA
I can confirm that the result is in lex-sorted via
My question is, is this guaranteed? The docs say
but this doesn't sounds like a guarantee for lex-sort.
Note that if I do the same thing with a right-join, the result is not lex-sorted
but I think this is just a bug related to #35382. Thanks
The text was updated successfully, but these errors were encountered: