Skip to content

Commit f483d6a

Browse files
committed
ENH: GH 14627 PEP8 fixes
1 parent 4be1ffa commit f483d6a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pandas/core/reshape/tile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
189189
>>> pd.cut(array([0.1, 0.1, 0.2, 0.5, 0.5, 0.9, 1.0]),
190190
... bins="auto")
191191
... # doctest: +ELLIPSIS`
192-
[(0.0991, 0.325], (0.0991, 0.325], (0.0991, 0.325], (0.325, 0.55],
192+
[(0.0991, 0.325], (0.0991, 0.325], (0.0991, 0.325], (0.325, 0.55],
193193
(0.325, 0.55], (0.775, 1.0], (0.775, 1.0]]
194-
Categories (4, interval[float64]): [(0.0991, 0.325] < (0.325, 0.55] <
194+
Categories (4, interval[float64]): [(0.0991, 0.325] < (0.325, 0.55] <
195195
(0.55, 0.775] < (0.775, 1.0]]
196196
"""
197197
# NOTE: this binning code is changed a bit from histogram for var(x) == 0
@@ -207,7 +207,7 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
207207
if adj:
208208
adj *= 0.001 # 0.1% of the range
209209
else:
210-
adj = 0.001
210+
adj = 0.001
211211
if right:
212212
bins[0] -= adj
213213
else:

pandas/tests/reshape/test_tile.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ def test_bins(self):
4040

4141
def test_str_bins(self):
4242
data = np.array([0.1, 0.1, 0.2, 0.5, 0.5, 0.9, 1.0])
43-
result, bins_cut = cut(data, bins="auto",
44-
retbins=True)
45-
43+
result, bins_cut = cut(data, bins="auto",
44+
retbins=True)
45+
4646
bins_np = np.histogram_bin_edges(data, "auto")
4747
adj = (bins_np[-1] - bins_np[0]) * 0.001
4848
bins_np[0] -= adj
4949
tm.assert_almost_equal(bins_cut, bins_np)
50-
tm.assert_almost_equal(np.round(bins_cut, 4),
50+
tm.assert_almost_equal(np.round(bins_cut, 4),
5151
np.array([0.0991, 0.325, 0.55, 0.775, 1.0]))
52-
53-
intervals = IntervalIndex.from_breaks(np.round(bins_np, 4),
52+
53+
intervals = IntervalIndex.from_breaks(np.round(bins_np, 4),
5454
closed="right")
55-
expected = Categorical(intervals, ordered=True)
56-
tm.assert_index_equal(result.categories,
55+
expected = Categorical(intervals, ordered=True)
56+
tm.assert_index_equal(result.categories,
5757
expected.categories)
5858

5959
def test_right(self):

0 commit comments

Comments
 (0)