Skip to content

Commit c0bf1d7

Browse files
committed
Remove number of deprecated parameters/functions/classes [fix #6641]
1 parent 7c073c4 commit c0bf1d7

File tree

12 files changed

+134
-239
lines changed

12 files changed

+134
-239
lines changed

doc/source/release.rst

+22
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,28 @@ Prior Version Deprecations/Changes
180180

181181
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
182182

183+
- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)
184+
185+
- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
186+
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
187+
encode in unicode by default (:issue:`6641`)
188+
189+
- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
190+
:meth:`DataFrame.to_string` (:issue:`6641`)
191+
192+
- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)
193+
194+
- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)
195+
196+
- Remove ``name`` keyword from :func:`get_data_yahoo` and
197+
:func:`get_data_google` (:issue:`6641`)
198+
199+
- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
200+
(:issue:`6641`)
201+
202+
- Remove ``time_rule`` from several rolling-moment statistical functions, such
203+
as :func:`rolling_sum` (:issue:`6641`)
204+
183205
Experimental Features
184206
~~~~~~~~~~~~~~~~~~~~~
185207

doc/source/v0.14.0.txt

+23
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,29 @@ Therse are prior version deprecations that are taking effect as of 0.14.0.
328328

329329
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
330330

331+
- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)
332+
333+
- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
334+
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
335+
encode in unicode by default (:issue:`6641`)
336+
337+
- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
338+
:meth:`DataFrame.to_string` (:issue:`6641`)
339+
340+
- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)
341+
342+
- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)
343+
344+
- Remove ``name`` keyword from :func:`get_data_yahoo` and
345+
:func:`get_data_google` (:issue:`6641`)
346+
347+
- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
348+
(:issue:`6641`)
349+
350+
- Remove ``time_rule`` from several rolling-moment statistical functions, such
351+
as :func:`rolling_sum` (:issue:`6641`)
352+
353+
331354
Deprecations
332355
~~~~~~~~~~~~
333356

pandas/core/format.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,10 @@ def _to_str_columns(self):
358358

359359
return strcols
360360

361-
def to_string(self, force_unicode=None):
361+
def to_string(self):
362362
"""
363363
Render a DataFrame to a console-friendly tabular output.
364364
"""
365-
import warnings
366-
if force_unicode is not None: # pragma: no cover
367-
warnings.warn(
368-
"force_unicode is deprecated, it will have no effect",
369-
FutureWarning)
370365

371366
frame = self.frame
372367

@@ -423,8 +418,7 @@ def _join_multiline(self, *strcols):
423418
st = ed
424419
return '\n\n'.join(str_lst)
425420

426-
def to_latex(self, force_unicode=None, column_format=None,
427-
longtable=False):
421+
def to_latex(self, column_format=None, longtable=False):
428422
"""
429423
Render a DataFrame to a LaTeX tabular/longtable environment output.
430424
"""
@@ -435,12 +429,6 @@ def get_col_type(dtype):
435429
else:
436430
return 'l'
437431

438-
import warnings
439-
if force_unicode is not None: # pragma: no cover
440-
warnings.warn(
441-
"force_unicode is deprecated, it will have no effect",
442-
FutureWarning)
443-
444432
frame = self.frame
445433

446434
if len(frame.columns) == 0 or len(frame.index) == 0:
@@ -2139,19 +2127,14 @@ def __call__(self, num):
21392127
return formatted # .strip()
21402128

21412129

2142-
def set_eng_float_format(precision=None, accuracy=3, use_eng_prefix=False):
2130+
def set_eng_float_format(accuracy=3, use_eng_prefix=False):
21432131
"""
21442132
Alter default behavior on how float is formatted in DataFrame.
21452133
Format float in engineering format. By accuracy, we mean the number of
21462134
decimal digits after the floating point.
21472135
21482136
See also EngFormatter.
21492137
"""
2150-
if precision is not None: # pragma: no cover
2151-
import warnings
2152-
warnings.warn("'precision' parameter in set_eng_float_format is "
2153-
"being renamed to 'accuracy'", FutureWarning)
2154-
accuracy = precision
21552138

