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 of nunique function #9

Closed
wants to merge 5 commits into from

Conversation

chraberturas
Copy link

@chraberturas chraberturas commented Dec 13, 2023

Feature

What does this change introduce?

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

This is intended to be a 1:1 implementation of the nunique function from pandas.

The only change is that this implementation returns a dictionary instead of a Series.

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 documentation Improvements or additions to documentation python tests labels Dec 13, 2023
@marcosvm13 marcosvm13 reopened this Dec 21, 2023
@marcosvm13 marcosvm13 marked this pull request as draft December 21, 2023 12:22
@marcosvm13 marcosvm13 added work in progress Working on it and removed documentation Improvements or additions to documentation python tests labels Dec 21, 2023
@marcosvm13 marcosvm13 added this to the Pandas API 2nd Block milestone Dec 21, 2023
@marcosvm13 marcosvm13 linked an issue Dec 21, 2023 that may be closed by this pull request
docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Show resolved Hide resolved
'0h = type x;(x where not null x except w),(w:x where 10h=type each x);'
'x where not null x]}each')
res = filterNan(res) if dropna else res
return q('(\'[count;distinct]\')', res), cols

Choose a reason for hiding this comment

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

I leave this alternative syntax in case someone finds it useful to understand Christian's incredible composition:

q("(count distinct @) each", res)

@github-actions github-actions bot added documentation Improvements or additions to documentation python tests labels Jan 16, 2024
@chraberturas chraberturas deleted the chraberturas/pandas-api-nunique branch January 16, 2024 14:16
@chraberturas chraberturas restored the chraberturas/pandas-api-nunique branch January 16, 2024 14:17
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 work in progress Working on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants