Skip to content

Commit ed430ae

Browse files
committed
Added ability for objects to override how they show up in dataframe
1 parent 2aca49a commit ed430ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/io/formats/printing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ def as_escaped_string(
213213

214214
if hasattr(thing, "__next__"):
215215
return str(thing)
216+
217+
if hasattr(thing, "__pandas_repr__"):
218+
return str(thing.__pandas_repr__())
219+
216220
elif isinstance(thing, dict) and _nest_lvl < get_option(
217221
"display.pprint_nest_depth"
218222
):

0 commit comments

Comments
 (0)