8000 REF/TST: Add more pytest idiom to indexing/multiindex/test_getitem.py by simonjayhawkins · Pull Request #24053 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REF/TST: Add more pytest idiom to indexing/multiindex/test_getitem.py #24053

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

Merged
merged 8 commits into from
Dec 11, 2018
Prev Previous commit
Next Next commit
resolve merge conflicts
  • Loading branch information
simonjayhawkins committed Dec 10, 2018
commit d9ad11a82580b186684a7ab2bf7256f540383329
12 changes: 6 additions & 6 deletions pandas/tests/indexing/multiindex/test_getitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def test_getitem_duplicates_multiindex():

index = MultiIndex(levels=[['D', 'B', 'C'],
[0, 26, 27, 37, 57, 67, 75, 82]],
labels=[[0, 0, 0, 1, 2, 2, 2, 2, 2, 2],
[1, 3, 4, 6, 0, 2, 2, 3, 5, 7]],
codes=[[0, 0, 0, 1, 2, 2, 2, 2, 2, 2],
[1, 3, 4, 6, 0, 2, 2, 3, 5, 7]],
names=['tag', 'day'])
arr = np.random.randn(len(index), 1)
df = DataFrame(arr, index=index, columns=['val'])
Expand All @@ -83,8 +83,8 @@ def f():
# A is treated as a special Timestamp
index = MultiIndex(levels=[['A', 'B', 'C'],
[0, 26, 27, 37, 57, 67, 75, 82]],
labels=[[0, 0, 0, 1, 2, 2, 2, 2, 2, 2],
[1, 3, 4, 6, 0, 2, 2, 3, 5, 7]],
codes=[[0, 0, 0, 1, 2, 2, 2, 2, 2, 2],
[1, 3, 4, 6, 0, 2, 2, 3, 5, 7]],
names=['tag', 'day'])
df = DataFrame(arr, index=index, columns=['val'])
result = df.val['A']
Expand Down Expand Up @@ -262,8 +262,8 @@ def test_getitem_toplevel(multiindex_dataframe_random_data):

def test_getitem_int(multiindex_dataframe_random_data):
levels = [[0, 1], [0, 1, 2]]
labels = [[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]]
index = MultiIndex(levels=levels, labels=labels)
codes = [[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]]
index = MultiIndex(levels=levels, codes=codes)

frame = DataFrame(np.random.randn(6, 2), index=index)

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0