Open fayazr opened 7 years ago
In cell 7 the 'frame' column is added to the features.
https://github.com/soft-matter/trackpy-examples/blob/master/notebooks/custom-feature-detection.ipynb
What are the columns in your data frame?
(I know this question is a bit old, but hopefully this answer helps anyone running into this in the future.)
If the features dataframe is empty, you'll see this exception. This happened to me when I was trying to update the scikit-image interface; when I implemented the scikit-image method calls incorrectly, no features were detected, and the dataframe was empty. If you try
print(features)
and see that the dataframe is empty, that's what's causing the error. The fix is to make sure you're detecting features in each image. You can modify the loop over each frame to show the labeled features in the frame, to check what's going on.
When I use:
tp.annotate(features[features.frame==id_example], img_example)
I get the following error:
AttributeError Traceback (most recent call last)