7. A dataframe Stu stores details like ‘Name’, ‘Class’, ‘Subject_ld’ for 10 students and another dataframe Marks stores details like ‘Subject_Id’ and ‘Avgmarks’. Write code so that two dataframes combine data on the basis of common Subject id.

import pandas as pd, numpy as np

Stu = pd.DataFrame({“Name”:[‘Aman’, ‘Ansh’, ‘Priya’, ‘Riya’, ‘Sohaib’, ‘Abi’, ‘Nisha’, ‘Shorya’, ‘Das’, ‘Sid’], “Class”:[9, 10, 7, 8, 10, 11, 12, 11, 7, 9], “Subject_Id”:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]})

Marks = pd.DataFrame({“Subject_Id”:[10, 3, 2, 5, 8, 4, 7, 6, 9, 1], “Avgmarks”:[80, 56, 79, 93, 94, 95, 80, 87, 90, 94]})

print(pd.merge(Stu, Marks, on=’Subject_Id’)) # merge function is used to join two dataframes on a column here Subject_Id