FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

Β© 2026 FlareStart. All rights reserved.

Back to articles
Three different ways to combine data in Pandas β€” concat, merge, and join.
NewsSystems

Three different ways to combine data in Pandas β€” concat, merge, and join.

via Dev.to TutorialDolly Sharma2h ago

πŸ”Ή 1. pd.concat() β†’ Stack or attach data πŸ‘‰ Used when you want to combine DataFrames along rows or columns πŸ“Œ Row-wise (axis=0) combined = pd . concat ([ df1 , df2 ], axis = 0 ) Stacks df2 below df1 Columns should be same (ideally) 🧠 Think: β€œappend rows” πŸ“Œ Column-wise (axis=1) combined = pd . concat ([ df1 , df2 ], axis = 1 ) Adds df2 as new columns Works based on index alignment 🧠 Think: β€œside-by-side” πŸ”Ή 2. pd.merge() β†’ Database-style join πŸ‘‰ Used when you want to combine based on a common column (key) πŸ“Œ Default (inner join) merged = pd . merge ( df1 , df2 , on = " common_column " ) Only keeps matching values πŸ“Œ Left join merged = pd . merge ( df1 , df2 , how = " left " , on = " common_column " ) Keeps all rows of df1 Matches from df2 (NaN if no match) πŸ“Œ Inner join merged = pd . merge ( df1 , df2 , how = " inner " , on = " common_column " ) Same as default Only common rows 🧠 Think: β€œSQL JOIN using a column” πŸ”Ή 3. df.join() β†’ Index-based join joined = df1 . join ( df2 , how = " inner " ) πŸ‘‰ C

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
0 views

Related Articles

Senators are pushing to find out how much electricity data centers actually use
News

Senators are pushing to find out how much electricity data centers actually use

The Verge β€’ 28m ago

The Silent Skill That Separates Good Developers from Great Ones
News

The Silent Skill That Separates Good Developers from Great Ones

Medium Programming β€’ 45m ago

Do yourself a favor and stop buying these cheap SSD drives flooding the market
News

Do yourself a favor and stop buying these cheap SSD drives flooding the market

ZDNet β€’ 54m ago

2026's historic snow drought is bad news for the West
News

2026's historic snow drought is bad news for the West

Ars Technica β€’ 1h ago

YouTube is the only streaming service I pay to skip ads - here's why
News

YouTube is the only streaming service I pay to skip ads - here's why

ZDNet β€’ 1h ago

Discover More Articles