Skip to content

GH49560 without GH50195 (DEPR: Remove int64 uint64 float64 index part 1) #50550

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

Closed
wants to merge 11 commits into from
6 changes: 4 additions & 2 deletions pandas/_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from pandas._typing import (
Dtype,
Frequency,
NpDtype,
)
from pandas.compat import pa_version_under6p0

Expand Down Expand Up @@ -124,12 +125,13 @@
_N = 30
_K = 4

UNSIGNED_INT_NUMPY_DTYPES: list[Dtype] = ["uint8", "uint16", "uint32", "uint64"]
UNSIGNED_INT_NUMPY_DTYPES: list[NpDtype] = ["uint8", "uint16", "uint32", "uint64"]
UNSIGNED_INT_EA_DTYPES: list[Dtype] = ["UInt8", "UInt16", "UInt32", "UInt64"]
SIGNED_INT_NUMPY_DTYPES: list[Dtype] = [int, "int8", "int16", "int32", "int64"]
SIGNED_INT_NUMPY_DTYPES: list[NpDtype] = [int, "int8", "int16", "int32", "int64"]
SIGNED_INT_EA_DTYPES: list[Dtype] = ["Int8", "Int16", "Int32", "Int64"]
ALL_INT_NUMPY_DTYPES = UNSIGNED_INT_NUMPY_DTYPES + SIGNED_INT_NUMPY_DTYPES
ALL_INT_EA_DTYPES = UNSIGNED_INT_EA_DTYPES + SIGNED_INT_EA_DTYPES
ALL_INT_DTYPES: list[Dtype] = [*ALL_INT_NUMPY_DTYPES, *ALL_INT_EA_DTYPES]

FLOAT_NUMPY_DTYPES: list[Dtype] = [float, "float32", "float64"]
FLOAT_EA_DTYPES: list[Dtype] = ["Float32", "Float64"]
Expand Down
2 changes: 1 addition & 1 deletion pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ def any_int_ea_dtype(request):
return request.param


@pytest.fixture(params=tm.ALL_INT_NUMPY_DTYPES + tm.ALL_INT_EA_DTYPES)
@pytest.fixture(params=tm.ALL_INT_DTYPES)
def any_int_dtype(request):
"""
Parameterized fixture for any nullable integer dtype.
Expand Down
18 changes: 9 additions & 9 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ def isocalendar(self) -> DataFrame:
0 2000
1 2001
2 2002
dtype: int64
dtype: int32
""",
)
month = _field_accessor(
Expand All @@ -1408,7 +1408,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
day = _field_accessor(
Expand All @@ -1431,7 +1431,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
hour = _field_accessor(
Expand All @@ -1454,7 +1454,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
minute = _field_accessor(
Expand All @@ -1477,7 +1477,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
second = _field_accessor(
Expand All @@ -1500,7 +1500,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
microsecond = _field_accessor(
Expand All @@ -1523,7 +1523,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
nanosecond = _field_accessor(
Expand All @@ -1546,7 +1546,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
_dayofweek_doc = """
Expand Down Expand Up @@ -1581,7 +1581,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
"""
day_of_week = _field_accessor("day_of_week", "dow", _dayofweek_doc)
dayofweek = day_of_week
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -6095,7 +6095,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
Original file line number Diff line number Diff line change
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
Loading