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

Date as index for pandas dataframe #38

Closed
stnatter opened this issue Dec 28, 2017 · 12 comments
Closed

Date as index for pandas dataframe #38

stnatter opened this issue Dec 28, 2017 · 12 comments

Comments

@stnatter
Copy link

Hello. will the recent update the index column is now an int index. Would be great if there would be an option to have the date as index again. Makes zero sense for me to have an integer index. Thanks for your consideration.
Steffen

@RomelTorres
Copy link
Owner

Hi @SteffenNa, i will be travelling for a few weeks but I will hopefully have time to address this. I am just going to make it configurable so that the integer and date index behaviour are possible. It is a rather simple change (if you want to tackle it pull requests are more than welcome) I think, the best is to document that behaviour properly in the readme ;)

Saludos
Romel

@stnatter
Copy link
Author

Great. thanks Romel. Enjoy your travels and be safe!

@PeterAVG
Copy link

But it does not work now when running the suggested commands on front page. I get the error:
argument of type 'int' is not iterable

How can I circumvent this?
/Peter

@RomelTorres
Copy link
Owner

@PeterAVG can you let me know about your set up? Someone had this error too but I don't get it reproduced. There is already an issue opened up on the same error. Best regards, Romel

@PeterAVG
Copy link

I get the error by running your suggested code in the plotting section in readme.md:
ts = TimeSeries(key=api_key, output_format='pandas') data, meta_data = ts.get_intraday(symbol=stock,interval='1min', outputsize='full')
I am using python 3.6.1.

@RomelTorres
Copy link
Owner

@PeterAVG, Ok I will try to have a look again and see what I am missing.

@RomelTorres
Copy link
Owner

Hi @SteffenNa, I just pushed the changes to the develop branch. If you want, you can install the development branch version and let me know your thoughts. It has two changes: the indexing and the column naming of the pandas data frames are now the originals produced by the alpha vantage call (I am not removing anything to make it look prettier.)

@stnatter
Copy link
Author

Thanks Romel will try to take a look ASAP. really swamped though these days....

@stnatter
Copy link
Author

stnatter commented Jan 6, 2018

Hi Romel.
Happy New Year! Hope you had a nice holiday.

Just installed the upgrade to 1.8.0 Unfortunately it does not seem to work:

In [105]: from alpha_vantage.timeseries import TimeSeries

In [106]: ts = TimeSeries(key=API_key, output_format='pandas', indexing_type='da
...: te', retries=9)
...:

TypeError Traceback (most recent call last)
in ()
----> 1 ts = TimeSeries(key=API_key, output_format='pandas', indexing_type='date', retries=9)

TypeError: init() got an unexpected keyword argument 'indexing_type'

However leaving out the 'indexing_type' argument it works as described. Thanks for this!!!
Much appreciated

Steffen

@RomelTorres
Copy link
Owner

Hi, can you verify that the installation of the 1.8.0. Succeeded, it looks like it is not properly installed because the latest version with the indexing type works for me... with the version 1.8.0 installed.

@stnatter
Copy link
Author

stnatter commented Jan 7, 2018

weird. installation seems ok. anyways. doesn't matter much as it works as long as default index is 'Date'. May i ask why you changed the column headers? In my humble opinion your previous solution ('open', 'high', 'low', 'close', ...) was superior and consistent with what you get back from other data providers.

@RomelTorres
Copy link
Owner

RomelTorres commented Jan 7, 2018

hi @SteffenNa, I should not modify the content of the data provided by alpha vantage even the names of columns, also doing that might lead to errors on other calls (which it did). Using their names is consistent with what alphavantage offers in their API and examples. Leaving me with less support to give.

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

3 participants