Skip to main content

Posts

Showing posts with the label 7.Write a Pandas program to join the two given dataframes along rows and assign all data.

ads1

7.Write a Pandas program to join the two given dataframes along rows and assign all data.

  7. Write a Pandas program to join the two given dataframes along rows and assign all data. Solution :-   import pandas as pd import numpy as np exam_data1 = {'name':['abc','xyz','pqr','mno','asd'],               'perc':[85,96.50,87,85,33],               'qualify':['yes','yes','yes','yes','no']} exam_dic1 = pd.DataFrame(exam_data1) exam_data2 = {'name':['abc1','xyz1','pqr1','mno1','asd1'],               'perc':[58,69,78,52,36],               'qualify':['yes','yes','yes','yes','yes']} exam_dic2 = pd.DataFrame(exam_data2) print("The Original is :- ") print(exam_dic1) print("-----------------------------------") print(exam_dic2) print("After Joining the DataFrame") result_data = pd.concat([exam_dic1,exam_dic2]) print(result_data) Output :- 

ads2