You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running tests, I am getting the following warning from numpy (current version):
[...]\pysolar\numeric.py:62: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dd = numpy.array(d, dtype='datetime64[D]') [...]\pysolar\numeric.py:63: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dy = numpy.array(d, dtype='datetime64[Y]') [...]\pysolar\numeric.py:74: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dh = numpy.array(d, dtype='datetime64[h]') [...]\pysolar\numeric.py:75: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dd = numpy.array(d, dtype='datetime64[D]') [...]\pysolar\numeric.py:86: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dm = numpy.array(d, dtype='datetime64[m]') [...]\pysolar\numeric.py:87: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future dh = numpy.array(d, dtype='datetime64[h]')
Deprecated since version 1.11.0: NumPy does not store timezone information. For backwards compatibility, datetime64 still parses timezone offsets, which it handles by converting to UTC. This behaviour is deprecated and will raise an error in the future.
The code below takes a timezone-aware datetime, converts it to UTC, and turns it into a timezone unaware one that can be passed to numpy. However, I am not sure the full functioning of the code and where it would need to be used in order not to introduce undesirable side effects (bugs).
d = d.astimezone(tz=datetime.timezone.utc).replace(tzinfo=None)
The text was updated successfully, but these errors were encountered:
Hi, I've just came across this issue because I encountered the same problem. I'd like to suggest you to try using pandas.to_datetime, this datetime object would then be tz aware. I'm about to do that for my app... Good luck!
When running tests, I am getting the following warning from
numpy
(current version):Per developer's manual at https://numpy.org/devdocs/reference/arrays.datetime.html#basic-datetimes
The code below takes a timezone-aware datetime, converts it to UTC, and turns it into a timezone unaware one that can be passed to numpy. However, I am not sure the full functioning of the code and where it would need to be used in order not to introduce undesirable side effects (bugs).
d = d.astimezone(tz=datetime.timezone.utc).replace(tzinfo=None)
The text was updated successfully, but these errors were encountered: