dataframe
#
# 导包 import numpy as np import pandas as pd from pandas import Series,DataFrame dic1={ 'name':['tom','jay','helly'], 'age':[11,12,33], 'classRoom':[1,2,3] } #数据源 df1=DataFrame(data=dic1) df2=DataFrame(data=np.random.randint(60,100,size=(3,3)), index=['jay','tom','helly'], columns=['java','python','c']) #数据源 df1 df2 pd.merge(df1,df2,left_on='name',right_index=True) #合并 pd.merge(df2,df1,left_index=True,right_on='name') df2.dtypes #各个列的属性