Discover more from Daily Dose of Data Science
Lesser-Known Feature of the Merge Method in Pandas
While merging DataFrames in Pandas, keeping track of the source of each row in the output can be extremely useful.
You can do this using the 𝐢𝐧𝐝𝐢𝐜𝐚𝐭𝐨𝐫 argument of the 𝐦𝐞𝐫𝐠𝐞() method. As a result, it augments an additional column in the merged output, which tells the source of each row.
Share this post on LinkedIn: Post Link.
Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.
The code snippets for the posts I have shared here are available on GitHub. Check out this repository: GitHub.