2021年5月1日星期六

Errors in yfinance

All, I've cut my teeth making a stock assessment python script in google colab (largely thanks to this community). 9/10 times, the code works perfectly to update a corresponding google sheets file. However, select stocks I use with the code have an interesting result. Rather than providing a table of earnings, it returns an empty DataFrame with columns for Open, Close, etc, aka, nothing having to do with earnings. Some sample tickers include PLTR, TRUP, and FICO. I'm curious if there is any cause for this other than just a bad data set for the given stocks OR any tips on how to handle this issue.

Returned result: Empty DataFrame Columns: [Open, High, Low, Close, Adj Close, Volume] Index: []

Sample code:

!pip install git+https://github.com/rodrigobercini/yfinance.git  !pip install gspread-formatting  import yfinance as yf, datetime, pandas as pd, gspread, gspread_formatting as gsf  from datetime import date  ################################  stock = yf.Ticker("pltr")  info = stock.info    print(stock.earnings)  
https://stackoverflow.com/questions/67352749/errors-in-yfinance May 02, 2021 at 11:30AM

没有评论:

发表评论