Skip to content

Commit

Permalink
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
Browse files Browse the repository at this point in the history
  • Loading branch information
Terji Petersen authored and Terji Petersen committed Nov 17, 2022
1 parent 5d8371d commit e7ec3de
Show file tree
Hide file tree
Showing 56 changed files with 450 additions and 312 deletions.
18 changes: 9 additions & 9 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ def isocalendar(self) -> DataFrame:
0 2000
1 2001
2 2002
dtype: int64
dtype: int32
""",
)
month = _field_accessor(
Expand All @@ -1380,7 +1380,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
day = _field_accessor(
Expand All @@ -1403,7 +1403,7 @@ def isocalendar(self) -> DataFrame:
0 1
1 2
2 3
dtype: int64
dtype: int32
""",
)
hour = _field_accessor(
Expand All @@ -1426,7 +1426,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
minute = _field_accessor(
Expand All @@ -1449,7 +1449,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
second = _field_accessor(
Expand All @@ -1472,7 +1472,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
microsecond = _field_accessor(
Expand All @@ -1495,7 +1495,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
nanosecond = _field_accessor(
Expand All @@ -1518,7 +1518,7 @@ def isocalendar(self) -> DataFrame:
0 0
1 1
2 2
dtype: int64
dtype: int32
""",
)
_dayofweek_doc = """
Expand Down Expand Up @@ -1553,7 +1553,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 @@ -797,7 +797,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 @@ -6083,7 +6083,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

0 comments on commit e7ec3de

Please sign in to comment.