-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: Add list of tuples pd.factorize test #18649
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
TST: Add list of tuples pd.factorize test #18649
Conversation
pandas/tests/test_algos.py
Outdated
np.array(expected_label)) | ||
|
||
expected_level_array = np.empty(len(expected_level), dtype=object) | ||
expected_level_array[:] = expected_level |
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.
You can use pandas.core.common._asarray_tuplesafe
to get a numpy array of tuples, i.e. expected_level = _asarray_tuplesafe(expected_level)
e80e8b6
to
25838d1
Compare
@jschendel Thanks! Fixed! |
25838d1
to
ed36eda
Compare
Codecov Report
@@ Coverage Diff @@
## master #18649 +/- ##
==========================================
+ Coverage 91.57% 91.58% +0.01%
==========================================
Files 153 153
Lines 51210 51234 +24
==========================================
+ Hits 46894 46922 +28
+ Misses 4316 4312 -4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18649 +/- ##
==========================================
- Coverage 91.6% 91.56% -0.05%
==========================================
Files 153 153
Lines 51272 51272
==========================================
- Hits 46969 46945 -24
- Misses 4303 4327 +24
Continue to review full report at Codecov.
|
pandas/tests/test_algos.py
Outdated
result = pd.factorize(data) | ||
|
||
tm.assert_numpy_array_equal(result[0], | ||
np.array(expected_label, dtype=np.int_)) |
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 think dtype=np.intp
should fix the failure on appveyor.
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.
Ah...! Thanks @jschendel!
ed36eda
to
85063b8
Compare
thanks @Licht-T |
git diff upstream/master -u -- "*.py" | flake8 --diff