Cell 23 in the walkthrough removes individual timesteps that are not compliant, but it needs to remove the entire bad particle trajectory:
t2 = t1[((t1['mass'] > 50) & (t1['size'] < 2.6) & (t1['ecc'] < 0.3))]
should be something like:
t1_means = t1.groupby('particle').mean()good_particles = t1_means[(t1_means['mass'] > 50) & (t1_means['size'] < 2.6) & (t1_means['ecc']<0.3)]# particle id is index of good_particlest2 = t1[t1['particle'].isin(good_particles.index)]
Cell 23 in the walkthrough removes individual timesteps that are not compliant, but it needs to remove the entire bad particle trajectory:
t2 = t1[((t1['mass'] > 50) & (t1['size'] < 2.6) & (t1['ecc'] < 0.3))]
should be something like:t1_means = t1.groupby('particle').mean()
good_particles = t1_means[(t1_means['mass'] > 50) & (t1_means['size'] < 2.6) & (t1_means['ecc']<0.3)]
# particle id is index of good_particles
t2 = t1[t1['particle'].isin(good_particles.index)]