Skip to content

Commit 80ef581

Browse files
committed
changing default to None
1 parent 7f1b6df commit 80ef581

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ Deprecations
740740

741741
- ``pandas.tseries.plotting.tsplot`` is deprecated. Use :func:`Series.plot` instead (:issue:`18627`)
742742
- ``Index.summary()`` is deprecated and will be removed in a future version (:issue:`18217`)
743-
- 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`).
743+
- 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`).
744744

745745
.. _whatsnew_0230.prior_deprecations:
746746

pandas/core/frame.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
12871287

12881288
return cls(mgr)
12891289

1290-
def to_records(self, index=True, convert_datetime64=False):
1290+
def to_records(self, index=True, convert_datetime64=None):
12911291
"""
12921292
Convert DataFrame to a NumPy record array.
12931293
@@ -1355,7 +1355,7 @@ def to_records(self, index=True, convert_datetime64=False):
13551355
dtype=[('index', '<M8[ns]'), ('A', '<i8'), ('B', '<f8')])
13561356
"""
13571357

1358-
if convert_datetime64:
1358+
if convert_datetime64 is not None:
13591359
warnings.warn("The 'convert_datetime64' parameter is "
13601360
"deprecated and will be removed in a future "
13611361
"version",

pandas/tests/frame/test_convert_to.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ def test_to_records_dt64(self):
8383
result = df.to_records(convert_datetime64=True)['index'][0]
8484
assert expected == result
8585

86-
rs = df.to_records(convert_datetime64=False)
87-
assert rs['index'][0] == df.index.values[0]
86+
with tm.assert_produces_warning(FutureWarning):
87+
rs = df.to_records(convert_datetime64=False)
88+
assert rs['index'][0] == df.index.values[0]
8889

8990
def test_to_records_with_multindex(self):
9091
# GH3189

0 commit comments

Comments
 (0)