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

Fixes overflow bug if moments are large #481

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

JGSweets
Copy link
Contributor

@JGSweets JGSweets commented Jun 7, 2022

Overflow error would occur if M2 was large and powered.

OverflowError: (34, 'Numerical result out of range')

This PR fixes the above error. However, a long term fix would be potentially iterating through large data to ensure smaller moments.

@JGSweets JGSweets added Bug Something isn't working High Priority Dramatic improvement, inaccurate calculation(s) or bug / feature making the library unusable labels Jun 7, 2022
@@ -318,7 +318,8 @@ def biased_skew(df_series):
if (M2 == 0):
return 0.0

skew = np.sqrt(n) * M3 / M2 ** 1.5
with np.errstate(all='ignore'):
Copy link
Contributor Author

@JGSweets JGSweets Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix (1/2) is here

@@ -354,7 +355,8 @@ def biased_kurt(df_series):
if (M2 == 0):
return -3.0

kurt = n * M4 / M2 ** 2 - 3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix (2/2) is here

@ksneab7 ksneab7 enabled auto-merge (squash) June 7, 2022 11:58
@ksneab7 ksneab7 merged commit f448bcf into capitalone:main Jun 7, 2022
stevensecreti pushed a commit to stevensecreti/DataProfiler that referenced this pull request Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High Priority Dramatic improvement, inaccurate calculation(s) or bug / feature making the library unusable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants