Skip to content
Advertisement

Can yfinance download 2 columns only?

Right now, I want to download historical prices for some tickers but I don’t need the full download, only the date and close price.

Currently I am doing this way :

JavaScript

As you can see, I download the whole “package” then delete the useless columns. The future problem with this way is : if I need to download data for 10’000 companies, I will lose quite sometimes in the process.

Normal download

JavaScript

what I am looking for

JavaScript

Advertisement

Answer

JavaScript

Returns only one price

Output:

JavaScript

Also, if you request all the data, you can try to delete the unnecessary immediately

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement