Skip to content

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

Merged
jameslamb merged 6 commits into
masterfrom
python/pandas-to-numpy
Nov 16, 2023
Merged

jameslamb merged 6 commits into
masterfrom
python/pandas-to-numpy

Conversation

@jameslamb

Copy link
Copy Markdown
Member

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.

Comment thread python-package/lightgbm/basic.py Resolved
@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
@github-actions

Copy link
Copy Markdown
Contributor

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