21562139
set_option("display.float_format", EngFormatter(accuracy, use_eng_prefix))
21572140
set_option("display.column_space", max(12, accuracy + 9))

pandas/core/frame.py

+6-28
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def to_panel(self):
10711071
@deprecate_kwarg(old_arg_name='cols', new_arg_name='columns')
10721072
def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
10731073
columns=None, header=True, index=True, index_label=None,
1074-
mode='w', nanRep=None, encoding=None, quoting=None,
1074+
mode='w', encoding=None, quoting=None,
10751075
quotechar='"', line_terminator='\n', chunksize=None,
10761076
tupleize_cols=False, date_format=None, doublequote=True,
10771077
escapechar=None, **kwds):
@@ -1128,10 +1128,6 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
11281128
Format string for datetime objects
11291129
cols : kwarg only alias of columns [deprecated]
11301130
"""
1131-
if nanRep is not None: # pragma: no cover
1132-
warnings.warn("nanRep is deprecated, use na_rep",
1133-
FutureWarning)
1134-
na_rep = nanRep
11351131

11361132
formatter = fmt.CSVFormatter(self, path_or_buf,
11371133
line_terminator=line_terminator,
@@ -1275,21 +1271,12 @@ def to_stata(
12751271
@Appender(fmt.docstring_to_string, indents=1)
12761272
def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
12771273
header=True, index=True, na_rep='NaN', formatters=None,
1278-
float_format=None, sparsify=None, nanRep=None,
1279-
index_names=True, justify=None, force_unicode=None,
1280-
line_width=None, max_rows=None, max_cols=None,
1274+
float_format=None, sparsify=None, index_names=True,
1275+
justify=None, line_width=None, max_rows=None, max_cols=None,
12811276
show_dimensions=False):
12821277
"""
12831278
Render a DataFrame to a console-friendly tabular output.
12841279
"""
1285-
if force_unicode is not None: # pragma: no cover
1286-
warnings.warn("force_unicode is deprecated, it will have no "
1287-
"effect", FutureWarning)
1288-
1289-
if nanRep is not None: # pragma: no cover
1290-
warnings.warn("nanRep is deprecated, use na_rep",
1291-
FutureWarning)
1292-
na_rep = nanRep
12931280

12941281
if colSpace is not None: # pragma: no cover
12951282
warnings.warn("colSpace is deprecated, use col_space",
@@ -1318,9 +1305,8 @@ def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
13181305
def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13191306
header=True, index=True, na_rep='NaN', formatters=None,
13201307
float_format=None, sparsify=None, index_names=True,
1321-
justify=None, force_unicode=None, bold_rows=True,
1322-
classes=None, escape=True, max_rows=None, max_cols=None,
1323-
show_dimensions=False):
1308+
justify=None, bold_rows=True, classes=None, escape=True,
1309+
max_rows=None, max_cols=None, show_dimensions=False):
13241310
"""
13251311
Render a DataFrame as an HTML table.
13261312
@@ -1341,10 +1327,6 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13411327
13421328
"""
13431329

1344-
if force_unicode is not None: # pragma: no cover
1345-
warnings.warn("force_unicode is deprecated, it will have no "
1346-
"effect", FutureWarning)
1347-
13481330
if colSpace is not None: # pragma: no cover
13491331
warnings.warn("colSpace is deprecated, use col_space",
13501332
FutureWarning)
@@ -1372,7 +1354,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13721354
def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
13731355
header=True, index=True, na_rep='NaN', formatters=None,
13741356
float_format=None, sparsify=None, index_names=True,
1375-
bold_rows=True, force_unicode=None, longtable=False):
1357+
bold_rows=True, longtable=False):
13761358
"""
13771359
Render a DataFrame to a tabular environment table. You can splice
13781360
this into a LaTeX document. Requires \\usepackage(booktabs}.
@@ -1387,10 +1369,6 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
13871369
13881370
"""
13891371

1390-
if force_unicode is not None: # pragma: no cover
1391-
warnings.warn("force_unicode is deprecated, it will have no "
1392-
"effect", FutureWarning)
1393-
13941372
if colSpace is not None: # pragma: no cover
13951373
warnings.warn("colSpace is deprecated, use col_space",
13961374
FutureWarning)

pandas/core/series.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def _repr_footer(self):
881881
str(self.dtype.name))
882882

883883
def to_string(self, buf=None, na_rep='NaN', float_format=None,
884-
nanRep=None, length=False, dtype=False, name=False):
884+
length=False, dtype=False, name=False):
885885
"""
886886
Render a string representation of the Series
887887
@@ -906,10 +906,6 @@ def to_string(self, buf=None, na_rep='NaN', float_format=None,
906906
formatted : string (if not buffer passed)
907907
"""
908908

909-
if nanRep is not None: # pragma: no cover
910-
warnings.warn("nanRep is deprecated, use na_rep", FutureWarning)
911-
na_rep = nanRep
912-
913909
the_repr = self._get_repr(float_format=float_format, na_rep=na_rep,
914910
length=length, dtype=dtype, name=name)
915911

pandas/io/data.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,7 @@ def _dl_mult_symbols(symbols, start, end, chunksize, retry_count, pause,
338338

339339

340340
def _get_data_from(symbols, start, end, retry_count, pause, adjust_price,
341-
ret_index, chunksize, source, name):
342-
if name is not None:
343-
warnings.warn("Arg 'name' is deprecated, please use 'symbols' "
344-
"instead.", FutureWarning)
345-
symbols = name
341+
ret_index, chunksize, source):
346342

347343
src_fn = _source_functions[source]
348344

@@ -367,7 +363,7 @@ def _get_data_from(symbols, start, end, retry_count, pause, adjust_price,
367363

368364
def get_data_yahoo(symbols=None, start=None, end=None, retry_count=3,
369365
pause=0.001, adjust_price=False, ret_index=False,
370-
chunksize=25, name=None):
366+
chunksize=25):
371367
"""
372368
Returns DataFrame/Panel of historical stock prices from symbols, over date
373369
range, start to end. To avoid being penalized by Yahoo! Finance servers,
@@ -402,12 +398,12 @@ def get_data_yahoo(symbols=None, start=None, end=None, retry_count=3,
402398
hist_data : DataFrame (str) or Panel (array-like object, DataFrame)
403399
"""
404400
return _get_data_from(symbols, start, end, retry_count, pause,
405-
adjust_price, ret_index, chunksize, 'yahoo', name)
401+
adjust_price, ret_index, chunksize, 'yahoo')
406402

407403

408404
def get_data_google(symbols=None, start=None, end=None, retry_count=3,
409405
pause=0.001, adjust_price=False, ret_index=False,
410-
chunksize=25, name=None):
406+
chunksize=25):
411407
"""
412408
Returns DataFrame/Panel of historical stock prices from symbols, over date
413409
range, start to end. To avoid being penalized by Google Finance servers,
@@ -436,7 +432,7 @@ def get_data_google(symbols=None, start=None, end=None, retry_count=3,
436432
hist_data : DataFrame (str) or Panel (array-like object, DataFrame)
437433
"""
438434
return _get_data_from(symbols, start, end, retry_count, pause,
439-
adjust_price, ret_index, chunksize, 'google', name)
435+
adjust_price, ret_index, chunksize, 'google')
440436

441437

442438
_FRED_URL = "http://research.stlouisfed.org/fred2/series/"

pandas/io/pytables.py

-7
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,6 @@ def select_as_coordinates(
685685
return self.get_storer(key).read_coordinates(where=where, start=start,
686686
stop=stop, **kwargs)
687687

688-
def unique(self, key, column, **kwargs):
689-
warnings.warn("unique(key,column) is deprecated\n"
690-
"use select_column(key,column).unique() instead",
691-
FutureWarning)
692-
return self.get_storer(key).read_column(column=column,
693-
**kwargs).unique()
694-
695688
def select_column(self, key, column, **kwargs):
696689
"""
697690
return a single column from the table. This is generally only useful to

0 commit comments

Comments
 (0)