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

[BUG-REPORT] Sometimes std returns nan when it shouldn't #2291

Open
Ben-Epstein opened this issue Dec 1, 2022 · 1 comment
Open

[BUG-REPORT] Sometimes std returns nan when it shouldn't #2291

Ben-Epstein opened this issue Dec 1, 2022 · 1 comment

Comments

@Ben-Epstein
Copy link
Contributor

Thank you for reaching out and helping us improve Vaex!

Before you submit a new Issue, please read through the documentation. Also, make sure you search through the Open and Closed Issues - your problem may already be discussed or addressed.

Description

import vaex

vaex.from_arrays(value=[0.0179862099620915]*100).value.std()  # nan
vaex.from_arrays(value=[0.0179862099620915]*100).to_pandas_df().value.std()  # ~0

Software information

  • Vaex version (import vaex; vaex.__version__): 4.12.0
  • Vaex was installed via: pip / conda-forge / from source
  • OS:

Additional information
Please state any supplementary information or provide additional context for the problem (e.g. screenshots, data, etc..).

@JovanVeljanoski
Copy link
Member

Hi Ben!

Thanks for this. I just pushed a quick fix. Hopefully @maartenbreddels manages to have a look at it soon.

Note: even with the fix there will be some difference for this case compared to pandas/numpy. This is because vaex uses an unstable algorithm for this. But I think that is relevant mainly for this edge case, where the variance is sooo small (close to 0).

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

No branches or pull requests

2 participants