Skip to content

AttributeError: 'DataFrame' object has no attribute 'sort_values' #65

Description

@sminot

Using the docker image for aweimann/traitar:release (38eaf28de0a1), I got the following error:

Traceback (most recent call last):
  File "/usr/local/bin/hmmer2filtered_best", line 15, in <module>
    aggregate_domain_hits(filtered_df, args.out_best_f)
  File "/usr/local/lib/python2.7/dist-packages/traitar/hmmer2filtered_best.py", line 52, in aggregate_domain_hits
    filtered_df.sort_values(by = ["target name", "query name"], inplace = True)
  File "/usr/lib/python2.7/dist-packages/pandas/core/generic.py", line 1815, in __getattr__
    (type(self).__name__, name))
AttributeError: 'DataFrame' object has no attribute 'sort_values'

FIX: My guess is that this is a problem with the version of Pandas in the image. So I updated pandas in the container to pandas==0.20.3 with pip. I also updated numexpr to 2.4.6 for compatibility with that version of pandas.

RESULT: After making those two updates, traitar ran with no errors.

SUGGESTION: Pin all the various versions of python packages that work (pip freeze > requirements.txt) and then use that list to install from in the Dockerfile (pip install -r requirements.txt) to avoid a confounding effect of the most recent version at build time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions