(self, data_frame)
return '\n'.join(return_lines)
Returns a markdown formatted string from a pandas DataFrame.
Returns a markdown formatted string from a pandas DataFrame.
Returns a markdown formatted string from a pandas DataFrame .
def _dataframe_to_markdown(self, data_frame):
        """Returns a markdown formatted string from a pandas DataFrame."""
        nr_rows, _ = data_frame.shape
        if not nr_rows:
            return '*<empty table>*'

        if nr_rows <= (self._DATAFRAM_HEADER_ROWS + self._DATAFRAM_TAIL_ROWS):
            return tabulate.tabulate(
                data_frame, tablefmt='pipe', headers='keys')

        return_lines = []
        return_lines.append(tabulate.tabulate(
            data_frame[:self._DATAFRAM_HEADER_ROWS], tablefmt='pipe',
            headers='keys'))
        return_lines.append('| ... |')
        return_lines.append(tabulate.tabulate(
            data_frame[-self._DATAFRAM_TAIL_ROWS:], tablefmt='pipe',
            headers='keys'))
        return '\n'.join(return_lines)
def _dataframe_to_markdown ( self , data_frame ) : nr_rows , _ = data_frame . shape if not nr_rows : return '*<empty table>*' if nr_rows <= ( self . _DATAFRAM_HEADER_ROWS + self . _DATAFRAM_TAIL_ROWS ) : return tabulate . tabulate ( data_frame , tablefmt = 'pipe' , headers = 'keys' ) return_lines = [ ] return_lines . append ( tabulate . tabulate ( data_frame [ : self . _DATAFRAM_HEADER_ROWS ] , tablefmt = 'pipe' , headers = 'keys' ) ) return_lines . append ( '| ... |' ) return_lines . append ( tabulate . tabulate ( data_frame [ - self . _DATAFRAM_TAIL_ROWS : ] , tablefmt = 'pipe' , headers = 'keys' ) ) return '\n' . join ( return_lines )