trackpy.motion.theta_entropy

trackpy.motion.theta_entropy(pos, bins=24, plot=True)

Plot the distribution of directions and return its Shannon entropy.

Parameters:
posDataFrame with columns x and y, indexed by frame
binsnumber of equally-spaced bins in distribution. Default 24.
plotplot direction histogram if True
Returns:
floatShannon entropy

Examples

>>> theta_entropy(t[t['particle'] == 3].set_index('frame'))
>>> S = t.set_index('frame').groupby('particle').apply(tp.theta_entropy)