-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
use of iloc with heterogeneous DataFrame coerces dtype? #5256
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
Just upgraded to pandas 0.12.0, numpy 1.7.1, under Anaconda 1.7.0. The iloc coercion behavior is different (now appears more correct), but it still occurs:
|
that is a correct coercion |
So is this the best correct way to get the values out in an iterable format that preserves their types:
|
what are you doing with the values? the dtypes are column based so best to operate that way is there a reason you actually need these dtypes like this? |
yes, they are fixed-point integers representing raw values from a data acquisition system, which are going straight into an PyTables HDF5 file. Some of the data are quantized analog samples, others are digital values. Preservation of the original format is important for auditing purposes. They come in batches, and I'm just trying to process the last line of each batch for a UI update. |
HDFStore will properly serialize this |
I'm using pandas 0.11.0 and numpy 1.7.1 in Anaconda Python 1.6.0.
The
iloc
method seems to coerce dtype of values in some cases. For example:So far, so good. Now using
iloc
, it seems to cause type coercion when a single row is selected:The text was updated successfully, but these errors were encountered: