将缺少的值从数据框中记录到具有所有列的文件中

时间:2018-08-02 16:27:39

标签: python pandas dataframe logging

我正在尝试从数据框中获取缺少的值,以使用python程序登录到文件中。我正在使用loggingdf

中输出缺少的值
if df.columnName.isnull().any():
    logging.warning('Following items missing for File > %s' + '\n' + str(
        df.loc[df['columnName'].isnull()].iloc[:, [1,2,3,4]]) + '\n', file_name)

输出为:

2015-01-01 10:00:53 AM: WARNING -> Following line items missing for File > X:/location/file_name.csv
     Date        ...   Qty
125  01/01/2015  ...   100

[1 rows x 4 columns]

还有其他未捕获的列,被截断为...

我想要的是不仅仅显示...的所有列,因为这会隐藏所有信息并降低可处理性。

0 个答案:

没有答案
相关问题