Skip to content

Commit

Permalink
Merge branch 'main' into temporal-shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
jmafoster1 authored Jul 31, 2024
2 parents 2b76d3c + b6ce637 commit e6284c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions causal_testing/testing/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,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

0 comments on commit e6284c5

Please sign in to comment.