Skip to content

Commit 69f9441

Browse files
committed
DEPR: remove legacy pd.TimeSeries class in favor of pd.Series
xref #10890 DEPR: remove Series.is_time_series in favor of Series.index.is_all_dates
1 parent aa03e7f commit 69f9441

20 files changed

+13
-62
lines changed

doc/source/whatsnew/v0.20.0.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ Other enhancements
122122
Backwards incompatible API changes
123123
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124124

125+
.. _whatsnew.api_breaking.io_compat
126+
127+
Pickle and HDF5 compat requires >= 0.13.0
128+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129+
130+
``pd.TimeSeries`` was deprecated officially in 0.17.0, though has only been an alias since 0.13.0. It has
131+
been dropped in favor of ``pd.Series``.
132+
133+
This *may* cause pickles / HDF5 files that were created with the ``pd.TimeSeries`` to become unreadable. (:issue:``15098).
134+
125135
.. _whatsnew.api_breaking.index_map
126136

127137
Map on Index types now return other Index types
@@ -270,8 +280,7 @@ Removal of prior version deprecations/changes
270280
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271281

272282
- ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`)
273-
274-
283+
- ``Series.is_time_series`` is dropped in favor of ``Series.index.is_all_dates`` (:issue:``)
275284

276285

277286
.. _whatsnew_0200.performance:

pandas/api/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TestPDApi(Base, tm.TestCase):
5959
'TimedeltaIndex', 'Timestamp']
6060

6161
# these are already deprecated; awaiting removal
62-
deprecated_classes = ['TimeSeries', 'WidePanel',
62+
deprecated_classes = ['WidePanel',
6363
'SparseTimeSeries', 'Panel4D',
6464
'SparseList']
6565

pandas/core/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pandas.core.index import (Index, CategoricalIndex, Int64Index,
1313
RangeIndex, Float64Index, MultiIndex)
1414

15-
from pandas.core.series import Series, TimeSeries
15+
from pandas.core.series import Series
1616
from pandas.core.frame import DataFrame
1717
from pandas.core.panel import Panel, WidePanel
1818
from pandas.core.panel4d import Panel4D

pandas/core/series.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,6 @@ def _constructor_expanddim(self):
276276
def _can_hold_na(self):
277277
return self._data._can_hold_na
278278

279-
@property
280-
def is_time_series(self):
281-
warnings.warn("is_time_series is deprecated. Please use "
282-
"Series.index.is_all_dates", FutureWarning, stacklevel=2)
283-
# return self._subtyp in ['time_series', 'sparse_time_series']
284-
return self.index.is_all_dates
285-
286279
_index = None
287280

288281
def _set_axis(self, axis, labels, fastpath=False):
@@ -2980,15 +2973,6 @@ def create_from_value(value, index, dtype):
29802973
return subarr
29812974

29822975

2983-
# backwards compatiblity
2984-
class TimeSeries(Series):
2985-
def __init__(self, *args, **kwargs):
2986-
# deprecation TimeSeries, #10890
2987-
warnings.warn("TimeSeries is deprecated. Please use Series",
2988-
FutureWarning, stacklevel=2)
2989-
2990-
super(TimeSeries, self).__init__(*args, **kwargs)
2991-
29922976
# ----------------------------------------------------------------------
29932977
# Add plotting methods to Series
29942978

pandas/io/pytables.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
from pandas.types.missing import array_equivalent
2424

2525
import numpy as np
26-
27-
import pandas as pd
2826
from pandas import (Series, DataFrame, Panel, Panel4D, Index,
2927
MultiIndex, Int64Index, isnull)
3028
from pandas.core import config
@@ -164,7 +162,6 @@ class DuplicateWarning(Warning):
164162

165163
Series: u('series'),
166164
SparseSeries: u('sparse_series'),
167-
pd.TimeSeries: u('series'),
168165
DataFrame: u('frame'),
169166
SparseDataFrame: u('sparse_frame'),
170167
Panel: u('wide'),
@@ -173,7 +170,6 @@ class DuplicateWarning(Warning):
173170

174171
# storer class map
175172
_STORER_MAP = {
176-
u('TimeSeries'): 'LegacySeriesFixed',
177173
u('Series'): 'LegacySeriesFixed',
178174
u('DataFrame'): 'LegacyFrameFixed',
179175
u('DataMatrix'): 'LegacyFrameFixed',
-14.6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)