diff --git a/causal_testing/testing/estimators.py b/causal_testing/testing/estimators.py index 5133744b..fdd834bc 100644 --- a/causal_testing/testing/estimators.py +++ b/causal_testing/testing/estimators.py @@ -383,6 +383,9 @@ def estimate_ate(self) -> tuple[pd.Series, list[pd.Series, pd.Series]]: # Create an empty individual for the control and treated individuals = pd.DataFrame(1, index=["control", "treated"], columns=model.params.index) + # For Pandas version > 2, we need to explicitly state that the dataframe takes floating-point values + individuals = individuals.astype(float) + # It is ABSOLUTELY CRITICAL that these go last, otherwise we can't index # the effect with "ate = t_test_results.effect[0]" individuals.loc["control", [self.treatment]] = self.control_value