O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying join type

A default concatenation actually performs an outer join operation along the index labels on the axis opposite of the concatenation (the rows index). This makes the resulting set of labels similar to having performed a union of those labels.

The type of join can be changed to an inner join by specifying join='inner' as a parameter. The inner join then logically performs an intersection of labels instead of a union. The following demonstrates this and results in a single row, because 2 is the only row index label in common:

It is also possible to label groups of data along the columns using the keys parameter when applying ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required