@@ -1057,6 +1057,9 @@ def coerce_to_target_dtype(self, other):
10571057 except (ValueError , TypeError , OverflowError ):
10581058 return self .astype (object )
10591059
1060+ def _get_block_indices (self ):
1061+ return list (self .mgr_locs )
1062+
10601063 def interpolate (
10611064 self ,
10621065 method = "pad" ,
@@ -1071,6 +1074,7 @@ def interpolate(
10711074 downcast = None ,
10721075 ** kwargs ,
10731076 ):
1077+ index = self ._get_block_indices ()
10741078
10751079 inplace = validate_bool_kwarg (inplace , "inplace" )
10761080
@@ -1211,8 +1215,22 @@ def func(x):
12111215 )
12121216
12131217 # 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+
12161234
12171235 blocks = [self .make_block_same_class (interp_values )]
12181236 return self ._maybe_downcast (blocks , downcast )
0 commit comments