Search code examples
pythonyfinance

YFinance stocks not appearing


I am using yfinance in Python to get a list of stocks from different dates, but I noticed the stock BRKB keeps appearing as None. Previously, I thought it was my code that was the problem but when I tried it in a shell, the same error occured. Does anyone know whether this is intentional, or if I am doing something wrong? enter image description here

enter image description here

enter image description here


Solution

  • The ticker symbol for Berkshire's B stocks is denoted with BRK-B not BRKB, as seen on the yahoo website.

    import yfinance as yf
    
    print(yf.Ticker("BRKB").info)
    print(yf.Ticker("BRK-B").info)
    

    Output:

    {'regularMarketPrice': None, 'preMarketPrice': None, 'logo_url': ''}
    {'zip': '68131', 'sector': 'Financial Services', 'fullTimeEmployees': 372000, 'longBusinessSummary': ...}