![]() |
In this article, we will discuss how to merge the two dataframes with different lengths in Pandas. It can be done using the merge() method. Syntax:
Below are some examples that depict how to merge data frames of different lengths using the above method: Example 1: Below is a program to merge two student data frames of different lengths. Python3
Output: Example 2: Here is another program to merge one data frame of length 4 and another dataframe of length 9. Python3
Output: |
Reffered: https://www.geeksforgeeks.org
Python |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 8 |