Skip to content

Conversation

@kbarbary
Copy link
Contributor

@kbarbary kbarbary commented May 1, 2025

This PR fixes deprecation warnings about DataFrame.swapaxes, detailed in #49.

This deprecation warning arises from calling np.array_split() on a DataFrame. Unfortunately it will not be fixed between numpy and pandas, as detailed in numpy/numpy#24889 (comment). It seems that in the future it may return ndarrays instead of DataFrames.

The fix here is one possible implementation: for pandas objects, split the integer index values, then apply them to the pandas object using iloc.

Thanks for the great package, by the way!

@kbarbary kbarbary requested a review from asiomchen as a code owner May 1, 2025 19:11
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🎉 Welcome to scikit-mol! 🧪✨ Thank you for submitting your first pull request! 🔧 Your effort and contributions mean a lot to us. 🙌 We'll review it as soon as possible. 🚀

Copy link
Collaborator

@asiomchen asiomchen left a comment

Choose a reason for hiding this comment

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

Hi @kbarbary, thank you for submitting this PR! I was aware of this issue, but never had enough desire to dig deeper.

The fix looks good to me.

@asiomchen asiomchen requested a review from EBjerrum May 3, 2025 13:28
@asiomchen
Copy link
Collaborator

@EBjerrum do you have anything to add or we can merge that and publish new version?

@EBjerrum
Copy link
Owner

EBjerrum commented May 4, 2025

No comments, it looks good. Thanks for the effort @kbarbary! Do you want to be listed in the Readme?, then please add yourself in the readme under contributions, both in the root dir and the docs/index file.

@EBjerrum
Copy link
Owner

EBjerrum commented May 5, 2025

Do pull from master if you want to edit the readme as there was a recent correction.

@kbarbary kbarbary force-pushed the fix-pandas-dep-warning branch from f55fee0 to 8a091d7 Compare May 5, 2025 23:17
@kbarbary
Copy link
Contributor Author

kbarbary commented May 5, 2025

Thanks for the review. Added myself to the contributors lists in 8a091d7.

@EBjerrum EBjerrum merged commit 5dd86f7 into EBjerrum:main May 6, 2025
10 checks passed
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.

3 participants