h2o-py/h2o/frame.py
def show(self, use_pandas=False, rows=10, cols=200):
        """
        Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.

        If called from IPython, displays an html'ized result. Else prints a tabulate'd result.
        """
        if self._ex is None:
            print("This H2OFrame has been removed.")
            return
        if not self._has_content():
            print("This H2OFrame is empty and not initialized.")
            return
        if self.nrows == 0:
            print("This H2OFrame is empty.")
            return
        if not self._ex._cache.is_valid(): self._frame()._ex._cache.fill()
        if H2ODisplay._in_ipy():
            import IPython.display
            if use_pandas and can_use_pandas():
                IPython.display.display(self.head(rows=rows, cols=cols).as_data_frame(fill_cache=True))
            else:
                IPython.display.display_html(self._ex._cache._tabulate("html", False), raw=True)
        else:
            if use_pandas and can_use_pandas():
                print(self.head(rows=rows, cols=cols).as_data_frame(True))  # no keyword fill_cache
            else:
                s = self.__unicode__()
                stk = traceback.extract_stack()
                if "IPython" in stk[-3][0]:
                    s = "\n%s" % s
                try:
                    print(s)
                except UnicodeEncodeError:
                    print(s.encode("ascii", "replace"))
def show(self, use_pandas=False, rows=10, cols=200):
        """
        Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.

        If called from IPython, displays an html'ized result. Else prints a tabulate'd result.
        """
        if self._ex is None:
            print("This H2OFrame has been removed.")
            return
        if not self._has_content():
            print("This H2OFrame is empty and not initialized.")
            return
        if self.nrows == 0:
            print("This H2OFrame is empty.")
            return
        if not self._ex._cache.is_valid(): self._frame()._ex._cache.fill()
        if H2ODisplay._in_ipy():
            import IPython.display
            if use_pandas and can_use_pandas():
                IPython.display.display(self.head(rows=rows, cols=cols).as_data_frame(fill_cache=True))
            else:
                IPython.display.display_html(self._ex._cache._tabulate("html", False), raw=True)
        else:
            if use_pandas and can_use_pandas():
                print(self.head(rows=rows, cols=cols).as_data_frame(True))  # no keyword fill_cache
            else:
                s = self.__unicode__()
                stk = traceback.extract_stack()
                if "IPython" in stk[-3][0]:
                    s = "\n%s" % s
                try:
                    print(s)
                except UnicodeEncodeError:
                    print(s.encode("ascii", "replace"))
Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.

        If called from IPython, displays an html'ized result. Else prints a tabulate'd result.