Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas #1799

Closed
x945 opened this issue Dec 25, 2023 · 0 comments

Comments

@x945
Copy link

x945 commented Dec 25, 2023

Describe bug

I get the error when I attempt to get earning_dates of some tickers such as FITBP

Simple code that reproduces your problem

import yfinance as yf
f_ticker = yf.Ticker('FITBP')
f_earning = f_ticker.earnings_dates
Warning (from warnings module):
  File "/home/ahmed/.local/lib/python3.10/site-packages/yfinance/base.py", line 2126
    dates.loc[dates[cn] == '-', cn] = "NaN"
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'NaN' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

Warning (from warnings module):
  File "/home/ahmed/.local/lib/python3.10/site-packages/yfinance/base.py", line 2126
    dates.loc[dates[cn] == '-', cn] = "NaN"
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'NaN' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

Warning (from warnings module):
  File "/home/ahmed/.local/lib/python3.10/site-packages/yfinance/base.py", line 2126
    dates.loc[dates[cn] == '-', cn] = "NaN"
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'NaN' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

Debug log

yf.enable_debug_mode()
f_earning = f_ticker.earnings_dates
DEBUG    Entering get_earnings_dates()
DEBUG    Exiting get_earnings_dates()

Bad data proof

No response

yfinance version

0.2.33

Python version

Python 3.10

Operating system

Ubuntu 22.04.3 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants