Skip to content
Advertisement

Remove comment from yfinance?

Every time I try to get ticker price using yFinance, it would print this comment:

[*********************100%***********************]  1 of 1 completed

Is there anyway to get rid of it?

data = yf.download(ticker, startDate.strftime("%Y-%m-%d"), endDate.strftime("%Y-%m-%d"))

Advertisement

Answer

The download method

def download(tickers, start=None, end=None, actions=False, threads=True,
             group_by='column', auto_adjust=False, back_adjust=False,
             progress=True, period="max", interval="1d", prepost=False,
             proxy=None, rounding=False, **kwargs):

has an undocumented parameter called progress that you should be able to set to False to disable the progress bar.

Try changing your download call to:

data = yf.download(
    ticker, startDate.strftime("%Y-%m-%d"), endDate.strftime("%Y-%m-%d"), progress=False)
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement