-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Key Error: range exception when printing DataFrame #3869
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
Comments
can you post/link to these prof files, this is impossible to reprod otherwise |
Here is a link to the two .prof files, as well as the test code quoted above: https://dl.dropboxusercontent.com/u/1734164/run1.prof |
great pandas version, numpy version, and platform? |
python version as well |
@dmlockhart if you look at the top part of the question, I put a reproducible example To workaround for now, just reset_index on z (so your index is a number index), rather than this odd string index thanks for the report |
Neat bug actually... Probably just need to change pprint thing slightly and/or make sure that we don't build up format strings dynamically unless sure that string is escaped. Worth it to add something like escape_format something simple like: def escape_format(strlike):
return strlike.replace('{', '{{').replace('}', '}} ') |
no...just a simple change....something like
|
@jreback here is my version information: Python: Python 2.7.3 (default, Mar 26 2013, 21:14:37) Pandas: pandas - 0.11.0 Platform: OSX 10.6.8 |
@dmlockhart this should work now. |
Here's a reprodu
in core/index.py, check if
head/tail
is not already an instance of a strPrinting a DataFrame created from two Series objects (previously columns in other DataFrames) results in a "Key Error: 'range'" exception being raised. The DataFrame creation seems to work fine. Printing other DataFrames with the same "problematic" index also works okay.
Test code:
The text was updated successfully, but these errors were encountered: