def get_MSD_for_DataFrame_raw(DF): GetXYS=ct.get_xys(DF) xys_s_temp=ct.get_xys_s(GetXYS['xys'],GetXYS['Nmin']) i=0 for j in list(range(len(xys_s_temp))): if np.isnan(xys_s_temp[i]['X']).any(): xys_s_temp.pop(i) i=i-1 i=i+1 msd=ct.get_msd(xys_s_temp)['Raw']#See get_msd function return msd