INNER CODE UNIT · Python

to_frame

HHammond/PrettyPandas · prettypandas/summarizer.py:197

    def to_frame(self):
        """Add summaries and convert back to DataFrame"""
        return self.frame

    @property
    def style(self):
        """Add summaries and convert to Pandas Styler"""
        row_titles = [a.title for a in self._cleaned_summary_rows]
        col_titles = [a.title for a in self._cleaned_summary_cols]
        row_ix = pd.IndexSlice[row_titles, :]
        col_ix = pd.IndexSlice[:, col_titles]

        def handle_na(df):
            df.loc[col_ix] = df.loc[col_ix].fillna('')
            df.loc[row_ix] = df.loc[row_ix].fillna('')
            return df

        styler = (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…