diff --git a/trackpy/motion.py b/trackpy/motion.py index 8b4ee8f5..7432cad8 100644 --- a/trackpy/motion.py +++ b/trackpy/motion.py @@ -239,7 +239,7 @@ def emsd(traj, mpp, fps, max_lagtime=100, detail=False, pos_columns=None): if not detail: return results.set_index('lagt')['msd'] # correctly compute the effective number of independent measurements - results['N'] = msds['N'].sum(level=1) + results['N'] = msds['N'].groupby(level=1).sum() return results