-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Let _get_dtype accept Categoricals and CategoricalIndex #16887
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,16 +532,16 @@ def test_is_complex_dtype(): | |
(float, np.dtype(float)), | ||
('float64', np.dtype('float64')), | ||
(np.dtype('float64'), np.dtype('float64')), | ||
pytest.mark.xfail((str, np.dtype('<U')), ), | ||
(str, np.dtype(str)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what fixed this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On both my system (Windows) and at try.jupyter.org (sys.platform is 'linux'), To me it looks like a difference of how numpy is handled on different system and not a pandas issue. I therefore relax that test, to make it only check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, that looks like a py2/py3 thing. ok then. (you can maybe add a comment for that particular case) |
||
(pd.Series([1, 2], dtype=np.dtype('int16')), np.dtype('int16')), | ||
(pd.Series(['a', 'b']), np.dtype(object)), | ||
(pd.Index([1, 2]), np.dtype('int64')), | ||
(pd.Index(['a', 'b']), np.dtype(object)), | ||
('category', 'category'), | ||
(pd.Categorical(['a', 'b']).dtype, CategoricalDtype()), | ||
pytest.mark.xfail((pd.Categorical(['a', 'b']), CategoricalDtype()),), | ||
(pd.Categorical(['a', 'b']), CategoricalDtype()), | ||
(pd.CategoricalIndex(['a', 'b']).dtype, CategoricalDtype()), | ||
pytest.mark.xfail((pd.CategoricalIndex(['a', 'b']), CategoricalDtype()),), | ||
(pd.CategoricalIndex(['a', 'b']), CategoricalDtype()), | ||
(pd.DatetimeIndex([1, 2]), np.dtype('<M8[ns]')), | ||
(pd.DatetimeIndex([1, 2]).dtype, np.dtype('<M8[ns]')), | ||
('<M8[ns]', np.dtype('<M8[ns]')), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for an external note here; this is an internal function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand. Above you say
Are you thinking of a different location for the note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not this doesn't need a note at all. This is not a user relevant change as
_get_dtype
is not user facing.