Skip to content

ENH: Improved error message (issue 13084) #13187

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4161,8 +4161,9 @@ def construction_error(tot_items, block_shape, axes, e=None):
raise e
if block_shape[0] == 0:
raise ValueError("Empty data passed with indices specified.")
raise ValueError("Shape of passed values is {0}, indices imply {1}".format(
passed, implied))
raise ValueError("Shape of passed values is {0}, indices imply {1}.\n\
This means that at least one of the dataframes contains duplicate \
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not true at all, this error could be called for quite a few reasons. pls put the error more specifially (e.g. in merge.py) and test if there are duplicates.

index values.".format(passed, implied))


def create_block_manager_from_blocks(blocks, axes):
Expand Down