Skip to content

Commit 2055df2

Browse files
Terji Petersentopper-123
Terji Petersen
authored andcommitted
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
1 parent 7695bf1 commit 2055df2

File tree

88 files changed

+614
-429
lines changed

Some content is hidden

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

88 files changed

+614
-429
lines changed

pandas/core/arrays/datetimes.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ def isocalendar(self) -> DataFrame:
13881388
0 2000
13891389
1 2001
13901390
2 2002
1391-
dtype: int64
1391+
dtype: int32
13921392
""",
13931393
)
13941394
month = _field_accessor(
@@ -1411,7 +1411,7 @@ def isocalendar(self) -> DataFrame:
14111411
0 1
14121412
1 2
14131413
2 3
1414-
dtype: int64
1414+
dtype: int32
14151415
""",
14161416
)
14171417
day = _field_accessor(
@@ -1434,7 +1434,7 @@ def isocalendar(self) -> DataFrame:
14341434
0 1
14351435
1 2
14361436
2 3
1437-
dtype: int64
1437+
dtype: int32
14381438
""",
14391439
)
14401440
hour = _field_accessor(
@@ -1457,7 +1457,7 @@ def isocalendar(self) -> DataFrame:
14571457
0 0
14581458
1 1
14591459
2 2
1460-
dtype: int64
1460+
dtype: int32
14611461
""",
14621462
)
14631463
minute = _field_accessor(
@@ -1480,7 +1480,7 @@ def isocalendar(self) -> DataFrame:
14801480
0 0
14811481
1 1
14821482
2 2
1483-
dtype: int64
1483+
dtype: int32
14841484
""",
14851485
)
14861486
second = _field_accessor(
@@ -1503,7 +1503,7 @@ def isocalendar(self) -> DataFrame:
15031503
0 0
15041504
1 1
15051505
2 2
1506-
dtype: int64
1506+
dtype: int32
15071507
""",
15081508
)
15091509
microsecond = _field_accessor(
@@ -1526,7 +1526,7 @@ def isocalendar(self) -> DataFrame:
15261526
0 0
15271527
1 1
15281528
2 2
1529-
dtype: int64
1529+
dtype: int32
15301530
""",
15311531
)
15321532
nanosecond = _field_accessor(
@@ -1549,7 +1549,7 @@ def isocalendar(self) -> DataFrame:
15491549
0 0
15501550
1 1
15511551
2 2
1552-
dtype: int64
1552+
dtype: int32
15531553
""",
15541554
)
15551555
_dayofweek_doc = """
@@ -1584,7 +1584,7 @@ def isocalendar(self) -> DataFrame:
15841584
2017-01-06 4
15851585
2017-01-07 5
15861586
2017-01-08 6
1587-
Freq: D, dtype: int64
1587+
Freq: D, dtype: int32
15881588
"""
15891589
day_of_week = _field_accessor("day_of_week", "dow", _dayofweek_doc)
15901590
dayofweek = day_of_week

pandas/core/arrays/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ def total_seconds(self) -> npt.NDArray[np.float64]:
771771
dtype='timedelta64[ns]', freq=None)
772772
773773
>>> idx.total_seconds()
774-
Float64Index([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
774+
NumericIndex([0.0, 86400.0, 172800.0, 259200.0, 345600.0],
775775
dtype='float64')
776776
"""
777777
pps = periods_per_second(self._creso)

pandas/core/generic.py

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

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)