yfinance download(...) function returns either pandas Series or DataFrame
yfinance download(...) function returns either pandas Series or DataFrame. It's quite troublesome. I have to wrap the function in some function that will return dataframe anyway, but you'd better fix this issue eventually.
the code:
tickers = ['A', 'AA']
df = yf.download(tickers)['Close']
# print('close columns for many tcikers = ', df.columns)
print('type of df many tcikers = ', type(df)) # Dataframe
tickers = ['A']
df = yf.download(tickers)['Close']
print('type of df for one ticker = ', type(df)) # Series
download() is actually returning a Dataframe in both cases. You are then accessing a single column 'Close', you are creating the problem.
Your entitled attitude is not helping. yfinance is OSS - you have not paid for it, and no one is being paid to contribute. You are free to contribute.
If you think that all the people should help you with this library you are deadly wrong. And, as I see, there will be no support from you on this issue, so I close it.