Handling the code
yahoo_financials =YahooFinancials('PG')
data =yahoo_financials.get_historical_price_data(start_date='1995-1-1')
i used this code to read the file and imported the required modules could you please tell me waht's the end date and time interval to make the code works .
PG = yf.download('PG')
also this code runs but appeared all the data set not only from 1-1-1995 .
Hi Omnia!
Thanks for reaching out.
You can add , end_date = ' ')
and specify the end date of the data you are interested in.
Otherwise, yes - the online financial data providers have been frequently changing their code/status of data they provide. That's why, in case you are unable to follow the course smoothly, we advise you to use the *.csv files provided to be able to do exactly that.
Then, once you've completed the course, you can look for various online sources, as shown in the course, and, if you prefer, register for an API and work with their data.
Hope this helps.
Kind regards,
Martin
PG = wb.DataReader('PG', data_source='yahoo', start='1995-1-1', end_date='2023-1-1') I receive error when I code this one.
Hi Ayberk!
Thanks for reaching out.
Can you please specify what error message you obtained (either by pasting the answer or a screenshot where we can clearly see what type of error message you obtained (in full)? Otherwise, we'd have to guess and doubt this would help you much in solving the problem properly.
Looking forward to your answer.
Best,
Martin