Skip to content

Commit 6153216

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
1 parent 2153c84 commit 6153216

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def isocalendar(self) -> DataFrame:
13791379
0 2000
13801380
1 2001
13811381
2 2002
1382-
dtype: int64
1382+
dtype: int32
13831383
""",
13841384
)
13851385
month = _field_accessor(
@@ -1402,7 +1402,7 @@ def isocalendar(self) -> DataFrame:
14021402
0 1
14031403
1 2
14041404
2 3
1405-
dtype: int64
1405+
dtype: int32
14061406
""",
14071407
)
14081408
day = _field_accessor(
@@ -1425,7 +1425,7 @@ def isocalendar(self) -> DataFrame:
14251425
0 1
14261426
1 2
14271427
2 3
1428-
dtype: int64
1428+
dtype: int32
14291429
""",
14301430
)
14311431
hour = _field_accessor(
@@ -1448,7 +1448,7 @@ def isocalendar(self) -> DataFrame:
14481448
0 0
14491449
1 1
14501450
2 2
1451-
dtype: int64
1451+
dtype: int32
14521452
""",
14531453
)
14541454
minute = _field_accessor(
@@ -1471,7 +1471,7 @@ def isocalendar(self) -> DataFrame:
14711471
0 0
14721472
1 1
14731473
2 2
1474-
dtype: int64
1474+
dtype: int32
14751475
""",
14761476
)
14771477
second = _field_accessor(
@@ -1494,7 +1494,7 @@ def isocalendar(self) -> DataFrame:
14941494
0 0
14951495
1 1
14961496
2 2
1497-
dtype: int64
1497+
dtype: int32
14981498
""",
14991499
)
15001500
microsecond = _field_accessor(
@@ -1517,7 +1517,7 @@ def isocalendar(self) -> DataFrame:
15171517
0 0
15181518
1 1
15191519
2 2
1520-
dtype: int64
1520+
dtype: int32
15211521
""",
15221522
)
15231523
nanosecond = _field_accessor(
@@ -1540,7 +1540,7 @@ def isocalendar(self) -> DataFrame:
15401540
0 0
15411541
1 1
15421542
2 2
1543-
dtype: int64
1543+
dtype: int32
15441544
""",
15451545
)
15461546
_dayofweek_doc = """
@@ -1575,7 +1575,7 @@ def isocalendar(self) -> DataFrame:
15751575
2017-01-06 4
15761576
2017-01-07 5
15771577
2017-01-08 6
1578-
Freq: D, dtype: int64
1578+
Freq: D, dtype: int32
15791579
"""
15801580
day_of_week = _field_accessor("day_of_week", "dow", _dayofweek_doc)
15811581
dayofweek = day_of_week

pandas/core/arrays/timedeltas.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6086,7 +6086,7 @@ def astype(
60866086
0 1
60876087
1 2
60886088
dtype: category
6089-
Categories (2, int64): [1, 2]
6089+
Categories (2, int32): [1, 2]
60906090
60916091
Convert to ordered categorical type with custom ordering:
60926092

pandas/core/indexes/accessors.py

Lines changed: 4 additions & 4 deletions
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)