立即学习:https://edu.csdn.net/course/play/26990/361126?utm_source=blogtoedu
import xlrd
workbook = xlrd.open_workbook('***.xlsx')
sheet_name=workbook.sheet_names()
方法一:
order1=pd.read_excel('',sheet_name='')
order2=.................
order = pd.concat([order1,order2],axis=0,ignore_index=True)
ignore_index:是否重置索引
order.tail(x)
方法二:
basic = pd.DataFrame()
for i in sheet_name:
basic_i=pd.read_excel('',sheet_name=i)
basic = pd.concat([basic,basic_i],axis=0,ignore_index=True)
basic
df=pd.read_csv('',dtype={'user_id':str})
df1=pd.read_csv('',dtype={'user_id':str})
df2=pd.merge(left=df,right=df1,how='inner',
left_on='user_id',right_on='user_id')
需要left_on与right_on数据类型一样