Skip to content

Commit badb5be

Browse files
committed
compat, revert
1 parent 911a2da commit badb5be

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pandas/compat/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def get_range_parameters(data):
116116
reduce = functools.reduce
117117
long = int
118118
unichr = chr
119+
import reprlib
119120

120121
# This was introduced in Python 3.3, but we don't support
121122
# Python 3.x < 3.5, so checking PY3 is safe.
@@ -271,6 +272,7 @@ class to receive bound method
271272
class_types = type,
272273
text_type = str
273274
binary_type = bytes
275+
import reprlib
274276

275277
def u(s):
276278
return s
@@ -323,6 +325,7 @@ def set_function_name(f, name, cls):
323325
class_types = (type, types.ClassType)
324326
text_type = unicode
325327
binary_type = str
328+
import repr as reprlib
326329

327330
def u(s):
328331
return unicode(s, "unicode_escape")

pandas/core/arrays/categorical.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# pylint: disable=E1101,W0232
22

3-
import reprlib
43
import textwrap
54
from warnings import warn
65

@@ -1935,7 +1934,8 @@ def where(self, cond, other):
19351934
elif is_categorical_dtype(other):
19361935
if not is_dtype_equal(self, other):
19371936
extra = list(other.categories.difference(self.categories))
1938-
warn(object_msg.format(reprlib.repr(extra)), FutureWarning,
1937+
warn(object_msg.format(compat.reprlib.repr(extra)),
1938+
FutureWarning,
19391939
stacklevel=2)
19401940
return np.where(cond, self, other)
19411941
other = _get_codes_for_values(other, self.categories)

pandas/tests/extension/test_sparse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
def make_data(fill_value):
1212
if np.isnan(fill_value):
13-
data = np.random.uniform(size=100).astype('float64')
13+
data = np.random.uniform(size=100)
1414
else:
15-
data = np.random.randint(1, 100, size=100, dtype='int64')
15+
data = np.random.randint(1, 100, size=100)
1616
if data[0] == data[1]:
1717
data[0] += 1
1818

0 commit comments

Comments
 (0)