Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: Remove int64 uint64 float64 index part 1 #49560

Merged
18 changes: 9 additions & 9 deletions pandas/core/arrays/datetimes.py
Expand Up @@ -1384,7 +1384,7 @@ def isocalendar(self) -> DataFrame:
0 2000
1 2001
2 2002
dtype: int64
dtype: int32
""",
)
month = _field_accessor(
Expand All @@ -1407,7 +1407,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
day = _field_accessor(
Expand All @@ -1430,7 +1430,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
hour = _field_accessor(
Expand All @@ -1453,7 +1453,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
minute = _field_accessor(
Expand All @@ -1476,7 +1476,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
second = _field_accessor(
Expand All @@ -1499,7 +1499,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
microsecond = _field_accessor(
Expand All @@ -1522,7 +1522,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
nanosecond = _field_accessor(
Expand All @@ -1545,7 +1545,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
_dayofweek_doc = """
Expand Down Expand Up @@ -1580,7 +1580,7 @@ def isocalendar(self) -> DataFrame:
2017-01-06 4
2017-01-07 5
2017-01-08 6
Freq: D, dtype: int64
Freq: D, dtype: int32
jbrockmendel marked this conversation as resolved.
Show resolved Hide resolved
"""
day_of_week = _field_accessor("day_of_week", "dow", _dayofweek_doc)
dayofweek = day_of_week
Expand Down
8 changes: 7 additions & 1 deletion pandas/core/arrays/interval.py
Expand Up @@ -46,7 +46,10 @@
from pandas.errors import IntCastingNaNError
from pandas.util._decorators import Appender

from pandas.core.dtypes.cast import LossySetitemError
from pandas.core.dtypes.cast import (
LossySetitemError,
maybe_upcast_numeric_to_64bit,
)
from pandas.core.dtypes.common import (
is_categorical_dtype,
is_dtype_equal,
Expand Down Expand Up @@ -304,7 +307,10 @@ def _ensure_simple_new_inputs(
from pandas.core.indexes.base import ensure_index

left = ensure_index(left, copy=copy)
left = maybe_upcast_numeric_to_64bit(left)

right = ensure_index(right, copy=copy)
right = maybe_upcast_numeric_to_64bit(right)

if closed is None and isinstance(dtype, IntervalDtype):
closed = dtype.closed
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/timedeltas.py
Expand Up @@ -771,7 +771,7 @@ def total_seconds(self) -> npt.NDArray[np.float64]:
dtype='timedelta64[ns]', freq=None)

>>> idx.total_seconds()
Float64Index([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
NumericIndex([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
dtype='float64')
"""
pps = periods_per_second(self._creso)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Expand Up @@ -6057,7 +6057,7 @@ def astype(
0 1
1 2
dtype: category
Categories (2, int64): [1, 2]
Categories (2, int32): [1, 2]

Convert to ordered categorical type with custom ordering:

Expand Down
8 changes: 4 additions & 4 deletions pandas/core/indexes/accessors.py
Expand Up @@ -161,7 +161,7 @@ class DatetimeProperties(Properties):
0 0
1 1
2 2
dtype: int64
dtype: int32

>>> hours_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="h"))
>>> hours_series
Expand All @@ -173,7 +173,7 @@ class DatetimeProperties(Properties):
0 0
1 1
2 2
dtype: int64
dtype: int32

>>> quarters_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="q"))
>>> quarters_series
Expand All @@ -185,7 +185,7 @@ class DatetimeProperties(Properties):
0 1
1 2
2 3
dtype: int64
dtype: int32

Returns a Series indexed like the original Series.
Raises TypeError if the Series does not contain datetimelike values.
Expand Down Expand Up @@ -303,7 +303,7 @@ class TimedeltaProperties(Properties):
0 1
1 2
2 3
dtype: int64
dtype: int32
"""

def to_pytimedelta(self) -> np.ndarray:
Expand Down