Skip to content

Commit 147bf04

Browse files
committed
Merge branch 'fix6641_pr' of https://github.com/jsexauer/pandas into jsexauer-fix6641_pr
Conflicts: doc/source/v0.14.0.txt
2 parents 61ea0a3 + c0bf1d7 commit 147bf04

File tree

12 files changed

+138
-241
lines changed

12 files changed

+138
-241
lines changed

doc/source/release.rst

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

196196
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
197197

198+
- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)
199+
200+
- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
201+
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
202+
encode in unicode by default (:issue:`6641`)
203+
204+
- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
205+
:meth:`DataFrame.to_string` (:issue:`6641`)
206+
207+
- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)
208+
209+
- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)
210+
211+
- Remove ``name`` keyword from :func:`get_data_yahoo` and
212+
:func:`get_data_google` (:issue:`6641`)
213+
214+
- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
215+
(:issue:`6641`)
216+
217+
- Remove ``time_rule`` from several rolling-moment statistical functions, such
218+
as :func:`rolling_sum` (:issue:`6641`)
219+
198220
Experimental Features
199221
~~~~~~~~~~~~~~~~~~~~~
200222

doc/source/v0.14.0.txt

+27-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ users upgrade to this version.
2121

2222
- :ref:`API Changes <whatsnew_0140.api>`
2323

24+
- :ref:`Prior Deprecations <whatsnew_0140.prior_deprecations>`
25+
2426
- :ref:`Deprecations <whatsnew_0140.deprecations>`
2527

2628
- :ref:`Bug Fixes <release.bug_fixes-0.14.0>`
@@ -344,13 +346,37 @@ Plotting
344346

345347
Because of the default `align` value changes, coordinates of bar plots are now located on integer values (0.0, 1.0, 2.0 ...). This is intended to make bar plot be located on the same coodinates as line plot. However, bar plot may differs unexpectedly when you manually adjust the bar location or drawing area, such as using `set_xlim`, `set_ylim`, etc. In this cases, please modify your script to meet with new coordinates.
346348

349+
.. _whatsnew_0140.prior_deprecations:
350+
347351
Prior Version Deprecations/Changes
348352
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349353

350354
There are prior version deprecations that are taking effect as of 0.14.0.
351355

352356
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
353357

358+
- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)
359+
360+
- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
361+
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
362+
encode in unicode by default (:issue:`6641`)
363+
364+
- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
365+
:meth:`DataFrame.to_string` (:issue:`6641`)
366+
367+
- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)
368+
369+
- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)
370+
371+
- Remove ``name`` keyword from :func:`get_data_yahoo` and
372+
:func:`get_data_google` (:issue:`6641`)
373+
374+
- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
375+
(:issue:`6641`)
376+
377+
- Remove ``time_rule`` from several rolling-moment statistical functions, such
378+
as :func:`rolling_sum` (:issue:`6641`)
379+
354380
.. _whatsnew_0140.deprecations:
355381

356382
Deprecations
@@ -414,13 +440,12 @@ Enhancements
414440
and data_label which allow the time stamp and dataset label to be set when creating a
415441
file. (:issue:`6545`)
416442
- ``pandas.io.gbq`` now handles reading unicode strings properly. (:issue:`5940`)
417-
- Improve performance of ``CustomBusinessDay`` (:issue:`6584`)
418443
- :ref:`Holidays Calendars<timeseries.holiday>` are now available and can be used with CustomBusinessDay (:issue:`6719`)
419444

420445
Performance
421446
~~~~~~~~~~~
422447

