Skip to content

Commit 8601a18

Browse files
committed
Revert and fix astype parameters
1 parent 454db4f commit 8601a18

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/core/internals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def f(m, v, i):
535535

536536
return self.split_and_operate(None, f, False)
537537

538-
def astype(self, dtype, copy=True, errors='raise', values=None, **kwargs):
538+
def astype(self, dtype, copy=False, errors='raise', values=None, **kwargs):
539539
return self._astype(dtype, copy=copy, errors=errors, values=values,
540540
**kwargs)
541541

@@ -2676,7 +2676,7 @@ def sp_index(self):
26762676
def kind(self):
26772677
return self.values.kind
26782678

2679-
def _astype(self, dtype, copy=True, raise_on_error=True, values=None,
2679+
def _astype(self, dtype, copy=False, raise_on_error=True, values=None,
26802680
klass=None, mgr=None, **kwargs):
26812681
if values is None:
26822682
values = self.values

pandas/core/sparse/frame.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,9 @@ def _apply_columns(self, func):
321321
data=new_data, index=self.index, columns=self.columns,
322322
default_fill_value=self.default_fill_value).__finalize__(self)
323323

324-
def astype(self, dtype, copy=True, errors='raise'):
325-
return self._apply_columns(lambda x: x.astype(dtype, copy, errors))
324+
def astype(self, dtype, copy=True, errors='raise', **kwargs):
325+
return self._apply_columns(lambda x: x.astype(dtype, copy,
326+
errors, **kwargs))
326327

327328
def copy(self, deep=True):
328329
"""

0 commit comments

Comments
 (0)