Skip to content

Percentile Scaling Data Transformation #61374

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

Closed

Conversation

sujan099
Copy link

This pull request adds a new data transformation utility called percentile_scaling to the pandas/io/ module, which scales numerical data to a percentile-based range from 0 to 100. This transformation is useful for standardizing features in data preprocessing workflows, especially for ML pipelines or percentile-based visual analytics.

Implementation Details

  • Introduced a new function percentile_scaling(data: List[float]) -> List[float] that:
    • Accepts a list or NumPy array of numerical values.
    • Returns values scaled to a [0, 100] percentile scale.
    • Raises appropriate errors for invalid input (e.g., zero variance or empty input).

Tests

  • Added unit tests in pandas/tests/io/test_percentile_scaling.py:
    • Validates correct scaling behavior.
    • Handles edge cases such as identical values and empty inputs.
    • All tests pass successfully using unittest.

Compliance

  • Follows Pandas contribution guidelines
  • All tests pass successfully
  • Function is self-contained and does not introduce dependencies
  • Code is PEP8-compliant and cleanly documented

Notes

This contribution is part of a university-level data engineering course project (DATA 226). The goal is to implement practical transformation logic for real-world data pipeline use cases while following standard open-source contribution workflows.

  • Tests added and passed
  • Code passes style checks and pre-commit hooks

@mroeschke
Copy link
Member

Thanks for the PR, but since there is no open issue associated with this PR that has also been triaged and accepted by the core team, we will not be moving forward with this feature so closing.

@mroeschke mroeschke closed this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants