Skip to content

Commit cc4b130

Browse files
committed
CLN: remove copying of PeriodIndex values on astype(int)
1 parent e5936eb commit cc4b130

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/tseries/period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def astype(self, dtype):
714714
if dtype == np.object_:
715715
return Index(np.array(list(self), dtype), dtype)
716716
elif dtype == _INT64_DTYPE:
717-
return Index(self.values.copy(), dtype)
717+
return Index(self.values, dtype)
718718
raise ValueError('Cannot cast PeriodIndex to dtype %s' % dtype)
719719

720720
def __iter__(self):

0 commit comments

Comments
 (0)