Python Forum
I can't see all elements of matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I can't see all elements of matrix
#1
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?
Reply
#2
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?
Reply
#3
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)
Reply
#4
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)
Reply
#5
FYI: quest, you could have (and should have) posted your images as textual output.
Much more readable, copyable, and takes much less space
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if two matrix are equal and of not add the matrix to the list quest 3 778 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements ilknurg 1 5,011 May-17-2022, 11:38 AM
Last Post: Larz60+
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,299 May-03-2021, 06:30 AM
Last Post: Gribouillis
  Sorting Elements via parameters pointing to those elements. rpalmer 3 2,549 Feb-10-2021, 04:53 PM
Last Post: rpalmer
  matrix from matrix python numpy array shei7141 1 3,642 Jan-16-2017, 06:10 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020