Metadata-Version: 1.0
Name: prettymatrix
Version: 0.1.2
Summary: Pretty printer for matrices and column vectors.
Home-page: https://github.com/samueljamesbell/prettymatrix
Author: Samuel Bell
Author-email: samueljamesbell@gmail.com
License: MIT
Description-Content-Type: UNKNOWN
Description: prettymatrix
        ============
        
        |Build Status|
        
        Struggling to tell your rows from your columns?
        
        ``prettymatrix`` creates human-friendly string representations of your
        numpy matrices and vectors, just like you’re used to.
        
        Installation
        ------------
        
        Available through pip:
        
        ::
        
            pip install prettymatrix
        
        Examples
        --------
        
        Stringify a single matrix
        ~~~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            import numpy as np
            import prettymatrix
        
            M = np.array([['1', '22'], ['333', '4444']])
        
            print(prettymatrix.matrix_to_string(M))
        
            # =>
            #  ┌          ┐
            #  │ 1   22   │
            #  │ 333 4444 │
            #  └          ┘
            #
        
            # We condense large matrices to a readable size
            N = prettymatrix.matrix_to_string(np.full((1000,1000), '0'))
        
            print(prettymatrix.matrix_to_string(N))
        
            # =>
            #  ┌                   ┐
            #  │ 0 0 0 … … … 0 0 0 │
            #  │ 0 0 0 … … … 0 0 0 │
            #  │ 0 0 0 … … … 0 0 0 │
            #  │ … … … … … … … … … │
            #  │ … … … … … … … … … │
            #  │ … … … … … … … … … │
            #  │ 0 0 0 … … … 0 0 0 │
            #  │ 0 0 0 … … … 0 0 0 │
            #  │ 0 0 0 … … … 0 0 0 │
            #  └                   ┘
            #
        
        Annotate your matrix with a name:
        
        ::
        
            import numpy as np
            import prettymatrix
        
            M = np.array([['0'], ['0']])
        
            print(prettymatrix.matrix_to_string(M, name='M_x_y'))
        
            # =>
            #  ┌   ┐
            #  │ 0 │
            #  │ 0 │
            #  └   ┘
            #  M_x_y
            #
        
        Or its dimensions:
        
        ::
        
            import numpy as np
            import prettymatrix
        
            M = np.array([['0'], ['0']])
        
            print(prettymatrix.matrix_to_string(M, include_dimensions=True))
        
            # =>
            #  ┌   ┐
            #  │ 0 │
            #  │ 0 │
            #  └   ┘
            #  (2x1)
            #
        
        Stringify a multiple matrices in a row
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        ::
        
            import numpy as np
            import prettymatrix
        
            M = np.array([['1', '22'], ['333', '4444']])
        
            print(prettymatrix.matrices_to_string(M, M))
        
            # =>
            #  ┌          ┐ ┌          ┐
            #  │ 1   22   │ │ 1   22   │
            #  │ 333 4444 │ │ 333 4444 │
            #  └          ┘ └          ┘
            #
        
        .. |Build Status| image:: https://travis-ci.org/samueljamesbell/prettymatrix.svg?branch=master
           :target: https://travis-ci.org/samueljamesbell/prettymatrix
        
Keywords: matrix matrices vector formatting string numpy
Platform: UNKNOWN
