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
I'm getting an error just like this and tried your date change - does not appear to be a fix for this. Can you try this yahoo api once more and let me know if its working for you. The error is encountered in Python for Finance 1
, and thrown inside save_to_csv_from_yahoo()
Hi Derek, thanks for your awesome videos!
In Python for Finance
https://www.youtube.com/watch?v=nNkKTJTu-mU&list=PLGLfVvz_LVvTHOWIEBAl-YOr_FC8lRmWX
your output shows that Amazon's stock price rose by ~18% in 2020; I think by your calculation in
def get_return_defined_time:
the number should be
0.6166401575831238
The bug is in your date formatting. Where you compare a date formatted like this:
start = f"{syear}-{smonth}-{sday}"
which look like this:
2020-1-1
with dates in your dataframes that look like this:
2020-01-01
your date comparison fails much of the time.
I think if you change your date formatting from this:
start = f"{syear}-{smonth}-{sday}"
to this
start = dt.datetime(syear, smonth, sday).strftime("%Y-%m-%d")
you will be good to go!
The text was updated successfully, but these errors were encountered: