Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
reuse dataframe repr_html for nicer notebook output
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhelal committed Apr 29, 2024
1 parent e04457e commit 4e3ba54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mess/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def __repr__(self) -> str:
headers = ["primitive"] + df.columns.to_list()
return tabulate(df, headers)

def _repr_html_(self) -> str | None:
df = self.to_dataframe()
return df._repr_html_()

def __hash__(self) -> int:
return hash(self.primitives)

Expand Down

0 comments on commit 4e3ba54

Please sign in to comment.