-
Notifications
You must be signed in to change notification settings - Fork 15
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 isnull, isna, notnull, notna, idxmax, idxmin, kurt and sem functions #23
Comments
* Added implementation of kurt function (#23) * Added implementation of sem function (#22) * Refactored kurt and sem functions --------- Co-authored-by: Miguel Gómez <[email protected]> Co-authored-by: Francisco Tórtola Vivo <[email protected]>
https://pypi.org/project/pykx/2.5.1/ https://code.kx.com/pykx/2.5/release-notes/changelog.html#pykx-251 Additions Thanks for the contributions! |
Some small changes I made you will see in the final 2.5.1 MR https://github.com/KxSystems/pykx/pull/31/files src/pykx/pandas_api/pandas_meta.py Addition of these lines so behaviour with Keyed tables is consistent across the APIs. if 'Keyed' in str(type(tab)):
tab = q('value', tab) tests/test_pandas_api.py Pandas 2.1.4 >>> import pykx as kx
>>> tab = kx.q('([] sym: 100?`foo`bar`baz`qux; price: 250.0f - 100?500.0f; ints: 100 - 100?200)')
>>> tab.pd().idxmin()
sym 0
price 22
ints 44
dtype: int64 Pandas 1.5.3 >>> import pykx as kx
>>> tab = kx.q('([] sym: 100?`foo`bar`baz`qux; price: 250.0f - 100?500.0f; ints: 100 - 100?200)')
>>> tab.pd().idxmin()
...
TypeError: reduction operation 'argmin' not allowed for this dtype |
Hi Rian! I have one question then: I noticed that in the README you mention how Do you know of a way to be able to test both pandas major versions at once? The best solution that comes to mind would be to have two Python virtual environments with these two major versions and switching back and forth, but it might turn cumbersome in the long run... |
We have gitlab testing pipelines which run in both versions as soon as we push. To make this less cumbersome a function could be added to your p1p2 () {
python -m pip install pandas==1.5.3 && \
eval "$@" && \
python -m pip install pandas==2.1.4 && \
eval "$@"
} Then the test will run on both versions: p1p2 python -m pytest -vvv -n 0 --no-cov --junitxml=report.xml tests/test_pandas_api.py::test_pandas_idxmin We'll research/think about making this easier going forward |
That checks out! |
name: Addition of isnull, isna, notnull, notna, idxmax, idxmin, kurt and sem functions.
about: Missing pandas API functionality
title: 'Addition of isnull, isna, notnull, notna, idxmax, idxmin, kurt and sem functions.'
labels: ''
assignees: '@nipsn @tortolavivo23 @neutropolis @MiguelGomezC'
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
An implementation of said functions.
Describe alternatives you've considered
Additional resource
Links to pandas documentation of said functions:
The text was updated successfully, but these errors were encountered: