Skip to content

Commit

Permalink
Fixed some documentation/formatting issues, clarified the purpose of …
Browse files Browse the repository at this point in the history
…the test case.
  • Loading branch information
thequackdaddy committed Jun 29, 2017
1 parent 257edec commit 1460563
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ run this slightly modified command::

git diff master --name-only -- '*.py' | grep 'pandas/' | xargs flake8

Note that on Windows, `grep`, `xargs`, and other tools are likely unavailable.
However, this has been shown to work on smaller commits::
Note that on Windows, ``grep``, ``xargs``, and other tools are likely
unavailable. However, this has been shown to work on smaller commits in the
standard Windows command line::

git diff master -u -- "*.py" | flake8 --diff

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.20.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Indexing
^^^^^^^^

- Bug in ``Float64Index`` causing an empty array instead of ``None`` to be returned from ``.get(np.nan)`` on a Series whose index did not contain any ``NaN`` s (:issue:`8569`)
- Fixed a bug that prevented joining on a categorical MultiIndex (:issue:`16627`).

I/O
^^^
Expand Down Expand Up @@ -79,6 +78,7 @@ Sparse
Reshaping
^^^^^^^^^

- Bug in joining on a ``MultiIndex`` with a ``category`` dtype for a level (:issue:`16627`).


Numeric
Expand Down
21 changes: 11 additions & 10 deletions pandas/tests/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,13 @@ def test_merge_join_categorical_multiindex():
'Factor': [1.1, 1.2, 1.3, 1.4, 1.5, 1.6]}
b = DataFrame(b).set_index(['Cat', 'Int'])['Factor']

c = merge(a, b.reset_index(), left_on=['Cat1', 'Int1'],
right_on=['Cat', 'Int'], how='left')
d = a.join(b, on=['Cat1', 'Int1'])
c = c.drop(['Cat', 'Int'], axis=1)
assert_frame_equal(c, d)
expected = merge(a, b.reset_index(), left_on=['Cat1', 'Int1'],
right_on=['Cat', 'Int'], how='left')
result = a.join(b, on=['Cat1', 'Int1'])
expected = expected.drop(['Cat', 'Int'], axis=1)
assert_frame_equal(expected, result)

# Same test, but with ordered categorical
a = {'Cat1': Categorical(['a', 'b', 'a', 'c', 'a', 'b'],
['b', 'a', 'c'],
ordered=True),
Expand All @@ -226,8 +227,8 @@ def test_merge_join_categorical_multiindex():
'Factor': [1.1, 1.2, 1.3, 1.4, 1.5, 1.6]}
b = DataFrame(b).set_index(['Cat', 'Int'])['Factor']

c = merge(a, b.reset_index(), left_on=['Cat1', 'Int1'],
right_on=['Cat', 'Int'], how='left')
d = a.join(b, on=['Cat1', 'Int1'])
c = c.drop(['Cat', 'Int'], axis=1)
assert_frame_equal(c, d)
expected = merge(a, b.reset_index(), left_on=['Cat1', 'Int1'],
right_on=['Cat', 'Int'], how='left')
result = a.join(b, on=['Cat1', 'Int1'])
expected = expected.drop(['Cat', 'Int'], axis=1)
assert_frame_equal(expected, result)

0 comments on commit 1460563

Please sign in to comment.