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

Added implementation and tests for std() function #3

Closed
wants to merge 1 commit into from

Conversation

nipsn
Copy link

@nipsn nipsn commented Nov 16, 2023

Feature

What does this change introduce?

An implementation of the std function: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html

When the ddof parameter is equal to the table length (after preprocessing the axis), we essentially divide by zero when we compute the standard deviation. In pure q, this results in infinite values (0W), but in pandas, this operation results in nan values, so I kept this later case on my implementation to match pandas' imlementation.

Also, pandas' implementation includes an extra parameter, skipna. However, since it's ignored on mean and median, it has been ignored here as well.

General

  • Has an example been added to demo the new feature?
  • Have existing examples been updated or tested?
  • Have you added any new Environment Variables/Configuration Options? If yes please tick the boxes below as applicable
    • Addition to reimporter logic within src/pykx/pykx.q and src/pykx/reimporter.py
    • Have updated the src/pykx/util.py logic which is used for environment variable
  • If there have been any dependency updates have they been reflected in all files?
    • pyproject.toml
    • docs/getting-started/installing.md
    • conda-recipe/meta.yaml
    • README.md
  • If any examples have been updated has it's associated .zip been updated

Code

  • Has all temporary code used during development been removed?
  • Has all commented out (unused) code been removed?
  • Where reasonable have you ensured there is no duplication of existing code?
  • If applicable for your use-case have you ensured that the code is performant?

Testing

  • Have unit tests been created or existing ones updated to test this new functionality?

Documentation

  • Has documentation been added for all public code?
  • Has a release note been included for the new feature?
  • Has any documentation which would benefit from this feature been updated to use the most up to date functionality?
  • If a new class has been added has a documentation stub .md file associated with it been created?
  • If any documentation page has been created has it been added to mkdocs.yml
  • Have you checked your changes with a spell checker? (US English)

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 23, 2023
@nipsn nipsn mentioned this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants