Skip to content

Commit cb0dfd5

Browse files
committed
changing default to None
1 parent 2679cc8 commit cb0dfd5

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

doc/source/whatsnew/v0.23.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Deprecations
219219
- ``Series.valid`` is deprecated. Use :meth:`Series.dropna` instead (:issue:`18800`).
220220
- :func:`read_excel` has deprecated the ``skip_footer`` parameter. Use ``skipfooter`` instead (:issue:`18836`)
221221
- The ``is_copy`` attribute is deprecated and will be removed in a future version (:issue:`18801`).
222-
- 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`).
222+
- 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`).
223223

224224
.. _whatsnew_0230.prior_deprecations:
225225

pandas/core/frame.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
11871187

11881188
return cls(mgr)
11891189

1190-
def to_records(self, index=True, convert_datetime64=False):
1190+
def to_records(self, index=True, convert_datetime64=None):
11911191
"""
11921192
Convert DataFrame to record array. Index will be put in the
11931193
'index' field of the record array if requested
@@ -1196,7 +1196,7 @@ def to_records(self, index=True, convert_datetime64=False):
11961196
----------
11971197
index : boolean, default True
11981198
Include index in resulting record array, stored in 'index' field
1199-
convert_datetime64 : boolean, default False
1199+
convert_datetime64 : boolean, optional
12001200
.. deprecated:: 0.23.0
12011201
12021202
Whether to convert the index to datetime.datetime if it is a
@@ -1207,7 +1207,7 @@ def to_records(self, index=True, convert_datetime64=False):
12071207
y : recarray
12081208
"""
12091209

1210-
if convert_datetime64:
1210+
if convert_datetime64 is not None:
12111211
warnings.warn("The 'convert_datetime64' parameter is "
12121212
"deprecated and will be removed in a future "
12131213
"version",

pandas/tests/frame/test_convert_to.py

+3-2
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)