import pandas as pd
xls1='C:\\Downloads\\Allparts.xlsx'
df = pd.read_excel(xls1,sheet_name='Data')
df=df['Part Number'].head(10)
xls2='C:\\Downloads\\Part_Details.xlsx'
dz = pd.read_excel(xls2,sheet_name='Data')
dz=dz.drop(dz.columns[[2, 4]], axis = 1)
dz=dz.drop(dz.columns[[3, 4, 5]], axis = 1)
for fd in df:
if dz['Name'].str.contains(fd):
print(dz['Name'],fd)
fdf=pd.dataframe()
for zd in dz['Name']:
for fd in df['Part Number']:
if str(zd) in str(fd):
res=df[df['Part Number']==fd]
fdf = pd.concat([fdf, res], axis=0)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.