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

[python-package] consolidate pandas-to-numpy conversion code #6156

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

jameslamb
Copy link
Collaborator

Contributes to #3756.

#5612 introduced a try-catch block with different approaches to converting array data from pandas to numpy format inside the Python package.

That PR added 2 identical copies of that block in the 2 places where lightgbm needs to do that conversion.

This PR proposes consolidating that logic into a single internal function. To make basic._data_from_pandas() a bit easier to understand, and to reduce the risk of inconsistencies if additional branches of logic are added in response to future pandas versions.

@jameslamb jameslamb requested a review from jmoralez November 7, 2023 02:32
@jameslamb jameslamb merged commit 18dbd65 into master Nov 16, 2023
@jameslamb jameslamb deleted the python/pandas-to-numpy branch November 16, 2023 04:10
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants