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

Addition of skew, add_prefix, add_suffix, count, std functions #16

Merged

Conversation

nipsn
Copy link
Contributor

@nipsn nipsn commented Dec 19, 2023

Feature

What does this change introduce?

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

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

Observations:

  • In Pandas the index attribute does not change the result (only the columns are changed, not the indexes). In this implementation, prefixes or suffixes can be added to indexes in addition to columns.

An implementation of the count function:

Observations:

  • In accordance with the correspondence between q nulls and Python nulls established in the .pd conversion, the empty string is regarded as a null value for columns of type symbol.

An implementation of the std function:

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html#pandas.DataFrame.std

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)

@nipsn
Copy link
Contributor Author

nipsn commented Dec 19, 2023

@cmccarthy1 @rianoc-kx
Please review our contributions and feel free to give any kind of feedback.
Thanks in advance.

docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
cmccarthy1
cmccarthy1 previously approved these changes Jan 2, 2024
@cmccarthy1
Copy link
Collaborator

Thanks for the changes @marcosvm13, I've approved but @rianoc-kx will need to approve this week additionally to get this included in the next release, we'll look to get this done this week for release with our 2.3 release coming up next week

@rianoc-kx
Copy link
Collaborator

I had made my suggested fixes and created a pull request to your repo to review

hablapps#31

We will be doing a larger refactor of PyKX in a similar fashion to use cleaner q code instead of building F-strings which make the code hard to read and refactor.

@cmccarthy1 cmccarthy1 merged commit 0877f15 into KxSystems:main Jan 19, 2024
1 check passed
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.

5 participants