yahoo-finance

File size is getting progressively larger as I continue to download data

File size is getting progressively larger as I continue to download data Question: I am downloading financial data using to_hdf and I have noticed that each file gets larger and larger as it keeps downloading. What is happening? The first file was saved as 223 KB and the most recent where I stopped (67) was …

Total answers: 2

Error "string indices must be integer" when selecting yahoo finance stock data with "start" and "end" dates

Error "string indices must be integer" when selecting yahoo finance stock data with "start" and "end" dates Question: I want to create a simple script that pulls stock data from yahoo finance with pandas_datareader package: from pandas_datareader import data stocks = data.DataReader(‘MSFT’, ‘yahoo’, start=’2020-01-14′, end=’2023-01-14′) but the code gets me "string indices must be integers" …

Total answers: 2

Python OHLC convert weekly to biweekly

Python OHLC convert weekly to biweekly Question: I have weekly data from Yahoo Finance Open High Low Close Adj Close Volume Date 1999-12-27 0.901228 0.918527 0.888393 0.917969 0.782493 1.638112e+08 2000-01-03 0.936384 1.004464 0.848214 0.888393 0.757282 3.055203e+09 2000-01-10 0.910714 0.912946 0.772321 0.896763 0.764417 3.345742e+09 2000-01-17 0.901786 1.084821 0.896763 0.993862 0.847186 3.383878e+09 2000-01-24 0.968192 1.019531 0.898438 0.907366 …

Total answers: 1

"TypeError: string indices must be integers" when getting data of a stock from Yahoo Finance using Pandas Datareader

"TypeError: string indices must be integers" when getting data of a stock from Yahoo Finance using Pandas Datareader Question: import pandas_datareader end = "2022-12-15" start = "2022-12-15" stock_list = ["TATAELXSI.NS"] data = pandas_datareader.get_data_yahoo(symbols=stock_list, start=start, end=end) print(data) When I run this code, I get error "TypeError: string indices must be integers". Edit : I have updated …

Total answers: 5

streamlit st.columns to show live stock data

streamlit st.columns to show live stock data Question: Problem statement: I need multiple columns in streamlit to categorize different stocks and show their current live value. I have 2 dummy columns as shown below (in the code) to track live values but the problem is instead of overwriting the current ticker value, it starts to …

Total answers: 2

download Yahoo Finance data with Python

download Yahoo Finance data with Python Question: I have this code but it doesn’t work and I don’t know why… please help! import numpy as np import pandas as pd from pandas_datareader import data TSLA = data.DataReader(‘TSLA’, ‘yahoo’, start=’2020-01-01′) print("TSLA:",TSLA) Traceback (most recent call last): File "C:UsersDavidDesktopdavidSonaPythonPRUEBA.py", line 4, in <module> TSLA = data.DataReader(‘TSLA’, ‘yahoo’, …

Total answers: 1

Scrape data from Yahoo Finance analysis page

Scrape data from Yahoo Finance analysis page Question: I am having issues parsing data from Yahoo Finance analysis page, e.g.https://finance.yahoo.com/quote/MSFT/analysis?p=MSFT. The main issue is that all tables on this page has the same class. I have managed to get an okay output but I am not sure how to access and match the headers with …

Total answers: 2

Getting TTM income statement yahoo finance using yahoo_fin

Getting TTM income statement yahoo finance using yahoo_fin Question: I try to get ttm values of the income statement for ticker symbol AAPL by using from yahoo_fin import stock_info as si import yfinance as yf import pandas as pd import matplotlib.pyplot as plt import pandas_datareader pd.set_option(‘display.max_columns’, None) income_statement = si.get_income_statement("aapl") income_statement but the result doesn’t …

Total answers: 1

How to fix new unable to read URL error in python for yahoo finance

How to fix new unable to read URL error in python for yahoo finance Question: I have been using this code to extract (scrape) stock prices from Yahoo Finance for the last year, but now it produces an error. Does anyone know why this is happening and how to fix it? # Importing necessary packages …

Total answers: 6