I think this is what you want to do (both CSVs I use are identical to what you have in your question):

import pandas as pd

df_1 = pd.read_csv('document1.csv')
df_2 = pd.read_csv('document2.csv')

key_cols = ['job_function', 'job_area', 'title']
merged_df = pd.merge(df_1, df_2,  how='left', left_on=key_cols, right_on=key_cols)

Source: How to join two dataframes on multiple columns

Answer from Ignacio HM on Stack Overflow
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ user_guide โ€บ merging.html
Merge, join, concatenate and compare โ€” pandas 3.0.2 documentation
If the user is aware of the duplicates in the right DataFrame but wants to ensure there are no duplicates in the left DataFrame, one can use the validate='one_to_many' argument instead, which will not raise an exception. In [72]: pd.merge(left, right, on="B", how="outer", validate="one_to_many") Out[72]: A_x B A_y 0 1 1 NaN 1 2 2 4.0 2 2 2 5.0 3 2 2 6.0
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ reference โ€บ api โ€บ pandas.DataFrame.merge.html
pandas.DataFrame.merge โ€” pandas 3.0.2 documentation
โ€œone_to_oneโ€ or โ€œ1:1โ€: check if merge keys are unique in both left and right datasets. โ€œone_to_manyโ€ or โ€œ1:mโ€: check if merge keys are unique in left dataset.
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ reference โ€บ api โ€บ pandas.merge.html
pandas.merge โ€” pandas 3.0.1 documentation
Since pandas 3.0, this method always returns a new object using a lazy copy mechanism that defers copies until necessary (Copy-on-Write). See the user guide on Copy-on-Write for more details. ... If True, adds a column to the output DataFrame called โ€œ_mergeโ€ with information on the source of each row.
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ dev โ€บ user_guide โ€บ merging.html
Merge, join, concatenate and compare โ€” pandas documentation
If the user is aware of the duplicates in the right DataFrame but wants to ensure there are no duplicates in the left DataFrame, one can use the validate='one_to_many' argument instead, which will not raise an exception. In [72]: pd.merge(left, right, on="B", how="outer", validate="one_to_many") Out[72]: A_x B A_y 0 1 1 NaN 1 2 2 4.0 2 2 2 5.0 3 2 2 6.0
๐ŸŒ
DataCamp
campus.datacamp.com โ€บ courses โ€บ joining-data-with-pandas โ€บ data-merging-basics
One-to-many merge | Python
# Merge the licenses and biz_owners table on account licenses_owners = ____ # Group the results by title then count the number of accounts counted_df = licenses_owners.groupby(____).agg({'account':'count'}) # Sort the counted_df in descending order sorted_df = counted_df.sort_values(____) # Use .head() method to print the first few rows of sorted_df print(____)
๐ŸŒ
Real Python
realpython.com โ€บ pandas-merge-join-and-concat
Combining Data in pandas With merge(), .join(), and concat() โ€“ Real Python
February 7, 2023 - In this step-by-step tutorial, you'll learn three techniques for combining data in pandas: merge(), .join(), and concat(). Combining Series and DataFrame objects in pandas is a powerful way to gain new insights into your data.
๐ŸŒ
Python Data Science Handbook
jakevdp.github.io โ€บ PythonDataScienceHandbook โ€บ 03.07-merge-and-join.html
Combining Datasets: Merge and Join | Python Data Science Handbook
If you'd like to mix indices and columns, you can combine left_index with right_on or left_on with right_index to get the desired behavior: ... All of these options also work with multiple indices and/or multiple columns; the interface for this behavior is very intuitive. For more information on this, see the "Merge, Join, and Concatenate" section of the Pandas documentation. In all the preceding examples we have glossed over one important consideration in performing a join: the type of set arithmetic used in the join.
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python-pandas-merge-dataframe-with-one-to-many-relation
Python Pandas โ€“ Merge DataFrame with one-to-many relation
September 29, 2021 - To merge Pandas DataFrame, use the merge() function. The one-to-many relation is implemented on both the DataFrames by setting under the โ€œvalidateโ€ parameter of the merge() function i.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python-pandas-merge-dataframe-with-many-to-one-relation
Python Pandas โ€“ Merge DataFrame with many-to-one relation
September 29, 2021 - To merge Pandas DataFrame, use the merge() function. The many-to-one relation is implemented on both the DataFrames by setting under the โ€œvalidateโ€ parameter of the merge() function i.
๐ŸŒ
DataCamp
campus.datacamp.com โ€บ courses โ€บ joining-data-with-pandas โ€บ data-merging-basics
One-to-many relationships | Python
When we merge the two tables together with the merge method, setting the 'on' attribute to the column ward, the resulting table has both local ward data and business license data. Notice that ward 1 and its alderman Joe is repeated in the resulting table because the licenses table has many businesses in the 1st ward. pandas takes care of the one-to-many relationships for us and doesn't require anything special on our end.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ pandas โ€บ how-to-merge-multiple-dataframes-in-pandas
Merge Multiple Dataframes - Pandas - GeeksforGeeks
July 23, 2025 - We use merge() when we want to join two DataFrames using one or more common columns. It works like SQL joins like inner, left, right and outer join. It's the most common method when the data has shared column names.
๐ŸŒ
Pandas
pandas.pydata.org โ€บ pandas-docs โ€บ version โ€บ 1.3 โ€บ user_guide โ€บ merging.html
Merge, join, concatenate and compare โ€” pandas 1.3.5 documentation
In [53]: result = pd.merge(left, right, on="B", how="outer", validate="one_to_one") ... MergeError: Merge keys are not unique in right dataset; not a one-to-one merge ยท If the user is aware of the duplicates in the right DataFrame but wants to ensure there are no duplicates in the left DataFrame, one can use the validate='one_to_many' argument instead, which will not raise an exception.
๐ŸŒ
Pandas
pandas.pydata.org โ€บ pandas-docs โ€บ version โ€บ 1.3.1 โ€บ user_guide โ€บ merging.html
Merge, join, concatenate and compare โ€” pandas 1.3.1 documentation
In [53]: result = pd.merge(left, right, on="B", how="outer", validate="one_to_one") ... MergeError: Merge keys are not unique in right dataset; not a one-to-one merge ยท If the user is aware of the duplicates in the right DataFrame but wants to ensure there are no duplicates in the left DataFrame, one can use the validate='one_to_many' argument instead, which will not raise an exception.
๐ŸŒ
Shane Lynn
shanelynn.ie โ€บ home โ€บ learn to merge and join dataframes easily with pandas
Learn to Merge and Join DataFrames with Pandas and Python
October 16, 2021 - Join and Merge datasets and DataFrames in Pandas quickly and easily with the merge() function. Master left, right, inner, and outer merging with this tutorial. Merging and Joining data sets are key activities of any data scientist or analyst.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ pandas-merge-two-dataframe
Pandas merge() - Merging Two DataFrame Objects | DigitalOcean
August 4, 2022 - print('Result Left Join:\n', df1.merge(df2, how='left')) print('Result Right Join:\n', df1.merge(df2, how='right')) print('Result Outer Join:\n', df1.merge(df2, how='outer')) ... Result Left Join: Name Country Role ID 0 Pankaj India CEO 1.0 1 Meghna India CTO NaN 2 Lisa USA CTO NaN Result Right Join: Name Country Role ID 0 Pankaj India CEO 1 1 Anupam NaN NaN 2 2 Amit NaN NaN 3 Result Outer Join: Name Country Role ID 0 Pankaj India CEO 1.0 1 Meghna India CTO NaN 2 Lisa USA CTO NaN 3 Anupam NaN NaN 2.0 4 Amit NaN NaN 3.0 ยท import pandas as pd d1 = {'Name': ['Pankaj', 'Meghna', 'Lisa'], 'ID': [1, 2, 3], 'Country': ['India', 'India', 'USA'], 'Role': ['CEO', 'CTO', 'CTO']} df1 = pd.DataFrame(d1) df2 = pd.DataFrame({'ID': [1, 2, 3], 'Name': ['Pankaj', 'Anupam', 'Amit']}) print(df1.merge(df2, on='ID')) print(df1.merge(df2, on='Name'))