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

DataReader - request to truncate retrieved data to specified dates #419

Closed
algotr8der opened this issue Nov 28, 2011 · 4 comments

Comments

@algotr8der
Copy link

commented Nov 28, 2011

Pandas version 0.6.0

from pandas.io.data import DataReader
import datetime
import matplotlib.pyplot as plt

sp500 = DataReader("SPY", "yahoo", start=datetime.datetime(2005, 1,1))
sp500.info()
sp500["Adj Close"].plot()
plt.show()

<class 'pandas.core.frame.DataFrame'>
Index: 4744 entries, 1993-01-29 00:00:00 to 2011-11-25 00:00:00
Data columns:
Open 4744 non-null values
High 4744 non-null values
Low 4744 non-null values
Close 4744 non-null values
Volume 4744 non-null values
Adj Close 4744 non-null values
dtypes: int64(1), float64(5)

As you can see the index begins at 1993-01-29 despite a user specified start date of 2005-1-1. You can specify any ticker and the start date specified in the DataReader function seems to be ignored.

Comment from Wes below:

The Yahoo API is very unreliable in my experience-- the code currently returns whatever data is returned by the query, so something must have changed recently there. I guess it should truncate to the passed date
range regardless of what is returned.

@ralphbean

This comment has been minimized.

Copy link
Contributor

commented Nov 29, 2011

I got this one. Will submit a pull request on Thursday.

@ralphbean

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2011

This issue is fixed in pull request 427 -- https://github.com/wesm/pandas/pull/427

@ralphbean

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2011

It's been merged in -- wesm@b6be1c0

This issue should be closed.

@wesm

This comment has been minimized.

Copy link
Member

commented Dec 2, 2011

verified fixed. thanks guys

@wesm wesm closed this Dec 2, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.