Skip to content

TST/BUG: test unsortable in safe_sort and Categorical (GH13714) #13733

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
wants to merge 1 commit into from

Conversation

pijucha
Copy link
Contributor

@pijucha pijucha commented Jul 21, 2016


safe_sort always raises on a mixed int-datetime array. This is the expected behaviour. (But, for numpy >= 1.10 & python2, I still have some doubts whether it's not a manifestation of an undefined behaviour.)

- Change test for Categorical.from_array
- Add test for safe_sort
- Change 2.7 build to latest numpy
@@ -116,6 +117,19 @@ def test_mixed_integer(self):
labels = [0, 1, 2, 3, 0, -1, 1]
result, result_labels = algos.safe_sort(values, labels)
expected = np.array([0, 1, 'a', 'b'], dtype=object)
expected_labels = np.array([3, 1, 0, 2, 3, -1, 1])
tm.assert_numpy_array_equal(result, expected)
tm.assert_numpy_array_equal(result_labels, expected_labels)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated. (These three lines where lost in #13514.)

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Jul 21, 2016
@jreback jreback added this to the 0.19.0 milestone Jul 21, 2016
@jreback
Copy link
Contributor

jreback commented Jul 21, 2016

closed by 622297c

thanks!

@jreback
Copy link
Contributor

jreback commented Jul 21, 2016

FYI we have pd._np_under* properties which know about numpy versions

@jreback jreback closed this Jul 21, 2016
@pijucha pijucha deleted the unsortable13714 branch July 22, 2016 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST/BUG in test_categorical.py: test_constructor_unsortable breaks after recent commit
2 participants