October 2019
Beginner to intermediate
674 pages
16h 43m
English
The DataFrame.join function is used to combine two DataFrames that have different columns with nothing in common. Essentially, this does a longitudinal join of two DataFrames. Here is an example:
df_1 = sales_data.iloc[0:5, 0:3]df_2 = sales_data.iloc[3:8, 3:6]df_1.join(df_2)
The following will be the output:

join is almost identical to merge, the difference being that, while merge works for DataFrames that share identical keys, join combines DataFrames by the row-index. By default, the join function performs a left join. The other types of join can be specified through the how parameter:
df_1.join(df_2, ...
Read now
Unlock full access