Daily Dose of Data Science

Share this post

Lesser-Known Feature of the Merge Method in Pandas

www.blog.dailydoseofds.com

Lesser-Known Feature of the Merge Method in Pandas

Avi Chawla
Dec 11, 2022
3
Share
Share this post

Lesser-Known Feature of the Merge Method in Pandas

www.blog.dailydoseofds.com

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.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

3
Share
Share this post

Lesser-Known Feature of the Merge Method in Pandas

www.blog.dailydoseofds.com
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

Β© 2023 Avi Chawla
Privacy βˆ™ Terms βˆ™ Collection notice
Start WritingGet the app
SubstackΒ is the home for great writing