yannforget / pylandsat

Search, download, and preprocess Landsat imagery 🛰️
MIT License
65 stars 18 forks source link

non-existing method `sort_values` used in the README Python snippet #8

Closed pesekon2 closed 3 years ago

pesekon2 commented 3 years ago

In the section Examples in the README, there is the following code snippet:

# Results are returned as a list
scenes = catalog.search(
    begin=begin,
    end=end,
    geom=geom,
    sensors=['LE07', 'LC08']
)

# Get the product ID of the scene with the lowest cloud cover
scenes = scenes.sort_values(by='cloud_cover', ascending=True)

However, if you try to run it, it is going to fail with the following error:

AttributeError: 'list' object has no attribute 'sort_values'

The catalog.search() method returns a list object, and such object does not have any method sort_values() - probably a pandas DataFrame or something was expected?

yannforget commented 3 years ago

Thanks! Forgot to update the README when I removed the dependency to pandas.

I updated the section accordingly: https://github.com/yannforget/pylandsat/blob/master/README.md#search-the-catalog

pesekon2 commented 3 years ago

Thank you, everything seems fine to me now. Closing the issue as it was solved by ca6572bd25d9aefd3505119fe78027c281503a75 and c57b2c5ea54560437b03b0a6af268e6dfea82267.