(Nov-05-2020, 07:55 PM)deanhystad Wrote: How about a question that provides enough information and detail that somebody could answer it?
What do you mean by this?
Quote:And here I want to write each column as a rows
Is this what you are looking for?
import numpy as np m = np.array([[1,2,3,4], [4,6,7,8]]) print(m) print(m.T) # or use np.transpose(m) or m.transpose()If that is what you want to do, what do you mean by this?
Output:[[1 2 3 4] [4 6 7 8]] [[1 4] [2 6] [3 7] [4 8]]
Quote:and after that I want to add them together.The matrix in the first image isn't square (I don't think), so yow can you add an 8x64 matrix an a 64x8 matrix?
And how does any of this relate to the code you provide?
Hello, I wanted to send you a PM but I am not allowed
Here is my code actually according to code it should be 64*64 matrix and before your message I also tried transpose method too but It didn't work
for triplet in itertools.product([0, 1], repeat=6): a,ap,b,bp,c,cp = triplet[0],triplet[1],triplet[2],triplet[3],triplet[4],triplet[5] nlist = [(a,b,c),(a,b,cp),(a,bp,c),(a,bp,cp),(ap,b,c),(ap,b,cp),(ap,bp,c),(ap,bp,cp)] arr = np.array([]) for i in range(8): # arr = np.array([]) for l in range(8): if lst[l] == nlist[i]: arr = np.append(arr,[1]) else: arr = np.append(arr,[0]) arr=arr.reshape((64,1)) #print(arr) array1 = np.append(array1,arr) #print(array1.transpose()) arr=arr[:] #array1 = np.append(array1,arr) #array1=array1.transpose() print(array1)Here I can create 64 times, 64*1 matrix and I want to add these 64*1 matrix together so that I could have 64*64 matrix. But I could not manage with that. array1 should be 64*64 matrix by arr which is 64*1 matrix
And here arr is ok but when I tried to add to arr inside array1, I cant add 64*1 matrix, I can add 1*64 matrix and I really don't know why