Skip to content

Commit 2bbc3fd

Browse files
refactoring of tests/indexes/conftest.py
1 parent 589ae3b commit 2bbc3fd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/tests/indexes/conftest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ def zero(request):
5353
return request.param
5454

5555

56+
def _create_series(index):
57+
""" Helper for the _series dict """
58+
data = np.random.randn(len(index))
59+
return pd.Series(data, index=index, name=index.name)
60+
61+
5662
_series = {
57-
f"series-with-{i_id}-index": pd.Series(
58-
np.random.randn(len(i)), index=i, name=i.name
59-
)
60-
for i_id, i in indices_dict.items()
63+
f"series-with-{i_id}-index": _create_series(i) for i_id, i in indices_dict.items()
6164
}
6265

6366

0 commit comments

Comments
 (0)