Skip to content

Commit e7ec3de

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
1 parent 5d8371d commit e7ec3de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+450
-312
lines changed

pandas/core/arrays/datetimes.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ def isocalendar(self) -> DataFrame:
13571357
0 2000
13581358
1 2001
13591359
2 2002
1360-
dtype: int64
1360+
dtype: int32
13611361
""",
13621362
)
13631363
month = _field_accessor(
@@ -1380,7 +1380,7 @@ def isocalendar(self) -> DataFrame:
13801380
0 1
13811381
1 2
13821382
2 3
1383-
dtype: int64
1383+
dtype: int32
13841384
""",
13851385
)
13861386
day = _field_accessor(
@@ -1403,7 +1403,7 @@ def isocalendar(self) -> DataFrame:
14031403
0 1
14041404
1 2
14051405
2 3
1406-
dtype: int64
1406+
dtype: int32
14071407
""",
14081408
)
14091409
hour = _field_accessor(
@@ -1426,7 +1426,7 @@ def isocalendar(self) -> DataFrame:
14261426
0 0
14271427
1 1
14281428
2 2
1429-
dtype: int64
1429+
dtype: int32
14301430
""",
14311431
)
14321432
minute = _field_accessor(
@@ -1449,7 +1449,7 @@ def isocalendar(self) -> DataFrame:
14491449
0 0
14501450
1 1
14511451
2 2
1452-
dtype: int64
1452+
dtype: int32
14531453
""",
14541454
)
14551455
second = _field_accessor(
@@ -1472,7 +1472,7 @@ def isocalendar(self) -> DataFrame:
14721472
0 0
14731473
1 1
14741474
2 2
1475-
dtype: int64
1475+
dtype: int32
14761476
""",
14771477
)
14781478
microsecond = _field_accessor(
@@ -1495,7 +1495,7 @@ def isocalendar(self) -> DataFrame:
14951495
0 0
14961496
1 1
14971497
2 2
1498-
dtype: int64
1498+
dtype: int32
14991499
""",
15001500
)
15011501
nanosecond = _field_accessor(
@@ -1518,7 +1518,7 @@ def isocalendar(self) -> DataFrame:
15181518
0 0
15191519
1 1
15201520
2 2
1521-
dtype: int64
1521+
dtype: int32
15221522
""",
15231523
)
15241524
_dayofweek_doc = """
@@ -1553,7 +1553,7 @@ def isocalendar(self) -> DataFrame:
15531553
2017-01-06 4
15541554
2017-01-07 5
15551555
2017-01-08 6
1556-
Freq: D, dtype: int64
1556+
Freq: D, dtype: int32
15571557
"""
15581558
day_of_week = _field_accessor("day_of_week", "dow", _dayofweek_doc)
15591559
dayofweek = day_of_week

pandas/core/arrays/timedeltas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def total_seconds(self) -> npt.NDArray[np.float64]:
797797
dtype='timedelta64[ns]', freq=None)
798798
799799
>>> idx.total_seconds()
800-
Float64Index([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
800+
NumericIndex([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
801801
dtype='float64')
802802
"""
803803
pps = periods_per_second(self._creso)

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6083,7 +6083,7 @@ def astype(
60836083
0 1
60846084
1 2
60856085
dtype: category
6086-
Categories (2, int64): [1, 2]
6086+
Categories (2, int32): [1, 2]
60876087
60886088
Convert to ordered categorical type with custom ordering:
60896089

pandas/core/indexes/accessors.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class DatetimeProperties(Properties):
161161
0 0
162162
1 1
163163
2 2
164-
dtype: int64
164+
dtype: int32
165165
166166
>>> hours_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="h"))
167167
>>> hours_series
@@ -173,7 +173,7 @@ class DatetimeProperties(Properties):
173173
0 0
174174
1 1
175175
2 2
176-
dtype: int64
176+
dtype: int32
177177
178178
>>> quarters_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="q"))
179179
>>> quarters_series
@@ -185,7 +185,7 @@ class DatetimeProperties(Properties):
185185
0 1
186186
1 2
187187
2 3
188-
dtype: int64
188+
dtype: int32
189189
190190
Returns a Series indexed like the original Series.
191191
Raises TypeError if the Series does not contain datetimelike values.
@@ -303,7 +303,7 @@ class TimedeltaProperties(Properties):
303303
0 1
304304
1 2
305305
2 3
306-
dtype: int64
306+
dtype: int32
307307
"""
308308

309309
def to_pytimedelta(self) -> np.ndarray:

0 commit comments

Comments
 (0)