We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It may be helpful for quicker debugging to provide information of data and index lengths in the error message in sanitize_index function:
pandas/pandas/core/internals/construction.py
Line 516 in 2115bf3
The modified code could be: raise ValueError(f'Length of values {len(data)} does not match length of index {len(index)}')
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, but I personally don't see that being much more incrementally useful.
Let's see if anyone else sees value otherwise will close out in a few days
Sorry, something went wrong.
This seems reasonable to me. A PR updating the error message and a test would be welcome.
Is this solved by #26911?
Not sure if it was #26911, but we should be OK now.
In [1]: import pandas as pd = In [2]: pd.Series([0,1], index=[0, 1, 2]) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-2-23ab3324fbf7> in <module> ----> 1 pd.Series([0,1], index=[0, 1, 2]) ~/sandbox/pandas/pandas/core/series.py in __init__(self, data, index, dtype, name, copy, fastpath) 241 'Length of passed values is {val}, ' 242 'index implies {ind}' --> 243 .format(val=len(data), ind=len(index))) 244 except TypeError: 245 pass ValueError: Length of passed values is 2, index implies 3
LMK if you were taking a different path @vishal-srini-rao
No branches or pull requests
It may be helpful for quicker debugging to provide information of data and index lengths in the error message in sanitize_index function:
pandas/pandas/core/internals/construction.py
Line 516 in 2115bf3
The modified code could be:
raise ValueError(f'Length of values {len(data)} does not match length of index {len(index)}')
The text was updated successfully, but these errors were encountered: