Skip to content

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

@cschiri

Description

@cschiri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions