Added ability for objects to override how they show up in dataframe · pandas-dev/pandas@86ecf05 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 86ecf05

Added ability for objects to override how they show up in dataframe

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -210,6 +210,10 @@ def as_escaped_string(
210 210
211 211 if hasattr(thing, "__next__"):
212 212 return str(thing)
213 +
214 +if hasattr(thing, "__pandas_repr__"):
215 +return str(thing.__pandas_repr__())
216 +
213 217 elif isinstance(thing, dict) and _nest_lvl < get_option(
214 218 "display.pprint_nest_depth"
215 219 ):