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

Bug in Stations module #153

Open
tomaslg opened this issue Apr 11, 2024 · 0 comments
Open

Bug in Stations module #153

tomaslg opened this issue Apr 11, 2024 · 0 comments

Comments

@tomaslg
Copy link

tomaslg commented Apr 11, 2024

Hi,

I was setting a different computer after writing my code (which worked on my previous machine) and found the following issue:

Packages versions:
meteostat-1.6.7
pandas-2.1.3

Within Python 3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0] on linux I run:

from meteostat import Stations; Stations().nearby(-33.25531944281872, 150.67298892336152)

Then I get the following error:

Traceback (most recent call last):
File "", line 1, in
File "/home/tomas/anaconda3/lib/python3.11/site-packages/meteostat/interface/stations.py", line 128, in nearby
temp._data = temp._data.sort_values("distance")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/frame.py", line 6974, in sort_values
new_data = self._mgr.take(
^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 877, in take
return self.reindex_indexer(
^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 670, in reindex_indexer
new_blocks = [
^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 675, in
fill_value if fill_value is not None else blk.fill_value
^^^^^^^^^^^^^^
File "properties.pyx", line 36, in pandas.libs.properties.CachedProperty.get
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/blocks.py", line 230, in fill_value
return na_value_for_dtype(self.dtype, compat=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/dtypes/missing.py", line 670, in na_value_for_dtype
return dtype.na_value
^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/arrays/string
.py", line 106, in na_value
if self.storage == "pyarrow_numpy":
^^^^^^^^^^^^
AttributeError: 'StringDtype' object has no attribute 'storage'

I would greatly appreciate if you could help me sort out this problem or fix it in future versions.

Thanks!

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

1 participant