3
3
"""
4
4
import operator
5
5
from typing import Set
6
- import warnings
7
6
8
7
import numpy as np
9
8
@@ -104,11 +103,6 @@ def freq(self):
104
103
"""
105
104
return self ._data .freq
106
105
107
- @freq .setter
108
- def freq (self , value ):
109
- # validation is handled by _data setter
110
- self ._data .freq = value
111
-
112
106
@property
113
107
def freqstr (self ):
114
108
"""
@@ -332,23 +326,6 @@ def take(self, indices, axis=0, allow_fill=True, fill_value=None, **kwargs):
332
326
_na_value = NaT
333
327
"""The expected NA value to use with this index."""
334
328
335
- @property
336
- def asobject (self ):
337
- """
338
- Return object Index which contains boxed values.
339
-
340
- .. deprecated:: 0.23.0
341
- Use ``astype(object)`` instead.
342
-
343
- *this is an internal non-public method*
344
- """
345
- warnings .warn (
346
- "'asobject' is deprecated. Use 'astype(object)' instead" ,
347
- FutureWarning ,
348
- stacklevel = 2 ,
349
- )
350
- return self .astype (object )
351
-
352
329
def _convert_tolerance (self , tolerance , target ):
353
330
tolerance = np .asarray (to_timedelta (tolerance ).to_numpy ())
354
331
@@ -612,7 +589,8 @@ def intersection(self, other, sort=False):
612
589
result = Index .intersection (self , other , sort = sort )
613
590
if isinstance (result , type (self )):
614
591
if result .freq is None :
615
- result .freq = to_offset (result .inferred_freq )
592
+ # TODO: find a less code-smelly way to set this
593
+ result ._data ._freq = to_offset (result .inferred_freq )
616
594
return result
617
595
618
596
elif (
@@ -626,15 +604,18 @@ def intersection(self, other, sort=False):
626
604
627
605
# Invalidate the freq of `result`, which may not be correct at
628
606
# this point, depending on the values.
629
- result .freq = None
607
+
608
+ # TODO: find a less code-smelly way to set this
609
+ result ._data ._freq = None
630
610
if hasattr (self , "tz" ):
631
611
result = self ._shallow_copy (
632
612
result ._values , name = result .name , tz = result .tz , freq = None
633
613
)
634
614
else :
635
615
result = self ._shallow_copy (result ._values , name = result .name , freq = None )
636
616
if result .freq is None :
637
- result .freq = to_offset (result .inferred_freq )
617
+ # TODO: find a less code-smelly way to set this
618
+ result ._data ._freq = to_offset (result .inferred_freq )
638
619
return result
639
620
640
621
# to make our life easier, "sort" the two ranges
0 commit comments