Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in bubble tracking example #41

Open
fayazr opened this issue Oct 21, 2016 · 2 comments
Open

Error in bubble tracking example #41

fayazr opened this issue Oct 21, 2016 · 2 comments

Comments

@fayazr
Copy link

fayazr commented Oct 21, 2016

When I use:

tp.annotate(features[features.frame==id_example], img_example)

I get the following error:

AttributeError Traceback (most recent call last)
in ()
----> 1 tp.annotate(features[features.frame==id_example], img_example)

C:\Users\Fayaz\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandas\core\generic.pyc in getattr(self, name)
2667 if name in self._info_axis:
2668 return self[name]
-> 2669 return object.getattribute(self, name)
2670
2671 def setattr(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'frame'

@tacaswell
Copy link
Member

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?

@charlesreid1
Copy link
Contributor

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants