Skip to content

Fixed pandas dataframe problem#36

Merged
liamjdavis merged 3 commits intomainfrom
pandas-branch
Jul 16, 2025
Merged

Fixed pandas dataframe problem#36
liamjdavis merged 3 commits intomainfrom
pandas-branch

Conversation

@BestLocation
Copy link
Collaborator

@BestLocation BestLocation commented Jun 17, 2025

This pull request introduces support for pandas.Series in the BoxPlot class, updates the corresponding data validation logic, and modifies the example notebook to reflect these changes.

Support for pandas.Series in BoxPlot:

  • MatPlus/BoxPlot.py: Added pandas as a dependency and updated the __init__ method to include pandas.Series as a valid data type for the data parameter. The error message was also updated to reflect this change. [1] [2]

Updates to the example notebook:

  • examples/box_plot.ipynb: Adjusted the notebook to regenerate the box plot example with the updated BoxPlot class. This included changes to the execution count and the embedded image data.

Description by Korbit AI

What change is being made?

Add support for Pandas dataframes to the BoxPlot class by updating type validation to accept any data convertible to a numeric array.

Why are these changes being made?

This change enables users to input Pandas dataframes into the BoxPlot class, enhancing its flexibility and interoperability with popular data structures in data analysis workflows. By leveraging NumPy's array-like conversion, the implementation supports a wider range of input types efficiently, while maintaining robust error handling for invalid inputs.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Design Non-Pythonic Type Checking ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
MatPlus/BoxPlot.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +69 to +73
if not (
isinstance(data, list)
or isinstance(data, np.ndarray)
or isinstance(data, pd.Series)
):

This comment was marked as resolved.

@liamjdavis liamjdavis self-requested a review June 18, 2025 03:50
Copy link
Collaborator

@liamjdavis liamjdavis left a comment

Choose a reason for hiding this comment

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

Add the change to the CHANGELOG.md and then we can merge!

@liamjdavis liamjdavis self-requested a review July 16, 2025 20:03
Copy link
Collaborator

@liamjdavis liamjdavis left a comment

Choose a reason for hiding this comment

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

LGTM!

@liamjdavis liamjdavis merged commit 2bb6bb5 into main Jul 16, 2025
10 checks passed
@liamjdavis liamjdavis deleted the pandas-branch branch July 16, 2025 20:05
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