Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove number of deprecated parameters/functions/classes [fix #6641] #6813

Merged
merged 1 commit into from
Apr 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,28 @@ Prior Version Deprecations/Changes

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

- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)

- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
encode in unicode by default (:issue:`6641`)

- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
:meth:`DataFrame.to_string` (:issue:`6641`)

- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)

- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)

- Remove ``name`` keyword from :func:`get_data_yahoo` and
:func:`get_data_google` (:issue:`6641`)

- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
(:issue:`6641`)

- Remove ``time_rule`` from several rolling-moment statistical functions, such
as :func:`rolling_sum` (:issue:`6641`)

Experimental Features
~~~~~~~~~~~~~~~~~~~~~

Expand Down
23 changes: 23 additions & 0 deletions doc/source/v0.14.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,29 @@ Therse are prior version deprecations that are taking effect as of 0.14.0.

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

- Remove ``precision`` keyword from :func:`set_eng_float_format` (:issue:`6641`)

- Remove ``force_unicode`` keyword from :meth:`DataFrame.to_string`,
:meth:`DataFrame.to_latex`, and :meth:`DataFrame.to_html`; these function
encode in unicode by default (:issue:`6641`)

- Remove ``nanRep`` keyword from :meth:`DataFrame.to_csv` and
:meth:`DataFrame.to_string` (:issue:`6641`)

- Remove ``unique`` keyword from :meth:`HDFStore.select_column` (:issue:`6641`)

- Remove ``inferTimeRule`` keyword from :func:`Timestamp.offset` (:issue:`6641`)

- Remove ``name`` keyword from :func:`get_data_yahoo` and
:func:`get_data_google` (:issue:`6641`)

- Remove ``offset`` keyword from :class:`DatetimeIndex` constructor
(:issue:`6641`)

- Remove ``time_rule`` from several rolling-moment statistical functions, such
as :func:`rolling_sum` (:issue:`6641`)


Deprecations
~~~~~~~~~~~~

Expand Down
23 changes: 3 additions & 20 deletions pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,10 @@ def _to_str_columns(self):

return strcols

def to_string(self, force_unicode=None):
def to_string(self):
"""
Render a DataFrame to a console-friendly tabular output.
"""
import warnings
if force_unicode is not None: # pragma: no cover
warnings.warn(
"force_unicode is deprecated, it will have no effect",
FutureWarning)

frame = self.frame

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

def to_latex(self, force_unicode=None, column_format=None,
longtable=False):
def to_latex(self, column_format=None, longtable=False):
"""
Render a DataFrame to a LaTeX tabular/longtable environment output.
"""
Expand All @@ -435,12 +429,6 @@ def get_col_type(dtype):
else:
return 'l'

import warnings
if force_unicode is not None: # pragma: no cover
warnings.warn(
"force_unicode is deprecated, it will have no effect",
FutureWarning)

frame = self.frame

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


def set_eng_float_format(precision=None, accuracy=3, use_eng_prefix=False):
def set_eng_float_format(accuracy=3, use_eng_prefix=False):
"""
Alter default behavior on how float is formatted in DataFrame.
Format float in engineering format. By accuracy, we mean the number of
decimal digits after the floating point.

See also EngFormatter.
"""
if precision is not None: # pragma: no cover
import warnings
warnings.warn("'precision' parameter in set_eng_float_format is "
"being renamed to 'accuracy'", FutureWarning)
accuracy = precision

set_option("display.float_format", EngFormatter(accuracy, use_eng_prefix))
set_option("display.column_space", max(12, accuracy + 9))
Expand Down
34 changes: 6 additions & 28 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ def to_panel(self):
@deprecate_kwarg(old_arg_name='cols', new_arg_name='columns')
def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
columns=None, header=True, index=True, index_label=None,
mode='w', nanRep=None, encoding=None, quoting=None,
mode='w', encoding=None, quoting=None,
quotechar='"', line_terminator='\n', chunksize=None,
tupleize_cols=False, date_format=None, doublequote=True,
escapechar=None, **kwds):
Expand Down Expand Up @@ -1128,10 +1128,6 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
Format string for datetime objects
cols : kwarg only alias of columns [deprecated]
"""
if nanRep is not None: # pragma: no cover
warnings.warn("nanRep is deprecated, use na_rep",
FutureWarning)
na_rep = nanRep

formatter = fmt.CSVFormatter(self, path_or_buf,
line_terminator=line_terminator,
Expand Down Expand Up @@ -1275,21 +1271,12 @@ def to_stata(
@Appender(fmt.docstring_to_string, indents=1)
def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
header=True, index=True, na_rep='NaN', formatters=None,
float_format=None, sparsify=None, nanRep=None,
index_names=True, justify=None, force_unicode=None,
line_width=None, max_rows=None, max_cols=None,
float_format=None, sparsify=None, index_names=True,
justify=None, line_width=None, max_rows=None, max_cols=None,
show_dimensions=False):
"""
Render a DataFrame to a console-friendly tabular output.
"""
if force_unicode is not None: # pragma: no cover
warnings.warn("force_unicode is deprecated, it will have no "
"effect", FutureWarning)

if nanRep is not None: # pragma: no cover
warnings.warn("nanRep is deprecated, use na_rep",
FutureWarning)
na_rep = nanRep

if colSpace is not None: # pragma: no cover
warnings.warn("colSpace is deprecated, use col_space",
Expand Down Expand Up @@ -1318,9 +1305,8 @@ def to_string(self, buf=None, columns=None, col_space=None, colSpace=None,
def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
header=True, index=True, na_rep='NaN', formatters=None,
float_format=None, sparsify=None, index_names=True,
justify=None, force_unicode=None, bold_rows=True,
classes=None, escape=True, max_rows=None, max_cols=None,
show_dimensions=False):
justify=None, bold_rows=True, classes=None, escape=True,
max_rows=None, max_cols=None, show_dimensions=False):
"""
Render a DataFrame as an HTML table.

Expand All @@ -1341,10 +1327,6 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,

"""

if force_unicode is not None: # pragma: no cover
warnings.warn("force_unicode is deprecated, it will have no "
"effect", FutureWarning)

if colSpace is not None: # pragma: no cover
warnings.warn("colSpace is deprecated, use col_space",
FutureWarning)
Expand Down Expand Up @@ -1372,7 +1354,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,
header=True, index=True, na_rep='NaN', formatters=None,
float_format=None, sparsify=None, index_names=True,
bold_rows=True, force_unicode=None, longtable=False):
bold_rows=True, longtable=False):
"""
Render a DataFrame to a tabular environment table. You can splice
this into a LaTeX document. Requires \\usepackage(booktabs}.
Expand All @@ -1387,10 +1369,6 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None,

"""

if force_unicode is not None: # pragma: no cover
warnings.warn("force_unicode is deprecated, it will have no "
"effect", FutureWarning)

if colSpace is not None: # pragma: no cover
warnings.warn("colSpace is deprecated, use col_space",
FutureWarning)
Expand Down
6 changes: 1 addition & 5 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def _repr_footer(self):
str(self.dtype.name))

def to_string(self, buf=None, na_rep='NaN', float_format=None,
nanRep=None, length=False, dtype=False, name=False):
length=False, dtype=False, name=False):
"""
Render a string representation of the Series

Expand All @@ -906,10 +906,6 @@ def to_string(self, buf=None, na_rep='NaN', float_format=None,
formatted : string (if not buffer passed)
"""

if nanRep is not None: # pragma: no cover
warnings.warn("nanRep is deprecated, use na_rep", FutureWarning)
na_rep = nanRep

the_repr = self._get_repr(float_format=float_format, na_rep=na_rep,
length=length, dtype=dtype, name=name)

Expand Down
14 changes: 5 additions & 9 deletions pandas/io/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,7 @@ def _dl_mult_symbols(symbols, start, end, chunksize, retry_count, pause,


def _get_data_from(symbols, start, end, retry_count, pause, adjust_price,
ret_index, chunksize, source, name):
if name is not None:
warnings.warn("Arg 'name' is deprecated, please use 'symbols' "
"instead.", FutureWarning)
symbols = name
ret_index, chunksize, source):

src_fn = _source_functions[source]

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

def get_data_yahoo(symbols=None, start=None, end=None, retry_count=3,
pause=0.001, adjust_price=False, ret_index=False,
chunksize=25, name=None):
chunksize=25):
"""
Returns DataFrame/Panel of historical stock prices from symbols, over date
range, start to end. To avoid being penalized by Yahoo! Finance servers,
Expand Down Expand Up @@ -402,12 +398,12 @@ def get_data_yahoo(symbols=None, start=None, end=None, retry_count=3,
hist_data : DataFrame (str) or Panel (array-like object, DataFrame)
"""
return _get_data_from(symbols, start, end, retry_count, pause,
adjust_price, ret_index, chunksize, 'yahoo', name)
adjust_price, ret_index, chunksize, 'yahoo')


def get_data_google(symbols=None, start=None, end=None, retry_count=3,
pause=0.001, adjust_price=False, ret_index=False,
chunksize=25, name=None):
chunksize=25):
"""
Returns DataFrame/Panel of historical stock prices from symbols, over date
range, start to end. To avoid being penalized by Google Finance servers,
Expand Down Expand Up @@ -436,7 +432,7 @@ def get_data_google(symbols=None, start=None, end=None, retry_count=3,
hist_data : DataFrame (str) or Panel (array-like object, DataFrame)
"""
return _get_data_from(symbols, start, end, retry_count, pause,
adjust_price, ret_index, chunksize, 'google', name)
adjust_price, ret_index, chunksize, 'google')


_FRED_URL = "http://research.stlouisfed.org/fred2/series/"
Expand Down
7 changes: 0 additions & 7 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,6 @@ def select_as_coordinates(
return self.get_storer(key).read_coordinates(where=where, start=start,
stop=stop, **kwargs)

def unique(self, key, column, **kwargs):
warnings.warn("unique(key,column) is deprecated\n"
"use select_column(key,column).unique() instead",
FutureWarning)
return self.get_storer(key).read_column(column=column,
**kwargs).unique()

def select_column(self, key, column, **kwargs):
"""
return a single column from the table. This is generally only useful to
Expand Down
Loading