# -*-coding:utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
students = pd.read_excel("C:/Users/asus/Downloads/pandas/016/Student_Score.xlsx",sheet_name='Students',index_col='ID')
scores = pd.read_excel("C:/Users/asus/Downloads/pandas/016/Student_Score.xlsx",sheet_name='Scores',index_col='ID')
# table = students.merge(scores, how='left',on='ID').fillna(0)
table = students.join(scores, how='left',on='ID').fillna(0)
table.Score = table.Score.astype(int)
print(table)
pandas-matplotlib联合多表
最新推荐文章于 2024-09-13 16:55:38 发布