4
from pandas import DataFrame, MultiIndex
5
import pandas._testing as tm
6
from pandas.core.groupby.base import reduction_kernels, transformation_kernels
12
levels=[["foo", "bar", "baz", "qux"], ["one", "two", "three"]],
13
codes=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3], [0, 1, 2, 0, 1, 1, 2, 0, 1, 2]],
14
names=["first", "second"],
16
return DataFrame(np.random.randn(10, 3), index=index, columns=["A", "B", "C"])
23
"A": ["foo", "bar", "foo", "bar", "foo", "bar", "foo", "foo"],
24
"B": ["one", "one", "two", "three", "two", "two", "one", "three"],
25
"C": np.random.randn(8),
26
"D": np.random.randn(8),
33
return tm.makeTimeSeries()
38
return tm.getTimeSeriesData()
47
def df_mixed_floats():
50
"A": ["foo", "bar", "foo", "bar", "foo", "bar", "foo", "foo"],
51
"B": ["one", "one", "two", "three", "two", "two", "one", "three"],
52
"C": np.random.randn(8),
53
"D": np.array(np.random.randn(8), dtype="float32"),
101
"D": np.random.randn(11),
102
"E": np.random.randn(11),
103
"F": np.random.randn(11),
108
@pytest.fixture(params=sorted(reduction_kernels))
109
def reduction_func(request):
111
yields the string names of all groupby reduction functions, one at a time.
116
@pytest.fixture(params=sorted(transformation_kernels))
117
def transformation_func(request):
118
"""yields the string names of all groupby transformation functions."""
122
@pytest.fixture(params=sorted(reduction_kernels) + sorted(transformation_kernels))
123
def groupby_func(request):
124
"""yields both aggregation and transformation functions."""
128
@pytest.fixture(params=[True, False])
129
def parallel(request):
130
"""parallel keyword argument for numba.jit"""
134
@pytest.fixture(params=[True, False])
136
"""nogil keyword argument for numba.jit"""
140
@pytest.fixture(params=[True, False])
141
def nopython(request):
142
"""nopython keyword argument for numba.jit"""