File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1115,6 +1115,25 @@ def append(self, other):
11151115 for x in to_concat ]
11161116 return Index (com ._concat_compat (to_concat ), name = name )
11171117
1118+ def __reduce__ (self ):
1119+ """Necessary for making this object picklable"""
1120+ object_state = list (np .ndarray .__reduce__ (self ))
1121+ subclass_state = (self .name , self .freq )
1122+ object_state [2 ] = (object_state [2 ], subclass_state )
1123+ return tuple (object_state )
1124+
1125+ def __setstate__ (self , state ):
1126+ """Necessary for making this object picklable"""
1127+ if len (state ) == 2 :
1128+ nd_state , own_state = state
1129+ np .ndarray .__setstate__ (self , nd_state )
1130+ self .name = own_state [0 ]
1131+ try : # backcompat
1132+ self .freq = own_state [1 ]
1133+ except :
1134+ pass
1135+ else : # pragma: no cover
1136+ np .ndarray .__setstate__ (self , state )
11181137
11191138def _get_ordinal_range (start , end , periods , freq ):
11201139 if com ._count_not_none (start , end , periods ) < 2 :
You can’t perform that action at this time.
0 commit comments