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
Traceback (most recent call last):
File "adllib.py", line 40, in
api_key=os.getenv('ALPHAVANTAGE_API_KEY'))
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas/util/_decorators.py", line 188, in wrapper
return func(*args, **kwargs)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/data.py", line 579, in DataReader
api_key=api_key,
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/base.py", line 100, in read
return self._read_one_data(self.url, self.params)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/base.py", line 112, in _read_one_data
return self._read_lines(out)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/av/time_series.py", line 112, in _read_lines
raise ValueError("Please input a valid date range")
ValueError: Please input a valid date range
def _read_lines(self, out):
data = super(AVTimeSeriesReader, self)._read_lines(out)
# reverse since alphavantage returns descending by date
data = data[::-1]
start_str = self.start.strftime("%Y-%m-%d")
end_str = self.end.strftime("%Y-%m-%d")
data = data.loc[start_str:end_str]
if data.empty:
raise ValueError("Please input a valid date range")
E ValueError: Please input a valid date range
../../av/time_series.py:112: ValueError
Best regards
arne
The text was updated successfully, but these errors were encountered:
Hello,
I have tried the example to get data from alpha vantage (https://pandas-datareader.readthedocs.io/en/latest/remote_data.html#historical-time-series-data) and I got a ValueError:
Traceback (most recent call last):
File "adllib.py", line 40, in
api_key=os.getenv('ALPHAVANTAGE_API_KEY'))
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas/util/_decorators.py", line 188, in wrapper
return func(*args, **kwargs)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/data.py", line 579, in DataReader
api_key=api_key,
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/base.py", line 100, in read
return self._read_one_data(self.url, self.params)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/base.py", line 112, in _read_one_data
return self._read_lines(out)
File "/home/arne/dev/python/stock/venv/lib/python3.5/site-packages/pandas_datareader/av/time_series.py", line 112, in _read_lines
raise ValueError("Please input a valid date range")
ValueError: Please input a valid date range
I have also tried the test procedure with pytest:
pytest -v test_av_time_series.py::TestAVTimeSeries::test_av_daily
============================================================================================================ test session starts ============================================================================================================
platform linux -- Python 3.5.2, pytest-5.3.2, py-1.8.1, pluggy-0.13.1 -- /home/arne/dev/python/stock/venv/bin/python
cachedir: .pytest_cache
rootdir: /home/arne/dev/python/stock
collected 1 item
test_av_time_series.py::TestAVTimeSeries::test_av_daily FAILED [100%]
================================================================================================================= FAILURES ==================================================================================================================
______________________________________________________________________________________________________ TestAVTimeSeries.test_av_daily _______________________________________________________________________________________________________
self = <pandas_datareader.tests.av.test_av_time_series.TestAVTimeSeries object at 0x7f85079867f0>
test_av_time_series.py:63:
../../../pandas/util/_decorators.py:188: in wrapper
return func(*args, **kwargs)
../../data.py:579: in DataReader
api_key=api_key,
../../base.py:100: in read
return self._read_one_data(self.url, self.params)
../../base.py:112: in _read_one_data
return self._read_lines(out)
self = <pandas_datareader.av.time_series.AVTimeSeriesReader object at 0x7f8507984eb8>
out = {'Meta Data': {'1. Information': 'Daily Prices (open, high, low, close) and Volumes', '2. Symbol': 'AAPL', '3. Last Re..., '1999-12-30': {'1. open': '102.1900', '2. high': '104.1200', '3. low': '99.6200', '4. close': '100.3100', ...}, ...}}
E ValueError: Please input a valid date range
../../av/time_series.py:112: ValueError
Best regards
arne
The text was updated successfully, but these errors were encountered: