-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
The Value Error saying that empty data was passed with indices specif… #52084
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
The Value Error saying that empty data was passed with indices specif… #52084
Conversation
…ied is now only raised when that is indeed the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your pr
a few things:
- what would it show now instead? could you add a test please?
- why are you comparing an integer with a boolean?
Hey, thank you for your quick response.
|
yup, definitely
ah I see, thanks |
…lti_column_raises method in test_constructors.py.
…olumn_raises to a raw string.
Nice, thanks! Can you add a whatsnew note to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there 💪
doc/source/whatsnew/v2.1.0.rst
Outdated
@@ -241,6 +241,7 @@ Styler | |||
Other | |||
^^^^^ | |||
- Bug in :func:`assert_almost_equal` now throwing assertion error for two unequal sets (:issue:`51727`) | |||
- Bug in :func:`_check_values_indices_shape_match` no longer raises ValueError with a message saying that indices were specified when creating an empty DataFrame that has an issue with the number of columns in the data and in the columns argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to have an issue number (even if there's no issue, so here you can put the PR number, i.e. 52084
)
Also, I think this would fit better in the "Other enhancements" section, as that's where some other error messages are?
Finally, the note needs to be user-facing and can't mention private methods. How about "Improved error message when creating DataFrame with empty data, no index, and wrong number of columns"?
… the visible behavior for the library user instead of the behavior of a private method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me pending green, thanks @Xargonus
Thanks @Xargonus |
…ied is now only raised when that is indeed the case.
The following example incorrectly triggers the ValueError saying that "Empty data passed with indices specified."
pd.DataFrame(np.zeros((0, 2)), columns=['a', 'b', 'c'])
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.