MRG respect dtypes in pandas dataframes if homogeneous#15094
MRG respect dtypes in pandas dataframes if homogeneous#15094jnothman merged 10 commits intoscikit-learn:masterfrom
Conversation
There was a problem hiding this comment.
Yes, might as well have a change log entry
|
Misfire |
|
EDIT: never mind. |
|
Correction: passing float16 to |
|
Ok I think I'm confused whether |
|
ok now this resolves anything pandas-related. It leaves the numpy-casting as it was, so we're still casting int32 to float64, not float32. |
|
CI failures, but I agree with your changes |
|
If |
|
It's actually basically impossible to correctly sniff out the types right now: |
|
green again yay |
| # check that we handle pandas dtypes in a semi-reasonable way | ||
| # this is actually tricky because we can't really know that this | ||
| # should be integer ahead of converting it. | ||
| assert (check_array(pd.DataFrame([pd.Categorical([1, 2, 3])])).dtype |
There was a problem hiding this comment.
For completeness, should we test for dtype=FLOAT_DTYPES as well?
There was a problem hiding this comment.
an check what? That it's float64?
There was a problem hiding this comment.
Right above this check we check that a int16 dataframe is casted to float64. It seems reasonable to test that this categorical goes to float64 as well.
|
@jnothman still good? |
…r/scikit-learn into respect_pandas_homogeneous_dtype
|
Thanks! |
Fixes #15093.
Does that deserve/need a whatsnew?