From 4103ce96fb07bd04be535d2dc6dca5f743482644 Mon Sep 17 00:00:00 2001 From: Brian Granger Date: Thu, 9 Feb 2012 21:09:12 -0800 Subject: [PATCH] Add _repr_html method to make DataFrames nice in IPython notebook. --- pandas/core/frame.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 493b946b209d7..461cfa4276cad 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -462,6 +462,9 @@ def __repr__(self): return com.console_encode(value) return com.console_encode(buf.getvalue()) + def _repr_html_(self): + return self.to_html() + def __iter__(self): """ Iterate over columns of the frame.