This is a great informative video. I really enjoyed watching it twice. The first to get the whole Idea. The second I've practised everything. Thank you for the great content. But you have to upload more videos because your style is unique.
13:09, 28lines , I typed the codes which are exatly same with you, but It didn't work with this message, [ValueError: No tables found], What's the problem ? Can you help me?
Thanks a lot. I was previously scraping data from the website. It was automatic but took sometime using my script which required data cleaning. But I got the same with a SINGLE LINE. Damn this is good :)
It would be best to simply download the ticker data then call the pct_change method on the dataset in order to get the needed feature. See the example below: import yfinance as yf import pandas as pd apple = yf.download("AAPL") apple_pct_change = df.pct_change()
good content. but I'm at a loss to understand how this could help my investing efforts. I'd guess I want to know how I can apply this knowledge and data to supercharge my investing efforts. for example, calculating ROE, profit margin etc can already be done on excel, charts are already available on yahoo finance etc, screening tools are available. so how python can help me? (not trolling, just looking for answers)
Hello, your video is very interesting. A question please, how can I download all the shares (Only the ticket symbol) that are in the S & P500 or NASDAQ for example AAPL, AMZN, TSLA etc.? Thank you very much and greetings from Mexico.
I made a video about grabbing all of the stock data for a specific index here: ruclips.net/video/K_JQlIDzBpY/видео.html. You could modify this example using the FTSE MIB wiki page.
Saw a question from you but cannot seem to find it on the comments, but below is the answer you were looking for. Hope this helps. import yfinance as yf tickers = yf.Tickers('msft aapl goog') # ^ returns a named tuple of Ticker objects # access each ticker using (example) tickers.tickers['MSFT'].info tickers.tickers['AAPL'].history(period="1mo") tickers.tickers['GOOG'].actions
Hello! Love your video! Newbie to Python - trying to run through this but experiencing some error when trying to scrape the Major World Indices page. Basically it is saying "Value Error: No tables found" - did some Googling on comments with that error suggesting perhaps it is a dynamic table could be the issue. Is there a fix to this? Thanks!
I had the same issue. After some research, turns out that the Yahoo site apparently has a disdain for bots, so will only provide a very truncated response, but I guess it's only some of us it doesn't like. I found the following workaround on Stack Overflow, which adds a header to the read request. Since read_html() doesn't seem to support a header argument, you can use the requests module to request the html (which supports adding a header), then use read_html() to parse it. Maybe someone knows of a more elegant solution. Essentially, replace major_indices = pd.read_html("finance.yahoo.com/world-indices")[0] with the following import requests headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'} url = 'finance.yahoo.com/world-indices' r = requests.get(url, headers=headers) Seems to work for me...
Hello, when trying to scrape these index tickers, I am getting a 'table not found' error. I have all the same dependencies, and am using jupyter, not colab. Do you think yahoo has changed something since uploading this video to prevent scraping, or am i getting something wrong? Thanks for the video!
Sometimes the table not found is due to the fact that there is no html table on the webpage. That is if you are trying to scrape. However, if you are using yfinance to collect the data based on the ticker it most likely means that yahoo does not have the data from that ticker.
Really appreciate, I am a begiinner of python and learnt a lot from this video. A question please, I duplicate your coding "major_indices..." and it shows "no tables found", how can I fix this? Thank you very much.
It would definitely be a good start. But I would suggest making something with a little more analysis and visualization. For example, make an interactive graphic for them using the data you pulled or do a CAPM analysis et.
When you were downloading the data there must have been an error. The type of the data frame should be a pandas DataFrame not a list. Re-download the data and make sure the type of the data frame is correct.
i kept getting error at tesla_data=tesla.history(period='max') AttributeError: 'Index' object has no attribute 'tz_localize' i still dont know what to do... please help me sir, thank you
Not just a good video, this was a GREAT video! Thank you very much for the dive into yfinance, very helpful!
You are very welcome! Glad it was helpful!
Thank you so much for Information & Greetings from INDIA 👍👍👍
It's my pleasure
This is a great informative video. I really enjoyed watching it twice. The first to get the whole Idea. The second I've practised everything. Thank you for the great content. But you have to upload more videos because your style is unique.
Do you find any errors on running the code on Pycharm?
Hi from Tajikistan
thanks a lot bro
I leared more from you
My pleasure
I stumbled on your page, and I am super grateful I did!
What a dime of the content. Speechless!
13:09, 28lines , I typed the codes which are exatly same with you, but It didn't work with this message, [ValueError: No tables found], What's the problem ? Can you help me?
Forget my ignorance,but it look like yahoo is blocking stock info,
Recently,yahoo have changed it
Thanks for sharing the information 😊
My pleasure 😊
Thanks a lot. I was previously scraping data from the website. It was automatic but took sometime using my script which required data cleaning. But I got the same with a SINGLE LINE. Damn this is good :)
Thank you! I have a playlist of more finance related videos. Check them out here:
ruclips.net/p/PLlbbWgBRF8EfO4WX13yEWlDUxkHsGPRdV
Hi from VietNam, thanks a lot sir, this is a great video
3:20 can't c the adjusted close values which yfinance offers.
Thank you! It's very useful🥰
Can you please explain how you have your environment setup here? Editor etc. & output looks stunning!!
Hey! Thank you so much for this great ideo. I wanted to kindly ask how can you view the Python documentation in VS Code?
Loved it. Thank you sir!
excellent video ! I have a big problem to access US Treasury Bonds Rate TNX : Last price , is it even possible by using yfinance API?
Great Content, But just wanted to know how can i extract static reference data (Sedol,Ticker,ISIN, Exchange etc) in bulk.
What about the same with VS Code for Chromebook linux
Great video
Glad you enjoyed it!
I love how in the earnings report section, you never talked once about earnings reports
how do i get only the last balance sheet ? and how do in normalize numbers ?
can you make a candle stick chart
Is there any method to get daily short interest rates from yahoo finance on python?
Is there a Jupyter Notebook for this video?
This is amazing, If you can domore of this it would be great!!!
Great Video ! If you have sometime please create more videos on Finance and Python.
How do I pull financial statements? Especially since the company's inception? Yahoo finance website shows only recent 3 years.
I just need to retrieve data about income statement is there any way to do it ?
Some companies have that data available via yfinance some don't. You can also scrape the data if need be.
If i want the pct_change of multiple symbols downloaded fron yfinance?
It would be best to simply download the ticker data then call the pct_change method on the dataset in order to get the needed feature. See the example below:
import yfinance as yf
import pandas as pd
apple = yf.download("AAPL")
apple_pct_change = df.pct_change()
good content. but I'm at a loss to understand how this could help my investing efforts. I'd guess I want to know how I can apply this knowledge and data to supercharge my investing efforts. for example, calculating ROE, profit margin etc can already be done on excel, charts are already available on yahoo finance etc, screening tools are available. so how python can help me? (not trolling, just looking for answers)
Excuse my ignorance, I have no idea of the programming and python. May I ask, what interface are you using to do the analysis?
I'm using Google Colab.
@@DataScienceforEveryone Thank you so much for your kind reply
What platform are you using to run Python? Visual Studio Code is not good enough to run it.
33:56 haha
Greetings from Chile :P
@17:30 I think if you kept that ^ sign in front of the ticker symbols, it would work
Hello, your video is very interesting. A question please, how can I download all the shares (Only the ticket symbol) that are in the S & P500 or NASDAQ for example AAPL, AMZN, TSLA etc.? Thank you very much and greetings from Mexico.
I liked your comment so much I made a video. Here you go!
ruclips.net/video/K_JQlIDzBpY/видео.html
@@DataScienceforEveryone Thank you very much brother. I already watched the video with its respective like. Regards!
how to make the stocks list in list order and not in alphabetical order?
great video
what platform were you using for the demonstration in the video?
I'm using Google Colab.
Hi, instead of working with world indices, how do i work with only italian indices? Not the best 30, but all. Is there a page with that? Thank you
I made a video about grabbing all of the stock data for a specific index here: ruclips.net/video/K_JQlIDzBpY/видео.html.
You could modify this example using the FTSE MIB wiki page.
Saw a question from you but cannot seem to find it on the comments, but below is the answer you were looking for. Hope this helps.
import yfinance as yf
tickers = yf.Tickers('msft aapl goog')
# ^ returns a named tuple of Ticker objects
# access each ticker using (example)
tickers.tickers['MSFT'].info
tickers.tickers['AAPL'].history(period="1mo")
tickers.tickers['GOOG'].actions
Hello! Love your video! Newbie to Python - trying to run through this but experiencing some error when trying to scrape the Major World Indices page. Basically it is saying "Value Error: No tables found" - did some Googling on comments with that error suggesting perhaps it is a dynamic table could be the issue. Is there a fix to this? Thanks!
Double check the url that you are passing to the pd.read_html().
"Value Error: No tables found" means that there are no
I had the same issue. After some research, turns out that the Yahoo site apparently has a disdain for bots, so will only provide a very truncated response, but I guess it's only some of us it doesn't like. I found the following workaround on Stack Overflow, which adds a header to the read request. Since read_html() doesn't seem to support a header argument, you can use the requests module to request the html (which supports adding a header), then use read_html() to parse it. Maybe someone knows of a more elegant solution.
Essentially, replace
major_indices = pd.read_html("finance.yahoo.com/world-indices")[0]
with the following
import requests
headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'}
url = 'finance.yahoo.com/world-indices'
r = requests.get(url, headers=headers)
Seems to work for me...
Have the same issue here.
Any fix work for you?
@@Myhands14 There was some recent API changes. If you are still having some issues.
Try:
pip install yfinance --upgrade --no-cache-dir
@@DataScienceforEveryone not working for me.
How can fetch all stocks and futures?
Take a look here. I think this is what you are looking for. ruclips.net/video/K_JQlIDzBpY/видео.html
Thanks. I would like fetch all stocks, not just s&p 500. I'm also interested in data cleaning based on all stocks. Do you have any recommendation?
Hello teacher, what is this editor? It looks jupyter, but seems like not jupyter...
I this video I am using Google Colab.
Some of the functions are not working.. They are giving errors.. What should I do?
thank you for your effort, I'm wondering that what's the python environment you work on? :)
google collab
Hello, when trying to scrape these index tickers, I am getting a 'table not found' error. I have all the same dependencies, and am using jupyter, not colab. Do you think yahoo has changed something since uploading this video to prevent scraping, or am i getting something wrong?
Thanks for the video!
Sometimes the table not found is due to the fact that there is no html table on the webpage. That is if you are trying to scrape. However, if you are using yfinance to collect the data based on the ticker it most likely means that yahoo does not have the data from that ticker.
When i try to take the major world indicies python requires lxml package, but i have it.. 4.8.0
Go through and update your packages. There may be an incompatibility. If not, downgrade lxml
What IDE is that?
Really appreciate, I am a begiinner of python and learnt a lot from this video. A question please, I duplicate your coding "major_indices..." and it shows "no tables found", how can I fix this? Thank you very much.
Double check the web address to see if there is a table on that webpages html.
@@DataScienceforEveryone it really isn't working. I don't know if it's a colab update but another time I'll try again
any known fixes yet? the tutorial was great but I cannot continue
@@dimmak8206 not yet :(
Why was there no information for financials/balance sheets/etc?
It depends on the company. Some of the datasets have extra information, some do not.
Would a similar project to this look good on a github resume?
It would definitely be a good start. But I would suggest making something with a little more analysis and visualization. For example, make an interactive graphic for them using the data you pulled or do a CAPM analysis et.
AttributeError: 'list' object has no attribute 'plot' got this error trying to plot the history.
I solved it already so all fine good video! ^^
When you were downloading the data there must have been an error. The type of the data frame should be a pandas DataFrame not a list. Re-download the data and make sure the type of the data frame is correct.
yfinance dosent download properly any fixes?
It depends on the error you are getting. Usually you need to update the dependencies.
Consulta Por que no salen los balances??
Some of the Yahoo Finance data has the data. Some datasets do not have the data. It just depends on the company you select.
@@DataScienceforEveryone Check out financialmodelingprep.com, you can get the fundamentals there. Only for US stockmarket though.
This is so great
Thank you!
this is amazing
i kept getting error at
tesla_data=tesla.history(period='max')
AttributeError: 'Index' object has no attribute 'tz_localize'
i still dont know what to do...
please help me sir, thank you
For some tickers we can't pull the data. ('infos')
Thank you so much 🙂
Thanks a lot!
the ^ shouldn't be omitted I think, that's why it's not found
thnks!
'Yfinance failed to decrypt Yahoo data response' and I had to learn it is probably dead because Yahoo does not want to be nice anymore
Rut did not get delisted for sure ☺
Thanks!