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

Since late last night, I started getting errors running the python package for Meteosat with both my own code and with the sample code when the output of the point() function is used to call the Daily() or Hourly() functions. #28

Closed
GangaBisht opened this issue Apr 7, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@GangaBisht
Copy link

Set time period

start = datetime(2018, 1, 1)
end = datetime(2018, 12, 31)

Create Point for Vancouver, BC

vancouver = Point(49.2497, -123.1193, 70)

Get daily data for 2018

data = Daily(vancouver, start, end)
data = data.fetch()


TypeError Traceback (most recent call last)
in
12
13 # Get daily data for 2018
---> 14 data = Daily(vancouver, start, end)
15 data = data.fetch()
16

~\anaconda3\lib\site-packages\meteostat\daily.py in init(self, loc, start, end)
231 self._stations = loc.index
232 elif isinstance(loc, Point):
--> 233 stations = loc.get_stations('hourly', start, end)
234 self._stations = stations.index
235 else:

~\anaconda3\lib\site-packages\meteostat\point.py in get_stations(self, granularity, start, end)
77
78 # Apply inventory filter
---> 79 stations = stations.inventory(granularity, (start, end))
80
81 # Apply altitude filter

~\anaconda3\lib\site-packages\meteostat\stations.py in inventory(self, granularity, required)
238 temp._stations = temp._stations[
239 (pd.isna(temp._stations[granularity + '_start']) == False) &
--> 240 (temp._stations[granularity + '_start'] <= required[0]) &
241 (
242 temp._stations[granularity + '_end'] +

~\anaconda3\lib\site-packages\pandas\core\ops\common.py in new_method(self, other)
63 other = item_from_zerodim(other)
64
---> 65 return method(self, other)
66
67 return new_method

~\anaconda3\lib\site-packages\pandas\core\arraylike.py in le(self, other)
39 @unpack_zerodim_and_defer("le")
40 def le(self, other):
---> 41 return self._cmp_method(other, operator.le)
42
43 @unpack_zerodim_and_defer("gt")

~\anaconda3\lib\site-packages\pandas\core\series.py in _cmp_method(self, other, op)
4976 rvalues = extract_array(other, extract_numpy=True)
4977
-> 4978 res_values = ops.comparison_op(lvalues, rvalues, op)
4979
4980 return self._construct_result(res_values, name=res_name)

~\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py in comparison_op(left, right, op)
241
242 elif is_object_dtype(lvalues.dtype):
--> 243 res_values = comp_method_OBJECT_ARRAY(op, lvalues, rvalues)
244
245 else:

~\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py in comp_method_OBJECT_ARRAY(op, x, y)
53 result = libops.vec_compare(x.ravel(), y.ravel(), op)
54 else:
---> 55 result = libops.scalar_compare(x.ravel(), y, op)
56 return result.reshape(x.shape)
57

pandas_libs\ops.pyx in pandas._libs.ops.scalar_compare()

TypeError: '<=' not supported between instances of 'str' and 'datetime.datetime'

@GangaBisht GangaBisht changed the title Issue when using the output of Point() with Daily() and Hourly() Since late last night, I started getting errors running the python package for Meteosat with both my own code and with the sample code when the output of the point() function is used to call the Daily() or Hourly() functions. Apr 7, 2021
@clampr
Copy link
Member

clampr commented Apr 7, 2021

Please let me know if this helps: #26 (comment)

@clampr clampr added the bug Something isn't working label Apr 7, 2021
@clampr clampr closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants