#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu May 30
10:53:38 2019 @author: lg """ import pandas as pd import numpy as np
df1=pd.DataFrame(np.array([[4,5,2]]),index=["A"],columns=['B1','B2','B3'])
df2=pd.DataFrame(np.array([[6,2,5],[5,3,4],[7,5,8]]),index=['B1','B2','B3'],columns=['C1','C2','C3'])
df3=pd.DataFrame(np.array([[4,4],[4,7],[5,2]]),index=['C1','C2','C3'],columns=['D1','D2'])
df4=pd.DataFrame(np.array([[5],[4]]),index=['D1','D2'],columns=['E'])
ll=[df3,df2,df1] ll1=[df1,df2] cv=[] def pp(t,df): mm=df.index f=pd.Series()
g=[] for j in mm: m1=df.loc[j] m2=m1+t m3=m2.sort_values() f[j]=m3[0]
g.append(m3.index[0]) dc=pd.DataFrame() dc['v']=f.values dc['n']=g
dc.index=f.index # print(dc) cv.append(dc) if len(ll1)>0: df=ll1.pop()
t=pp(dc['v'],df) else: return dc t1=df4['E'] h1=pp(t1,df3) for m in
range(len(cv)): xc=cv.pop() x1=xc.sort_values(by='v') print(x1['n'].values[0])
B1 C3 D2
So the shortest route is A B1 C3 D2 E, It's a little bit of a program , There may actually be multiple routes to the problem , This program only takes one

Technology
©2019-2020 Toolsou All rights reserved,
One is called “ Asking for the train ” A small village Finally got the train SparkSQL Achieve partition overlay write Character recognition technology of vehicle license plate based on Neural Network c++ Memory Pointer out of bounds detection mechanism _CrtMemBlockHeade Change one's mind ! Tesla starts to deliver made in China to European market Model 3Qt study 7—— Modal and modeless dialog boxes JavaScript Medium Call and ApplyJAVA Convert a string to a numeric type k8s Entry to give up --k8s Key concepts Count the number of letters (java Language implementation )