Skip to content

Consider MatRepr for __repr__ instead of Pandas #494

@alugowski

Description

@alugowski

https://pypi.org/project/matrepr/

Benefits:

  • output looks like a matrix, not a dataframe
  • faster, especially on first run where the pandas import is slow
  • small code

See it in action with python-graphblas:
https://nbviewer.org/github/alugowski/matrepr/blob/main/doc/demo-python-graphblas.ipynb

To try yourself, use matrepr's jupyter integration (causes Jupyter to use matrepr's formatter instead of the native one):

import matrepr.jupyter

For the Python REPL, a __repr__ monkey patch does the same:

import matrepr.patch.graphblas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions