Skip to content

Commit

Permalink
changing default to None
Browse files Browse the repository at this point in the history
  • Loading branch information
reidy-p committed Dec 24, 2017
1 parent 64392aa commit 5b4bc9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Deprecations
- ``Series.valid`` is deprecated. Use :meth:`Series.dropna` instead (:issue:`18800`).
- :func:`read_excel` has deprecated the ``skip_footer`` parameter. Use ``skipfooter`` instead (:issue:`18836`)
- The ``is_copy`` attribute is deprecated and will be removed in a future version (:issue:`18801`).
- The ``convert_datetime64`` parameter in :func:`DataFrame.to_records` has been deprecated and the default value is now ``False``. The NumPy bug motivating this parameter has been resolved (:issue:`18160`).
- The ``convert_datetime64`` parameter in :func:`DataFrame.to_records` has been deprecated and will be removed in a future version. The NumPy bug motivating this parameter has been resolved (:issue:`18160`).

.. _whatsnew_0230.prior_deprecations:

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,

return cls(mgr)

def to_records(self, index=True, convert_datetime64=False):
def to_records(self, index=True, convert_datetime64=None):
"""
Convert DataFrame to record array. Index will be put in the
'index' field of the record array if requested
Expand All @@ -1196,7 +1196,7 @@ def to_records(self, index=True, convert_datetime64=False):
----------
index : boolean, default True
Include index in resulting record array, stored in 'index' field
convert_datetime64 : boolean, default False
convert_datetime64 : boolean, optional
.. deprecated:: 0.23.0
Whether to convert the index to datetime.datetime if it is a
Expand All @@ -1207,7 +1207,7 @@ def to_records(self, index=True, convert_datetime64=False):
y : recarray
"""

if convert_datetime64:
if convert_datetime64 is not None:
warnings.warn("The 'convert_datetime64' parameter is "
"deprecated and will be removed in a future "
"version",
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/frame/test_convert_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def test_to_records_dt64(self):
result = df.to_records(convert_datetime64=True)['index'][0]
assert expected == result

rs = df.to_records(convert_datetime64=False)
assert rs['index'][0] == df.index.values[0]
with tm.assert_produces_warning(FutureWarning):
rs = df.to_records(convert_datetime64=False)
assert rs['index'][0] == df.index.values[0]

def test_to_records_with_multindex(self):
# GH3189
Expand Down

0 comments on commit 5b4bc9c

Please sign in to comment.