Skip to content

Commit c9f6094

Browse files
committed
revert all dt related changes
1 parent 23a58c2 commit c9f6094

File tree

6 files changed

+3
-51
lines changed

6 files changed

+3
-51
lines changed

doc/source/reference/series.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Conversion
4949
Series.copy
5050
Series.to_numpy
5151
Series.to_period
52-
Series.to_timestamp
5352
Series.to_list
5453
Series.__array__
5554

doc/source/whatsnew/v3.0.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Other enhancements
5858
- :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`)
5959
- :meth:`str.get_dummies` now accepts a ``dtype`` parameter to specify the dtype of the resulting DataFrame (:issue:`47872`)
6060
- Multiplying two :class:`DateOffset` objects will now raise a ``TypeError`` instead of a ``RecursionError`` (:issue:`59442`)
61-
- Refactored :meth:`_create_delegator_method` under core/accessor.py using ``functools``, improving code clarity and maintainability. (:issue:`59783`)
6261
- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue:`58554`)
6362
- Support passing a :class:`Iterable[Hashable]` input to :meth:`DataFrame.drop_duplicates` (:issue:`59237`)
6463
- Support reading Stata 102-format (Stata 1) dta files (:issue:`58978`)

pandas/core/arrays/categorical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,8 +1377,8 @@ def remove_categories(self, removals) -> Self:
13771377
"""
13781378
Remove the specified categories.
13791379
1380-
``removals`` must be included in the old categories,
1381-
values which were in the removed categories will be set to NaN
1380+
The ``removals`` argument must be a subset of the current categories.
1381+
Any values that were part of the removed categories will be set to NaN.
13821382
13831383
Parameters
13841384
----------

pandas/core/arrays/datetimes.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def _scalar_type(self) -> type[Timestamp]:
261261
)
262262
_datetimelike_methods: list[str] = [
263263
"to_period",
264-
"to_timestamp",
265264
"tz_localize",
266265
"tz_convert",
267266
"normalize",
@@ -1268,50 +1267,6 @@ def to_period(self, freq=None) -> PeriodArray:
12681267
freq = res
12691268
return PeriodArray._from_datetime64(self._ndarray, freq, tz=self.tz)
12701269

1271-
def to_timestamp(self):
1272-
"""
1273-
Convert ``Series`` of ``Periods`` to ``DatetimeIndex/Array``.
1274-
1275-
This method converts a Series of Periods to a ``DatetimeIndex/Array``.
1276-
The ``freq`` and ``how`` parameters cannot be used when calling
1277-
``to_timestamp`` the ``.dt`` accessor.
1278-
1279-
Returns
1280-
-------
1281-
DatetimeArray/Index
1282-
A `DatetimeArray` or `DatetimeIndex` object representing the period
1283-
converted to a timestamp.
1284-
1285-
See Also
1286-
--------
1287-
PeriodIndex.day : The days of the period.
1288-
PeriodIndex.from_fields : Construct a PeriodIndex from fields
1289-
(year, month, day, etc.).
1290-
PeriodIndex.from_ordinals : Construct a PeriodIndex from ordinals.
1291-
PeriodIndex.hour : The hour of the period.
1292-
PeriodIndex.minute : The minute of the period.
1293-
PeriodIndex.month : The month as January=1, December=12.
1294-
PeriodIndex.second : The second of the period.
1295-
PeriodIndex.year : The year of the period.
1296-
1297-
Examples
1298-
--------
1299-
>>> s = pd.Series(pd.period_range("2023-01", periods=3, freq="M"))
1300-
>>> s
1301-
0 2023-01
1302-
1 2023-02
1303-
2 2023-03
1304-
dtype: period[M]
1305-
>>> s.dt.to_timestamp()
1306-
0 2023-01-01
1307-
1 2023-02-01
1308-
2 2023-03-01
1309-
dtype: datetime64[ns]
1310-
"""
1311-
# Uses to_timestamp method defined in PeriodArray Class()
1312-
# function here only used to update docstring
1313-
return
1314-
13151270
# -----------------------------------------------------------------
13161271
# Properties - Vectorized Timestamp Properties/Methods
13171272

pandas/tests/series/accessors/test_cat_accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_dt_accessor_api_for_categorical(self, idx):
177177

178178
_special_func_names = [f[0] for f in special_func_defs]
179179

180-
_ignore_names = ["components", "to_timestamp", "tz_localize", "tz_convert"]
180+
_ignore_names = ["components", "tz_localize", "tz_convert"]
181181

182182
func_names = [
183183
fname

pandas/tests/series/accessors/test_dt_accessor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
ok_for_dt = DatetimeArray._datetimelike_ops
4646
ok_for_dt_methods = [
4747
"to_period",
48-
"to_timestamp",
4948
"to_pydatetime",
5049
"tz_localize",
5150
"tz_convert",

0 commit comments

Comments
 (0)