File tree 1 file changed +19
-0
lines changed
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):
1115
1115
for x in to_concat ]
1116
1116
return Index (com ._concat_compat (to_concat ), name = name )
1117
1117
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 )
1118
1137
1119
1138
def _get_ordinal_range (start , end , periods , freq ):
1120
1139
if com ._count_not_none (start , end , periods ) < 2 :
You can’t perform that action at this time.
0 commit comments