Skip to content

Division by zero in certain counttypes #142

@bmschmidt

Description

@bmschmidt

Certain counttypes in queries--especially TextRatio and WordsRatio--can produce division by zero. (Say you're comparing publication rates by state before and after 1922, and some states do not exist in the post-1922 set.

This doesn't affect the main browser, but does affect my Vega-Lite experiments.

I believe the problem is probably that we are serializing to JSON with allow_nan to be false. That's good behavior, but python doesn't do what Javascript likes, which is to to replace NaN/Infinity values with 'null'. That would be one option. Another would be to just silently drop any queries that do not exist in the compare_limits field, perhaps as part of the join.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions