Skip to content

Commit fc0c726

Browse files
committed
Reorganized categorical tests
1 parent 13611a6 commit fc0c726

31 files changed

+2485
-2521
lines changed

pandas/tests/categorical/common.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# -*- coding: utf-8 -*-
22

3-
import numpy as np
4-
5-
import pandas as pd
6-
from pandas import Categorical, DataFrame
3+
from pandas import Categorical
74

85

96
class TestCategorical(object):
107

118
def setup_method(self, method):
129
self.factor = Categorical(['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c'],
1310
ordered=True)
14-
15-
16-
class TestCategoricalBlock(object):
17-
18-
def setup_method(self, method):
19-
self.factor = Categorical(['a', 'b', 'b', 'a', 'a', 'c', 'c', 'c'])
20-
21-
df = DataFrame({'value': np.random.randint(0, 10000, 100)})
22-
labels = ["{0} - {1}".format(i, i + 499) for i in range(0, 10000, 500)]
23-
cat_labels = Categorical(labels, labels)
24-
25-
df = df.sort_values(by=['value'], ascending=True)
26-
df['value_group'] = pd.cut(df.value, range(0, 10500, 500),
27-
right=False, labels=cat_labels)
28-
self.cat = df

0 commit comments

Comments
 (0)