1 回答
TA贡献1780条经验 获得超5个赞
尝试定义一个由列表组成的列表。
for i in range (2):
InnerList=[]
for j in range (i, 2):
yparam = The_path / ("{}_Y{}{}.csv" .format('Filter',i+1,j+1) )
with open( yparam ,'r', newline='') as Y_parameter_Data:
data = numpy.loadtxt(Y_parameter_Data, skiprows=1, delimiter=',')
ypar = []
for k in range(0, len(3)):
a = numpy.reshape(data[k,1::2], (1,1))
b = numpy.reshape(data[k,2::2], (1,1))
ypar.append(a+j*b)
c = ypar
fdata= numpy.asarray(c)
fdata= numpy.reshape(fdata, (1,-1))
fdata= fdata
InnerList.append(fdata)
OuterList.append(InnerList)
添加回答
举报