Skip to content

ZeroDivisionError but only sometimes #13

@luga01

Description

@luga01

Hello!
Thank you for making this tool available! I have been using it to obtain m-ratio measures from a Pandas DataFrame consisting of the columns ‘Stimuli’, ‘Responses’, ‘Accuracy’, and ‘Confidence’. The confidence scores of the data are discrete integer scores, ranging from 1-6 (nRatings = 6). (All subjects are treated as a single subject.)
image

I am able to use the metad() and the .criterion() method without a problem on this DataFrame.
image

However, when I divide the same dataset up into individual participants and compute the m-ratio for each one, I get a ZeroDivisionError: division by zero, but only after it has successfully computed the m-ratio for several participants.
What I do is create an individual DataFrame for each participant and apply the metad() function to it. This works for a couple of participants and then suddenly turns up with a ZeroDivisionError. I have looked at the DataFrame of the participant for whom I get the error (bottom DataFrame), but cannot spot any difference between it and DataFrames of participants for whom the metad() function does work (top DataFrame).
image

The first DataFrame works, but for the second one I get the error message:
image

Do you have any idea why this might be happening or what can be done to fix it?

Thank you in advance,
Lucas Gappmayr

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions