Skip to content

Commit df895ef

Browse files
committed
Merge pull request #7204 from jreback/depr_clean
CLN: eliminate depr warnings on 3.4
2 parents 7e45b34 + 4d191e2 commit df895ef

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

pandas/core/format.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def _to_str_columns(self):
366366
*(_strlen(x) for x in cheader))
367367

368368
fmt_values = self._format_col(i)
369-
369+
370370
fmt_values = _make_fixed_width(fmt_values, self.justify,
371371
minimum=max_colwidth)
372372

@@ -400,7 +400,7 @@ def _to_str_columns(self):
400400
col_num = self.tr_col_num
401401
col_width = len(strcols[col_num][0]) # infer from column header
402402
strcols.insert(col_num + 1, ['...'.center(col_width)] * (len(str_index)))
403-
if truncate_v:
403+
if truncate_v:
404404
n_header_rows = len(str_index) - len(frame)
405405
row_num = self.tr_row_num
406406
for ix,col in enumerate(strcols):
@@ -843,10 +843,10 @@ def _column_header():
843843
if self.fmt.sparsify and lnum == 0:
844844
ins_col = row_levels + self.fmt.tr_col_num - 1
845845
row.insert(ins_col, '...')
846-
846+
847847
for tag in list(tags.keys()):
848848
if tag >= ins_col:
849-
tags[tag+1] = tags.pop(tag)
849+
tags[tag+1] = tags.pop(tag)
850850
else:
851851
row.insert(row_levels + self.fmt.tr_col_num, '...')
852852

@@ -911,12 +911,12 @@ def _write_regular_rows(self, fmt_values, indent):
911911
index_values = self.fmt.tr_frame.index.format()
912912

