py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.

Home Page:https://www.pywhy.org/dowhy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Alexxakiode opened this issue · comments

Please can someone help me look into why my code is not running? Thanks
ValueError

In the examples from the documentation, the datasets created by the dowhy package generate a dictionary with the data and some other information, such as treatment and outcome variable names.
In that case, when they use data['treatment_name'] they are actually calling the dictionary key.
So, to solve that problem, use just the name of your variable as input for the argument.
Example,
treatment = ['power']
outcome= 'Energy usage.

That worked for me.