Skip to content

CLN: organize MultiIndex indexing tests #31863

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 18 commits into from
Feb 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1c8db6e
implement test_take
jbrockmendel Feb 4, 2020
54ec01a
move test_take, organize tests
jbrockmendel Feb 5, 2020
7470a03
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 5, 2020
6fd4bbe
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 5, 2020
9949d10
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 5, 2020
b40d8e8
cleanup
jbrockmendel Feb 5, 2020
ffa6839
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 6, 2020
7a94b35
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 9, 2020
66364a9
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 10, 2020
e32a48b
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 10, 2020
5155557
remove unused imports
jbrockmendel Feb 11, 2020
41ff6ea
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 11, 2020
ce34fff
isort fixup
jbrockmendel Feb 11, 2020
5dbb123
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 11, 2020
59400a0
typo fixup
jbrockmendel Feb 11, 2020
e066cec
post-merge adjust
jbrockmendel Feb 15, 2020
a50389c
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 16, 2020
a907815
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Feb 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,25 @@ def __len__(self):
return TestNonDictMapping


def _gen_mi():
# a MultiIndex used to test the general functionality of this object

# See Also: tests.multi.conftest.idx
major_axis = Index(["foo", "bar", "baz", "qux"])
minor_axis = Index(["one", "two"])

major_codes = np.array([0, 0, 1, 2, 3, 3])
minor_codes = np.array([0, 1, 0, 1, 0, 1])
index_names = ["first", "second"]
mi = MultiIndex(
levels=[major_axis, minor_axis],
codes=[major_codes, minor_codes],
names=index_names,
verify_integrity=False,
)
return mi


indices_dict = {
"unicode": tm.makeUnicodeIndex(100),
"string": tm.makeStringIndex(100),
Expand All @@ -972,6 +991,7 @@ def __len__(self):
"interval": tm.makeIntervalIndex(100),
"empty": Index([]),
"tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3])),
"multi": _gen_mi(),
"repeats": Index([0, 0, 1, 1, 2, 2]),
}

Expand Down
Loading