core.py 文件源码

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

项目:SSieve 作者: davidimprovz 项目源码 文件源码
def cleanNullColumns(sheet):
        """
        Helper function to discard columns in sheets where each value in column is null.

        Accepts a DataFrame as the sheet argument.

        Returns the cleaned dataframe or an error Tuple of (False, error)
        """
        try:# check for and remove columns with all NaNs
            for column in sheet.columns: 
                if pd.isnull(sheet[column]).all():
                    sheet.drop(column, axis=1, inplace=True)
            return sheet

        except Exception as e:
            return False, e
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号