423-
- perf improvements in DataFrame construction with certain offsets, by removing faulty caching
448+
- Improve performance of DataFrame construction with certain offsets, by removing faulty caching
424449
(e.g. MonthEnd,BusinessMonthEnd), (:issue:`6479`)
425450
- Improve performance of ``CustomBusinessDay`` (:issue:`6584`)
426451
- improve performance of slice indexing on Series with string keys (:issue:`6341`, :issue:`6372`)

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
@@ -1065,7 +1065,7 @@ def to_panel(self):
10651065
@deprecate_kwarg(old_arg_name='cols', new_arg_name='columns')
10661066
def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
10671067
columns=None, header=True, index=True, index_label=None,
1068-
mode='w', nanRep=None, encoding=None, quoting=None,
1068+
mode='w', encoding=None, quoting=None,
10691069
quotechar='"', line_terminator='\n', chunksize=None,
10701070
tupleize_cols=False, date_format=None, doublequote=True,
10711071
escapechar=None, **kwds):
@@ -1122,10 +1122,6 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
11221122
Format string for datetime objects
11231123
cols : kwarg only alias of columns [deprecated]
11241124
"""
1125-
if nanRep is not None: # pragma: no cover
1126-
warnings.warn("nanRep is deprecated, use na_rep",
1127-
FutureWarning)
1128-
na_rep = nanRep
11291125

11301126
formatter = fmt.CSVFormatter(self, path_or_buf,
11311127
line_terminator=line_terminator,
@@ -1269,21 +1265,12 @@ def to_stata(
12691265
@Appender(fmt.docstring_to_string, indents=1)
12701266
def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
12711267
header=True, index=True, na_rep='NaN', formatters=None,
1272-
float_format=None, sparsify=None, nanRep=None,
1273-
index_names=True, justify=None, force_unicode=None,
1274-
line_width=None, max_rows=None, max_cols=None,
1268+
float_format=None, sparsify=None, index_names=True,
1269+
justify=None, line_width=None, max_rows=None, max_cols=None,
12751270
show_dimensions=False):
12761271
"""
12771272
Render a DataFrame to a console-friendly tabular output.
12781273
"""
1279-
if force_unicode is not None: # pragma: no cover
1280-
warnings.warn("force_unicode is deprecated, it will have no "
1281-
"effect", FutureWarning)
1282-
1283-
if nanRep is not None: # pragma: no cover
1284-
warnings.warn("nanRep is deprecated, use na_rep",
1285-
FutureWarning)
1286-
na_rep = nanRep
12871274

12881275
if colSpace is not None: # pragma: no cover
12891276
warnings.warn("colSpace is deprecated, use col_space",
@@ -1312,9 +1299,8 @@ def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
13121299
def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13131300
header=True, index=True, na_rep='NaN', formatters=None,
13141301
float_format=None, sparsify=None, index_names=True,
1315-
justify=None, force_unicode=None, bold_rows=True,
1316-
classes=None, escape=True, max_rows=None, max_cols=None,
1317-
show_dimensions=False):
1302+
justify=None, bold_rows=True, classes=None, escape=True,
1303+
max_rows=None, max_cols=None, show_dimensions=False):
13181304
"""
13191305
Render a DataFrame as an HTML table.
13201306
@@ -1335,10 +1321,6 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13351321
13361322
"""
13371323

1338-
if force_unicode is not None: # pragma: no cover
1339-
warnings.warn("force_unicode is deprecated, it will have no "
1340-
"effect", FutureWarning)
1341-
13421324
if colSpace is not None: # pragma: no cover
13431325
warnings.warn("colSpace is deprecated, use col_space",
13441326
FutureWarning)
@@ -1366,7 +1348,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
13661348
def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
13671349
header=True, index=True, na_rep='NaN', formatters=None,
13681350
float_format=None, sparsify=None, index_names=True,
1369-
bold_rows=True, force_unicode=None, longtable=False):
1351+
bold_rows=True, longtable=False):
13701352
"""
13711353
Render a DataFrame to a tabular environment table. You can splice
13721354
this into a LaTeX document. Requires \\usepackage(booktabs}.
@@ -1381,10 +1363,6 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
13811363
13821364
"""
13831365

1384-
if force_unicode is not None: # pragma: no cover
1385-
warnings.warn("force_unicode is deprecated, it will have no "
1386-
"effect", FutureWarning)
1387-
13881366
if colSpace is not None: # pragma: no cover
13891367
warnings.warn("colSpace is deprecated, use col_space",
13901368
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
@@ -684,13 +684,6 @@ def select_as_coordinates(
684684
return self.get_storer(key).read_coordinates(where=where, start=start,
685685
stop=stop, **kwargs)
686686

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

0 commit comments

Comments
 (0)