- How to perform a (
OUTER) join with pandas?
- How do I add NaNs for missing rows after merge?
- How do I get rid of NaNs after merging?
- Can I merge on the index?
- Cross join with pandas?
- How do I merge multiple DataFrames?
update? Who? What? Why?!
... and more. I've seen these recurring questions asking about various facets of the pandas merge functionality. Most of the information regarding merge and its various use cases today is fragmented across dozens of badly worded, unsearchable posts. The aim here is to collate some of the more important points for posterity.
This QnA is meant to be the next installment in a series of helpful user-guides on common pandas idioms (see this post on pivoting, and this post on concatenation, which I will be touching on, later).
Please note that this post is not meant to be a replacement for the documentation, so please read that as well! Some of the examples are taken from there.