I can't see all elements of matrix - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: I can't see all elements of matrix (/thread-30779.html) |
I can't see all elements of matrix - quest - Nov-05-2020 Hello I cant see my 64*64 matrix in python but I have to see it. I can see just this part image And I am using numpy How can I do that? RE: I can't see all elements of matrix - jefsummers - Nov-05-2020 Your image will not post, and images are frowned upon. What are you using to store your matrix? Numpy? Pandas? What are you using to display the matrix? IDLE? Jupyter? VSCode? Numpy Matrix Elements: Change Rows to Columns - quest - Nov-05-2020 Hello I created my code as I want and now I just want to change my matrix. As a result of my code, I have this matrix: And here I want to write each column as a rows and after that I want to add them together. As a result I should see this image: Here is my code(I just add the related part): ………….. ##I didn't paste here because we have just definition of list for triplet in itertools.product([0, 1], repeat=6): arr = np.array([]) for i in range(8): for l in range(8): if l[l] == n[i]: arr = np.append(arr,[1]) else: arr = np.append(arr,[0]) print(arr) RE: I can't see all elements of matrix - deanhystad - Nov-05-2020 Numpy is being nice and showing you the start and end of each row without line wrapping messing everything up so badly it cannot make heads or tails of what was printed. If you want to print all the columns you have to do that yourself or configure the print options. https://numpy.org/doc/stable/reference/generated/numpy.set_printoptions.html A 64x64 matrix is going to be a horrible looking mess. And next time provide a working example that demonstrates your problem. Something like this: import numpy as np rows=64 cols=64 matrix = [] for r in range(rows): matrix.append([r*cols+c for c in range(cols)]) matrix = np.array(matrix) print(matrix) RE: I can't see all elements of matrix - Larz60+ - Nov-06-2020 FYI: quest, you could have (and should have) posted your images as textual output. Much more readable, copyable, and takes much less space |