From a20fede9a4eb57234aea175dfc4c671d521c5167 Mon Sep 17 00:00:00 2001 From: leostimpfle Date: Fri, 20 Dec 2024 21:01:46 +0100 Subject: [PATCH] fix error messages --- Python/rddensity/src/rddensity/rdbwdensity.py | 2 +- Python/rddensity/src/rddensity/rddensity.py | 4 ++-- Python/rddensity/src/rddensity/rdplotdensity.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Python/rddensity/src/rddensity/rdbwdensity.py b/Python/rddensity/src/rddensity/rdbwdensity.py index 5b37f8d..6c0f23e 100644 --- a/Python/rddensity/src/rddensity/rdbwdensity.py +++ b/Python/rddensity/src/rddensity/rdbwdensity.py @@ -70,7 +70,7 @@ def rdbwdensity(X, c=0, p=2, # missing values X = pd.DataFrame(X) if X.isnull().values.any(): - warnings.warn(X.isnull().sum() + 'missing observation(s) are ignored.\n') + warnings.warn(f'{X.isnull().sum()} missing observation(s) are ignored.\n') X = X.dropna(axis=0) # sample sizes diff --git a/Python/rddensity/src/rddensity/rddensity.py b/Python/rddensity/src/rddensity/rddensity.py index 39d7e81..74a2f25 100644 --- a/Python/rddensity/src/rddensity/rddensity.py +++ b/Python/rddensity/src/rddensity/rddensity.py @@ -119,10 +119,10 @@ def rddensity(X, c=0, p=2, q=0, else: raise Exception("No more than two bandwidths are accepted.") - #missing value handling + # missing value handling X = pd.DataFrame(X) if X.isnull().values.any(): - warnings.warn(X.isnull().sum() + 'missing observation(s) are ignored.\n') + warnings.warn(f'{X.isnull().sum()} missing observation(s) are ignored.\n') X = X.dropna(axis=0) diff --git a/Python/rddensity/src/rddensity/rdplotdensity.py b/Python/rddensity/src/rddensity/rdplotdensity.py index 40177ec..fa7bf3d 100644 --- a/Python/rddensity/src/rddensity/rdplotdensity.py +++ b/Python/rddensity/src/rddensity/rdplotdensity.py @@ -90,10 +90,10 @@ def rdplotdensity(rdd, X, plotRange=None, plotN=[10], plotGrid=['es', 'qs'], nUniqueMin = rdd.nUniqueMin massPoints = rdd.massPoints - #missing value handling + # missing value handling X = pd.DataFrame(X) if X.isnull().values.any(): - warnings.warn(X.isnull().sum() + 'missing observation(s) are ignored.\n') + warnings.warn(f'{X.isnull().sum()} missing observation(s) are ignored.\n') X = X.dropna(axis=0)