Python Forum

Full Version: I can't see all elements of matrix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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?
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:

[Image: 642.png]

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:

[Image: 648.png]

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)
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/g...tions.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)
FYI: quest, you could have (and should have) posted your images as textual output.
Much more readable, copyable, and takes much less space