913913
for i in range(nrows):
914-
914+
915915
if truncate_v and i == (self.fmt.tr_row_num):
916916
str_sep_row = [ '...' for ele in row ]
917917
self.write_tr(str_sep_row, indent, self.indent_delta, tags=None,
918918
nindex_levels=1)
919-
919+
920920
row = []
921921
row.append(index_values[i])
922922
row.extend(fmt_values[j][i] for j in range(ncols))
@@ -1101,7 +1101,7 @@ def __init__(self, obj, path_or_buf=None, sep=",", na_rep='', float_format=None,
11011101

11021102
if chunksize is None:
11031103
chunksize = (100000 / (len(self.cols) or 1)) or 1
1104-
self.chunksize = chunksize
1104+
self.chunksize = int(chunksize)
11051105

11061106
self.data_index = obj.index
11071107
if isinstance(obj.index, PeriodIndex):

pandas/tools/plotting.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def f(x):
506506
ax.plot(x, y, color=colors[kls], label=label, **kwds)
507507
else:
508508
ax.plot(x, y, color=colors[kls], **kwds)
509-
509+
510510
ax.legend(loc='upper right')
511511
ax.grid()
512512
return ax
@@ -754,7 +754,7 @@ class MPLPlot(object):
754754
"""
755755
_default_rot = 0
756756

757-
_pop_attributes = ['label', 'style', 'logy', 'logx', 'loglog',
757+
_pop_attributes = ['label', 'style', 'logy', 'logx', 'loglog',
758758
'mark_right']
759759
_attr_defaults = {'logy': False, 'logx': False, 'loglog': False,
760760
'mark_right': True}
@@ -1002,8 +1002,8 @@ def _add_table(self):
10021002
data = self.data
10031003
data = data.transpose()
10041004
else:
1005-
data = self.table
1006-
ax = self._get_ax(0)
1005+
data = self.table
1006+
ax = self._get_ax(0)
10071007
table(ax, data)
10081008

10091009
def _post_plot_logic(self):
@@ -1545,7 +1545,7 @@ def _is_ts_plot(self):
15451545
def _make_plot(self):
15461546
self._pos_prior = np.zeros(len(self.data))
15471547
self._neg_prior = np.zeros(len(self.data))
1548-
1548+
15491549
if self._is_ts_plot():
15501550
data = self._maybe_convert_index(self.data)
15511551
self._make_ts_plot(data)
@@ -1565,7 +1565,7 @@ def _make_plot(self):
15651565

15661566
errors = self._get_errorbars(label=label, index=i)
15671567
kwds = dict(kwds, **errors)
1568-
1568+
15691569
label = com.pprint_thing(label) # .encode('utf-8')
15701570
kwds['label'] = label
15711571

@@ -1613,7 +1613,7 @@ def _get_stacked_values(self, y, label):
16131613
def _get_ts_plot_function(self):
16141614
from pandas.tseries.plotting import tsplot
16151615
plotf = self._get_plot_function()
1616-
1616+
16171617
def _plot(data, ax, label, style, **kwds):
16181618
# errorbar function does not support style argument
16191619
if plotf.__name__ == 'errorbar':
@@ -1722,7 +1722,7 @@ def _get_plot_function(self):
17221722
raise ValueError("Log-y scales are not supported in area plot")
17231723
else:
17241724
f = LinePlot._get_plot_function(self)
1725-
1725+
17261726
def plotf(*args, **kwds):
17271727
lines = f(*args, **kwds)
17281728

@@ -1746,12 +1746,12 @@ def plotf(*args, **kwds):
17461746

17471747
self.plt.Axes.fill_between(*args, **kwds)
17481748
return lines
1749-
1749+
17501750
return plotf
17511751

17521752
def _add_legend_handle(self, handle, label, index=None):
17531753
from matplotlib.patches import Rectangle
1754-
# Because fill_between isn't supported in legend,
1754+
# Because fill_between isn't supported in legend,
17551755
# specifically add Rectangle handle here
17561756
alpha = self.kwds.get('alpha', 0.5)
17571757
handle = Rectangle((0, 0), 1, 1, fc=handle.get_color(), alpha=alpha)
@@ -1766,14 +1766,14 @@ def _post_plot_logic(self):
17661766
if self.xlim is None:
17671767
for ax in self.axes:
17681768
ax.set_xlim(0, len(self.data)-1)
1769-
1769+
17701770
if self.ylim is None:
17711771
if (self.data >= 0).all().all():
17721772
for ax in self.axes:
17731773
ax.set_ylim(0, None)
17741774
elif (self.data <= 0).all().all():
17751775
for ax in self.axes:
1776-
ax.set_ylim(None, 0)
1776+
ax.set_ylim(None, 0)
17771777

17781778

17791779
class BarPlot(MPLPlot):
@@ -1923,7 +1923,7 @@ def _args_adjust(self):
19231923
self.logy = False
19241924
self.logx = False
19251925
self.loglog = False
1926-
1926+
19271927
def _get_layout(self):
19281928
from pandas import DataFrame
19291929
if isinstance(self.data, DataFrame):
@@ -1982,8 +1982,8 @@ class HistPlot(MPLPlot):
19821982
_series_kinds = ['pie']
19831983
_all_kinds = _common_kinds + _dataframe_kinds + _series_kinds
19841984

1985-
_plot_klass = {'line': LinePlot, 'bar': BarPlot, 'barh': BarPlot,
1986-
'kde': KdePlot,
1985+
_plot_klass = {'line': LinePlot, 'bar': BarPlot, 'barh': BarPlot,
1986+
'kde': KdePlot,
19871987
'scatter': ScatterPlot, 'hexbin': HexBinPlot,
19881988
'area': AreaPlot, 'pie': PiePlot}
19891989

@@ -2101,7 +2101,7 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
21012101
elif kind in _series_kinds:
21022102
if y is None and subplots is False:
21032103
msg = "{0} requires either y column or 'subplots=True'"
2104-
raise ValueError(msg.format(kind))
2104+
raise ValueError(msg.format(kind))
21052105
elif y is not None:
21062106
if com.is_integer(y) and not frame.columns.holds_integer():
21072107
y = frame.columns[y]
@@ -2113,8 +2113,8 @@ def plot_frame(frame=None, x=None, y=None, subplots=False, sharex=True,
21132113
fontsize=fontsize, use_index=use_index, sharex=sharex,
21142114
sharey=sharey, xticks=xticks, yticks=yticks,
21152115
xlim=xlim, ylim=ylim, title=title, grid=grid,
2116-
figsize=figsize,
2117-
sort_columns=sort_columns,
2116+
figsize=figsize,
2117+
sort_columns=sort_columns,
21182118
**kwds)
21192119
else:
21202120
if x is not None:
@@ -2504,7 +2504,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
25042504
The size of the figure to create in inches by default
25052505
layout: (optional) a tuple (rows, columns) for the layout of the histograms
25062506
bins: integer, default 10
2507-
Number of histogram bins to be used
2507+
Number of histogram bins to be used
25082508
kwds : other plotting keyword arguments
25092509
To be passed to hist function
25102510
"""
@@ -2538,7 +2538,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
25382538
sharex=sharex, sharey=sharey, figsize=figsize)
25392539

25402540
for i, col in enumerate(com._try_sort(data.columns)):
2541-
ax = axes[i / ncols, i % ncols]
2541+
ax = axes[i // ncols, i % ncols]
25422542
ax.xaxis.set_visible(True)
25432543
ax.yaxis.set_visible(True)
25442544
ax.hist(data[col].dropna().values, bins=bins, **kwds)
@@ -2583,7 +2583,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
25832583
figsize : tuple, default None
25842584
figure size in inches by default
25852585
bins: integer, default 10
2586-
Number of histogram bins to be used
2586+
Number of histogram bins to be used
25872587
kwds : keywords
25882588
To be passed to the actual plotting function
25892589
@@ -3046,7 +3046,7 @@ def on_right(i):
30463046
if naxes != nplots:
30473047
for ax in axarr[naxes:]:
30483048
ax.set_visible(False)
3049-
3049+
30503050
if squeeze:
30513051
# Reshape the array to have the final desired dimension (nrow,ncol),
30523052
# though discarding unneeded dimensions that equal 1. If we only have

0 commit comments

Comments
 (0)