VSCode python snippet:
import yfinance as yf
from datetime import date
end_date = date.today() <— The color of today is yellow. Right click on today and then
click on “Go to Definition”, it works.
data = yf.download(ticker, start=start_date, end=end_date)
print(data.head()) <— The color of head is white. Right click on head
and then click on “Go to Definition”, it does NOT work.
average_yield = data[‘Close’].mean() <— The color of mean is white. Right click on mean
and then click on “Go to Definition”, it does NOT work.
OS: Windows
language server is set to Pylance
When try to go to the definition of both head() and mean(), the error message is “No definition found for head or mean”.
Why it works for today() method of date but not for head() and mean()?
Very strange behavior. Anyone has any idea?