-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
df.head() and .tail() weirdness #5370
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
@michaelaye you have a you exposed a bug in what |
This emphasizes the need for a convert_objects call in Excel reader, |
this has nothing to do with conversion not should convert objects have anything to do with an index conversions (which cannot be done in any event as it's by definition object nj this case) |
Just that you end up with surprising dtypes from Excel. |
@jtratner oh....yes...you almost certainly need to do a convert_objects from excel (maybe |
@jreback I'm a bit confused as I didn't do any selection, I was only calling head(). Or is it that head() internally calls exactly the same mechanisms as I would do when I select the first five rows? |
Yeah, okay, spare your typing, squash other bugs instead! ;) I had a look at your PR, github is so cool... |
@michaelaye |
Yeah, shouldn't have hijacked this :) |
I am data wrangling some Excel data into a dataframe.
At some point it has an Index like so:
Naturally, I want to drop the "u'(K)'" index. Interestingly, after doing so the head() and tail() calculation totally goes haywire, and that irrespective of using this Index with dtype object or after converting it to the new Float64Index.:
or before, with dtypes still as 'object':
I think I can see what's happening here: The head calculation somehow picks up the 5.0 value in the Index and choses to display the dataframe until then. Which now makes me question: Did the API of head() change and I didn't notice? My apologies if this actually is a case of PEBKAC.
The process of my data wrangling can be seen here:
http://nbviewer.ipython.org/7208717
pandas version: '0.12.0-1000-gea97682'
The text was updated successfully, but these errors were encountered: