假设我有一个 2 列的数组。看起来这个 column1 = [1,2,3,...,830] column2 = [a,b,c,...]
我想以单列的打印形式输出,其中包括一列一列的值。输出形式:column = [1,a,2,b ....]
我试图通过这段代码来做,
dat0 = np.genfromtxt("\", delimiter = ',')
mu = dat0[:,0]
A = dat0[:,1]
print(mu,A)
R = np.arange(0,829,1)
l = len(mu)
K = np.zeros((l, 1))
txtfile = open("output_all.txt",'w')
for x in mu:
i = 0
K[i,0] = x
dat0[i,1] = M
txtfile.write(str(x))
txtfile.write('\n')
txtfile.write(str(M))
txtfile.write('\n')
print K