Try this
new_df = pd.merge(A_df, B_df, how='left', left_on=['A_c1','c2'], right_on = ['B_c1','c2'])
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.merge.html
left_on : label or list, or array-like Field names to join on in left DataFrame. Can be a vector or list of vectors of the length of the DataFrame to use a particular vector as the join key instead of columns
right_on : label or list, or array-like Field names to join on in right DataFrame or vector/list of vectors per left_on docs
Related Posts:
- How to Read .txt in Pandas
- Type error: cannot convert the series to
- Pandas join issue: columns overlap but no suffix specified
- AttributeError: ‘Series’ object has no attribute ‘reshape’
- ImportError: No module named ‘xlrd’
- Moving Average Pandas
- matplotlib: plot multiple columns of pandas data frame on the bar chart
- How to print a specific row of a pandas DataFrame?
- SyntaxError: unexpected EOF while parsing
- How to use filter, map, and reduce in Python 3
- Use Gif Logo For Loading Screen In Kivy
- Praw & Discord.py: The bot keep sending the same meme. I want the bot to send different meme whenever it is asked
- How can I make a time delay in Python? [duplicate]
- Python – TypeError: ‘int’ object is not iterable
- how to sort pandas dataframe from one column
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- How to open a file using the open with statement
- Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
- How to install pip with Python 3?
- What is the difference between rw+ and r+
- Renaming column names in Pandas
- How to reset index in a pandas dataframe? [duplicate]
- Delete a column from a Pandas DataFrame
- Python – TypeError: ‘int’ object is not iterable
- Import Error: No module named numpy
- How to deal with SettingWithCopyWarning in Pandas
- How to deal with SettingWithCopyWarning in Pandas
- Constructing pandas DataFrame from values in variables gives “ValueError: If using all scalar values, you must pass an index”
- How to iterate over rows in a DataFrame in Pandas
- pandas read_json: “If using all scalar values, you must pass an index”
- How to iterate over rows in a DataFrame in Pandas
- Python: ‘ModuleNotFoundError’ when trying to import module from imported package
- Relative imports – ModuleNotFoundError: No module named x
- TypeError: a bytes-like object is required, not ‘str’ when writing to a file in Python3
- Writing a pandas DataFrame to CSV file
- How to uninstall a package installed with pip install –user
- Relative imports in Python 3
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- Writing a pandas DataFrame to CSV file
- Best way to convert string to bytes in Python 3?
- Best way to convert string to bytes in Python 3?
- What does the list() function do in Python?
- TypeError: not all arguments converted during string formatting python
- Adding new column to existing DataFrame in Python pandas
- Modifing data while using iterrows() does not work
- PermissionError: [Errno 13] Permission denied
- ImportError: No module named pandas
- What is setup.py?
- How is Anaconda related to Python?
- How to change the order of DataFrame columns?
- FileNotFoundError: [WinError 2] The system cannot find the file specified:
- How to change the order of DataFrame columns?
- Invalid character in identifier
- ImportError: No module named pandas. Pandas installed pip
- What does `ValueError: cannot reindex from a duplicate axis` mean?
- Pandas DataFrame Groupby two columns and get counts
- How can I use the apply() function for a single column?
- How to show all columns’ names on a large pandas dataframe?
- Convenient way to deal with ValueError: cannot reindex from a duplicate axis
- ValueError: Unknown label type: ‘continuous’
- How to groupby based on two columns in pandas?
- Using Python 3 in virtualenv
- How to fix IndexError: invalid index to scalar variable
- How to correct TypeError: Unicode-objects must be encoded before hashing?
- “Series objects are mutable and cannot be hashed” error
- How to remove EOFError: EOF when reading a line?
- How to deal with SettingWithCopyWarning in Pandas
- WinError 2 The system cannot find the file specified (Python)
- Merging dataframes on index with pandas
- ImportError: No module named pandas
- hashlib.md5() TypeError: Unicode-objects must be encoded before hashing
- TypeError: ‘Series’ objects are mutable, thus they cannot be hashed problemwith column
- TypeError: cannot unpack non-iterable NoneType object
- Is there a ‘foreach’ function in Python 3?
- Create a Pandas Dataframe by appending one row at a time
- Python inline if statement
- How to install python3 version of package via pip on Ubuntu?
- Updating a dictionary in python
- How to replace NaN values by Zeroes in a column of a Pandas Dataframe?
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- Could not find a version that satisfies the requirement tensorflow
- Convert bytes to a string
- How to copy a dictionary and only edit the copy
- Convert Python dict into a dataframe
- How to print like printf in Python3?
- Could not find a version that satisfies the requirement tensorflow
- Local variable referenced before assignment?
- re.sub erroring with “Expected string or bytes-like object”
- Creating an empty Pandas DataFrame, then filling it?
- How do I select rows from a DataFrame based on column values?
- How do I select rows from a DataFrame based on column values?
- DataFrame constructor not properly called! error
- AttributeError: ‘module’ object has no attribute ‘urlopen’
- Pandas group-by and sum
- How do I get the row count of a Pandas DataFrame?
- Python pandas groupby aggregate on multiple columns, then pivot
- Python Error: AttributeError: __enter__ [duplicate]
- Python Pandas Counting the Occurrences of a Specific value
- Convert pandas dataframe to NumPy array