Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in sci-kit learn version of DifferenceInDifferences.plot method #259

Closed
drbenvincent opened this issue Oct 17, 2023 · 0 comments · Fixed by #306
Closed

Error in sci-kit learn version of DifferenceInDifferences.plot method #259

drbenvincent opened this issue Oct 17, 2023 · 0 comments · Fixed by #306
Labels
bug Something isn't working plotting Improve or fix plotting

Comments

@drbenvincent
Copy link
Collaborator

When running the did_skl.ipynb example we get an error when calling the plot function.

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (2, 1) + inhomogeneous part.

I believe this relates to line 453 here where we calculate the position of the text annotation associated with the causal effect arrow.

ax.annotate(
"causal\nimpact",
xy=(1.05, np.mean([self.y_pred_counterfactual, self.y_pred_treatment[1]])),
xycoords="data",
xytext=(5, 0),
textcoords="offset points",
color="green",
va="center",
)

@drbenvincent drbenvincent added bug Something isn't working plotting Improve or fix plotting labels Oct 17, 2023
@drbenvincent drbenvincent added this to the Pay off technical debt milestone Nov 2, 2023
drbenvincent added a commit that referenced this issue Mar 14, 2024
Fix #259: Annotation in `did_skl` notebook plot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plotting Improve or fix plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant