Skip to content

Prettify your matrices and print them in human readable way

Notifications You must be signed in to change notification settings

PeterWaIIace/PxM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Untitled-2024-01-19-1143(2)

PxM

Prettify your matrices and print them in human readable way. No dependencies

How to use:

Just copy draw_array.py into your code base, it has no dependencies

And then pass your JAX or Numpy arrays in following fashion:

display_array([array_1, array_2],["purple","blue"])

or to display it with values:

display_with_values([array_1, array_2],["green","yellow"])

Examples

just diplay:

⎡               ⎤                                       
⎢ .  .  .  .  . ⎥⎡               ⎤⎡               ⎤⎡   ⎤
⎢ .  . 5x2 .  . ⎥⎢ .  . 5x1 .  . ⎥⎢ .  . 5x1 .  . ⎥⎢2x1⎥
⎣               ⎦⎣               ⎦⎣               ⎦⎣   ⎦
⎡               ⎤                                       
⎢ .  .  .  .  . ⎥⎡               ⎤⎡               ⎤⎡   ⎤
⎢ .  . 5x2 .  . ⎥⎢ .  . 5x1 .  . ⎥⎢ .  . 5x1 .  . ⎥⎢2x1⎥
⎣               ⎦⎣               ⎦⎣               ⎦⎣   ⎦

or with values (it may not work as intented with large matrices):

                 ⎡               ⎤                                  
                 ⎢ 1.0  0.0  0.0 ⎥                                  
⎡               ⎤⎢ 0.0  1.0  0.0 ⎥⎡               ⎤⎡               ⎤
⎢ 1.0  1.0  1.0 ⎥⎢ 0.0  0.0  1.0 ⎥⎢ 1.0  1.0  1.0 ⎥⎢ 0.5  0.5  0.5 ⎥
⎣               ⎦⎣               ⎦⎣               ⎦⎣               ⎦
                 ⎡               ⎤                                                      
                 ⎢ 1.0  0.0  0.0 ⎥                                                      
                 ⎢ 0.0  1.0  0.0 ⎥                                                      
                 ⎢ 0.0  0.0  1.0 ⎥                                                      
⎡               ⎤⎢ 1.0  1.0  0.0 ⎥⎡                         ⎤⎡                         ⎤
⎢ 1.5  1.5  1.5 ⎥⎢ 0.0  0.0  1.0 ⎥⎢ 1.5  1.5  1.5  3.0  1.5 ⎥⎢ 0.0  0.0  0.0  0.5  0.5 ⎥
⎣               ⎦⎣               ⎦⎣                         ⎦⎣                         ⎦
                           ⎡                         ⎤                        
⎡                         ⎤⎢ 0.0  0.0  0.0  1.0  0.0 ⎥⎡          ⎤⎡          ⎤
⎢ 1.5  1.5  1.5  3.5  2.0 ⎥⎢ 1.0  0.0  0.0  1.0  1.0 ⎥⎢ 3.5  7.0 ⎥⎢ 0.5  0.5 ⎥
⎣                         ⎦⎣                         ⎦⎣          ⎦⎣          ⎦

About

Prettify your matrices and print them in human readable way

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages