2020
12-14
12-14
Pandas中两个dataframe的交集和差集的示例代码
创建测试数据:importpandasaspdimportnumpyasnp#CreateaDataFramedf1={'Subject':['semester1','semester2','semester3','semester4','semester1','semester2','semester3'],'Score':[62,47,55,74,31,77,85]}df2={'Subject':['semester1','semester2','semester3','semester4'],'Score':[90,47,85,74]}df1=pd.DataFrame(df1,columns=['Subject','Score'])df2=pd.DataFrame(df2,columns=['Sub...
继续阅读 >