fau-klue / pandas-association-measures

Statistical association measures for Python pandas
MIT License
8 stars 2 forks source link

Error in phi function #13

Closed martialblog closed 4 years ago

martialblog commented 4 years ago

The new phi function throws an error when used in the tests.

def test_log_likelihood(sample_dataframe):

        df = sample_dataframe
        am.log_likelihood(sample_dataframe)

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

I created a test to recreate the error here: https://github.com/fau-klue/pandas-association-measures/tree/phi-error

martialblog commented 4 years ago

@ausgerechnet Hi, can you have a look at that please?

ausgerechnet commented 4 years ago

all AMs now take a dict-like object (a dataframe row) as argument, not a dataframe. correct usage is thus df.apply(am.log_likelihood, axis=1)

ausgerechnet commented 4 years ago

fixed in v0.1.5, you can use am.log_likelihood(sample_dataframe) again