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 round #21

Merged
merged 7 commits into from
Jan 22, 2024

Conversation

nipsn
Copy link

@nipsn nipsn commented Dec 27, 2023

Provides an implementation for the round method.

Solves: /issues/13

Parameters:

Name Type Description Default
decimals int or Dict Number of decimal places to round each column to. If an int is given, round each real or float column to the same number of places. Otherwise dict rounds to variable numbers of places. Column names should be in the keys if decimals is a dict-like and the decimals to round should be the value. Any columns not included in decimals will be left as is. Elements of decimals which are not columns of the input will be ignored. 0

Returns:

Type Description
Table A Table with the affected columns rounded to the specified number of decimal places.

It follows the pandas definition, but it ignores the pd.Series type for the decimals parameter. This is because as it can be seen in the usage examples, this Series can be more easily be represented using a dictionary.

@github-actions github-actions bot added documentation Improvements or additions to documentation python tests labels Dec 27, 2023
@nipsn nipsn linked an issue Dec 27, 2023 that may be closed by this pull request
@nipsn nipsn self-assigned this Dec 27, 2023
Copy link

@tortolavivo23 tortolavivo23 left a comment

Choose a reason for hiding this comment

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

It has linting errors when running pflake8.

src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
tests/test_pandas_api.py Outdated Show resolved Hide resolved
@nipsn nipsn requested a review from tortolavivo23 January 5, 2024 12:06
@nipsn nipsn marked this pull request as ready for review January 9, 2024 11:28
docs/user-guide/advanced/Pandas_API.ipynb Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
src/pykx/pandas_api/pandas_meta.py Outdated Show resolved Hide resolved
@nipsn nipsn requested a review from marcosvm13 January 9, 2024 15:47
@nipsn nipsn merged commit dad1e0b into feature/pandas-api-2nd-block Jan 22, 2024
1 check passed
neutropolis pushed a commit that referenced this pull request Feb 13, 2024
nipsn added a commit that referenced this pull request Mar 11, 2024
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.

Feature: Implement round from Pandas API
5 participants