From cc5272c7d9f7a18fde94fda419ff6fe8838d6b4c Mon Sep 17 00:00:00 2001 From: Felix Rochau Date: Fri, 24 Jan 2025 12:34:16 +0100 Subject: [PATCH] Silence pandas warnings Explicitly set dtype for X1_special Series. This is needed if no special_predictors are specified and the resulting empty Series is concatenated with X1_nonspecial. --- pysyncon/dataprep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysyncon/dataprep.py b/pysyncon/dataprep.py index f35f431..9ef2883 100644 --- a/pysyncon/dataprep.py +++ b/pysyncon/dataprep.py @@ -271,7 +271,7 @@ def make_covariate_mats( ) X1_special.append(self.foo[mask][predictor].agg(op)) - X1_special = pd.Series(X1_special, index=X0_special_columns).rename( + X1_special = pd.Series(X1_special, index=X0_special_columns, dtype="float").rename( self.treatment_identifier ) X1 = pd.concat([X1_nonspecial, X1_special], axis=0)