Skip to content

Commit

Permalink
change default back to False
Browse files Browse the repository at this point in the history
  • Loading branch information
reidy-p committed Mar 17, 2018
1 parent e07e8f5 commit 32606c5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 181 deletions.
95 changes: 0 additions & 95 deletions hack.py

This file was deleted.

12 changes: 0 additions & 12 deletions hacking_asfreq.py

This file was deleted.

24 changes: 0 additions & 24 deletions hacking_offsetting.py

This file was deleted.

37 changes: 0 additions & 37 deletions hacking_resample.py

This file was deleted.

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

return cls(mgr)

def to_records(self, index=True, convert_datetime64=None):
def to_records(self, index=True, convert_datetime64=False):
"""
Convert DataFrame to a NumPy record array.
Expand Down Expand Up @@ -1355,13 +1355,11 @@ def to_records(self, index=True, convert_datetime64=None):
dtype=[('index', '<M8[ns]'), ('A', '<i8'), ('B', '<f8')])
"""

if convert_datetime64 is not None:
if convert_datetime64:
warnings.warn("The 'convert_datetime64' parameter is "
"deprecated and will be removed in a future "
"version",
FutureWarning, stacklevel=2)
else:
convert_datetime64 = True

if index:
if is_datetime64_any_dtype(self.index) and convert_datetime64:
Expand Down
15 changes: 6 additions & 9 deletions pandas/tests/frame/test_convert_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,16 @@ def test_to_records_dt64(self):
["four", "five", "six"]],
index=date_range("2012-01-01", "2012-01-02"))

with tm.assert_produces_warning(FutureWarning):
expected = df.index[0]
result = df.to_records(convert_datetime64=True)['index'][0]
assert expected == result

expected = df.index[0]
# convert_datetime64 defaults to True if not passed
# convert_datetime64 defaults to False if not passed
expected = df.index.values[0]
result = df.to_records()['index'][0]
assert expected == result

# check for FutureWarning if convert_datetime64=True is passed
with tm.assert_produces_warning(FutureWarning):
rs = df.to_records(convert_datetime64=False)
assert rs['index'][0] == df.index.values[0]
expected = df.index[0]
result = df.to_records(convert_datetime64=True)['index'][0]
assert expected == result

def test_to_records_with_multindex(self):
# GH3189
Expand Down

0 comments on commit 32606c5

Please sign in to comment.