table_formatters.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PyBloqs 作者: manahl 项目源码 文件源码
def _modify_dataframe(self, df):
        """Add row to dataframe, containing numbers aggregated with self.operator."""
        if self.total_rows == []:
            rows = df.index.tolist()
        else:
            rows = self.total_rows
        if self.operator is not OP_NONE:
            new_column = self.operator(df[df.applymap(np.isreal)], axis=1)
            new_column = new_column.fillna(0.)
            new_column[~new_column.index.isin(rows)] = ''
        else:
            new_column = pd.Series('', index=df.index)
        df_mod = df.copy()
        df_mod[self.column_name] = new_column
        return df_mod
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号