-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
iterrows changes dtype of columns #3566
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
this is by definition correct, dtypes are maintained only in the columns the dtype is the lowest common denomincator of the row dtypes, which in this case is float |
additionally, it's probably very inefficient to keep track of the dtype of individual elements with the way Python's type system works, because at that point you have an object array anyway. you could just transpose the array if your use case allows that. that's not really solution, more of a workaround |
@cpcloud actually the issue is that the cross section happens to be there are methods that used to try to convert this (to |
@jreback right, df rows are series. i know, i was just trying to think (aloud) of how you would even do this without just having a single element keep track of its own dtype (I can imagine a class called |
@cpcloud what I mean is that w/o a reference, I don't want to convert And converting like this (w/o user input say or a refernce frame) means a lot of the time we have to convert back when |
@jreback ah ok, |
@jreback I know the 1 == 1.0. However I was populating a database with a TEXT column. And instead of '1' I got '1.0' in there. I have no problem that this is the correct behavior - just document it. ;) |
@tebeka fair point
|
this can be closed |
closed by #3569 |
The text was updated successfully, but these errors were encountered: