list1 = [1,2,3,4,5,6]
for num1 in list1:
pd.concat([dfnew[Indexer[0]],dfnew[Indexer[num1]]],axis=1)
I have considered using a for loop but got lost on how to implement it successfully.
def test(list1):
for num1 in list1:
return pd.concat([dfnew[Indexer[0]],dfnew[Indexer[num1]]],axis=1)
I have made some progress but somehow I need to automate this so that I dont have to write this line 6 times while maintaining the unique variable names.
for num1 in list1:
XReal=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[1]]],axis=1)
XImag=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[2]]],axis=1)
YReal=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[3]]],axis=1)
YImag=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[4]]],axis=1)
ZReal=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[5]]],axis=1)
ZImag=pd.concat([dfnew[Indexer[0]],dfnew[Indexer[6]]],axis=1)
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.