Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions causal_testing/testing/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading