@@ -1057,6 +1057,9 @@ def coerce_to_target_dtype(self, other):
1057
1057
except (ValueError , TypeError , OverflowError ):
1058
1058
return self .astype (object )
1059
1059
1060
+ def _get_block_indices (self ):
1061
+ return list (self .mgr_locs )
1062
+
1060
1063
def interpolate (
1061
1064
self ,
1062
1065
method = "pad" ,
@@ -1071,6 +1074,7 @@ def interpolate(
1071
1074
downcast = None ,
1072
1075
** kwargs ,
1073
1076
):
1077
+ index = self ._get_block_indices ()
1074
1078
1075
1079
inplace = validate_bool_kwarg (inplace , "inplace" )
1076
1080
@@ -1211,8 +1215,22 @@ def func(x):
1211
1215
)
1212
1216
1213
1217
# interp each column independently
1214
- print (data )
1215
- interp_values = np .apply_along_axis (func , 1 , data )
1218
+ #def get_axis_by_data_length():
1219
+ # if len(set(data.shape)) != 1:
1220
+ # #import pdb; pdb.set_trace()
1221
+ # return data.shape.index(len(index))
1222
+ # else:
1223
+ # return axis
1224
+
1225
+ #np_axis = get_axis_by_data_length()
1226
+
1227
+ #interp_values = np.apply_along_axis(func, np_axis, data)
1228
+ interp_values = np .apply_along_axis (func , axis , data )
1229
+ #try:
1230
+ # interp_values = np.apply_along_axis(func, axis, data)
1231
+ #except (AttributeError, IndexError, ValueError):
1232
+ # interp_values = np.apply_along_axis(func, 1-axis, data)
1233
+
1216
1234
1217
1235
blocks = [self .make_block_same_class (interp_values )]
1218
1236
return self ._maybe_downcast (blocks , downcast )
0 commit comments