Skip to content

Commit 86ecf05

Browse files
committed
Added ability for objects to override how they show up in dataframe
1 parent 1fcbaa9 commit 86ecf05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/io/formats/printing.py

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ def as_escaped_string(
210210

211211
if hasattr(thing, "__next__"):
212212
return str(thing)
213+
214+
if hasattr(thing, "__pandas_repr__"):
215+
return str(thing.__pandas_repr__())
216+
213217
elif isinstance(thing, dict) and _nest_lvl < get_option(
214218
"display.pprint_nest_depth"
215219
):

0 commit comments

Comments
 (0)