Skip to content

select_dtypes fails on float16 typecode #11990

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

Closed
jseabold opened this issue Jan 7, 2016 · 5 comments
Closed

select_dtypes fails on float16 typecode #11990

jseabold opened this issue Jan 7, 2016 · 5 comments
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@jseabold
Copy link
Contributor

jseabold commented Jan 7, 2016

I'll see if it's an easy fix.

import pandas as pd
import numpy as np

FLOAT_TYPES = list(np.typecodes['AllFloat'])

df = pd.util.testing.makeDataFrame()
df.select_dtypes(FLOAT_TYPES)

FLOAT_TYPES.remove('e')
df.select_dtypes(FLOAT_TYPES)
@jseabold
Copy link
Contributor Author

jseabold commented Jan 7, 2016

Oh getattr(np, dtype) doesn't work for e, obviously.

@jseabold
Copy link
Contributor Author

jseabold commented Jan 7, 2016

I'm not sure what is handled by getattr(np, dtype) that isn't handled by np.dtype(dtype), actually.

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions labels Jan 7, 2016
@jreback jreback added this to the Next Major Release milestone Jan 7, 2016
@jreback
Copy link
Contributor

jreback commented Jan 7, 2016

have you had other issues with float16 btw? its not support for some of the numeric ops (and will get upcast). what are you doing with it?

@jreback
Copy link
Contributor

jreback commented Jan 7, 2016

xref #9220, #10382

@jreback jreback modified the milestones: 0.18.0, Next Major Release Jan 7, 2016
@jseabold
Copy link
Contributor Author

jseabold commented Jan 7, 2016

I'm not doing anything with float16. I was just lazily trying to differentiate between numeric, integer, and object types to do e.g. continuous vs categorical data handling without more specific types than numpy primitives, and I noticed this.

jseabold added a commit to jseabold/pandas that referenced this issue Jan 12, 2016
TST: Failing test for numpy typecode select

BUG: Let numpy typecodes pass through.

DOC: Document bug fix

STY: Formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

No branches or pull requests

2 participants