Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeadTailBreaks RecursionError still not fully resolved #117

Closed
martinfleis opened this issue Oct 1, 2021 · 0 comments · Fixed by #121
Closed

HeadTailBreaks RecursionError still not fully resolved #117

martinfleis opened this issue Oct 1, 2021 · 0 comments · Fixed by #121
Labels

Comments

@martinfleis
Copy link
Member

I have seen the RecursionError coming from HeadTailBreaks again. This time caused by a floating point imprecision.

This snippet allows you to reproduce the issue. The parquet is just 2kb containing only the problematic bit of the values.

df = pandas.read_parquet("https://www.dropbox.com/s/p9pgg2pdvnhvgsw/sample.parquet?dl=1")
bins = mapclassify.HeadTailBreaks(df["values"])

The current workaround is to round the values before sending them to mapclassify but we should somehow resolve this under the hood (not that I know how from the top of my head).

bins = mapclassify.HeadTailBreaks(df["values"].round(6))

xref #46 and #95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant