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

Start Date not Respected #280

Open
djleblan1 opened this issue Dec 17, 2022 · 1 comment
Open

Start Date not Respected #280

djleblan1 opened this issue Dec 17, 2022 · 1 comment

Comments

@djleblan1
Copy link

Hello.

I discovered an unexpected behaviour with this package. If I specify start and end dates consisting of the last 10 years for vector id "v1230996350" I end up with a dataframe populated with data points from 1956 until now. I am running Python 3.9.13 and stats_can 2.5.1. The following code block reproduces this issue for me in Jupyter Notebook.

from datetime import date, timedelta
from stats_can import StatsCan
end_date = date.today()
start_date = end_date - timedelta(days=365 * 10)
sc = StatsCan()
df = sc.vectors_to_df_remote(["v1230996350"], start_release_date=start_date, end_release_date=end_date)
df = df.reset_index(drop=False)
df

Thanks!

@ianepreston
Copy link
Owner

Hi @djleblan1 the start_release_date and end_release_date parameters refer to the date the data was released, not the reference period, which I think is what you're expecting. At the time I developed this the API for retrieving individual vectors only allowed reference by release date. Based on this it looks like there's a method that would allow retrieval by reference date. I can't promise I'll get around to adding that soon, but I'd look at a PR if you're interested in adding it.

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

2 participants