causality icon indicating copy to clipboard operation
causality copied to clipboard

Python Package: Problems with Codeline “effect.pdf(x)”

Open cschiri opened this issue 5 years ago • 1 comments

I recently installed the causality package. And, I am working through the example on the package's PyPi page: https://pypi.org/project/causality/

Everything seems to work well until I get to the last line with the code: effect.pdf(x)

I get the KeyError "KeyError: 'b'"

The offending block of code:

> from causality.estimation.nonparametric import CausalEffect
> admissable_set = adjustment.admissable_set(g,['x2'], ['x3'])
> effect = CausalEffect(X, ['x2'], ['x3'], variable_types=variable_types, 
> admissable_set=list(admissable_set))
> x = pd.DataFrame({'x2' : [0.], 'x3' : [0.]})
> effect.pdf(x)

I think it's just a problem with the syntax of the code. I am new to Python and am not able to figure out what it is. Please help

cschiri avatar Oct 28 '19 07:10 cschiri

I'm unable to replicate this bug -- can you share the data generating code you used here?

akelleh avatar Nov 06 '21 18:11 akelleh