From c635247263c076dfbbcce7010e127a856540ce84 Mon Sep 17 00:00:00 2001 From: Tim O'Donnell <timodonnell@gmail.com> Date: Mon, 15 May 2017 16:46:10 -0400 Subject: [PATCH] Better debug output in null check --- mhcflurry/antigen_presentation/presentation_model.py | 2 +- mhcflurry/common.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mhcflurry/antigen_presentation/presentation_model.py b/mhcflurry/antigen_presentation/presentation_model.py index 33e3e709..25506498 100644 --- a/mhcflurry/antigen_presentation/presentation_model.py +++ b/mhcflurry/antigen_presentation/presentation_model.py @@ -579,5 +579,5 @@ def ensemble_predictions(models, peptides_df, mask_indices_list=None): values = panel.ix[:, :, col] assert values.shape == (len(peptides_df), len(models)) result[col] = model.combine_ensemble_predictions(col, values.values) - assert_no_null(result[col]) + assert_no_null(pandas.Series(result[col])) return result diff --git a/mhcflurry/common.py b/mhcflurry/common.py index cc21280e..da205c34 100644 --- a/mhcflurry/common.py +++ b/mhcflurry/common.py @@ -188,8 +188,8 @@ def describe_nulls(df, related_df_with_same_index_to_describe=None): if isinstance(df, pandas.Series): df = df.to_frame() with pandas.option_context('mode.use_inf_as_null', True): - null_counts_by_col = df.isnull().sum(axis=0) - null_rows = df.isnull().sum(axis=1) > 0 + null_counts_by_col = pandas.isnull(df).sum(axis=0) + null_rows = pandas.isnull(df).sum(axis=1) > 0 return ( "Columns with nulls:\n%s, related rows with nulls:\n%s, " "full df:\n%s" % ( -- GitLab