Download Financial Data from Yahoo Finance using Python
ฝัง
- เผยแพร่เมื่อ 1 ส.ค. 2024
- 【Online Courses】
⚡Getting Started with Stata: (24 lectures + 4 assignments = 5.5 hours content): available on Udemy: www.udemy.com/course/getting-...
⚡Applied Time Series using Stata (29 lectures + 4 assignments = 6.5 hours content): available on Udemy: www.udemy.com/course/applied-...
This tutorial covers the Python package yfinance, which enables us to connect to Yahoo Finance (API). We download data for the Bitcoin-USD trade and work with the Pandas DataFrame. Finally, we visualise the data using Matplotlib.
The material including the code is on GitHub (github.com/GerhardKling/DataW....
I show you how to create and activate a virtual environment (which is optional - but useful to do). We use the pip installer.
If you do not have the pip installer, download get-pip.py. The download needs to be in same path as your Python installation - then change the directory into the folder. Using the command line, type: python get-pip.py, and finally check the installation: pip -V.
To install virtual environments, use: pip install virtualenv
Please leave a comment if you have any questions. Python is the way!
The channel
YUNIKARN focuses on publishing educational content in applied statistics, mathematics, and data science. In these fields, programming skills have become essential. Hence, we cover various programming languages including Python, Stata, and C++ to tackle problems and for fun.
Stay in touch
Please leave comments or follow us on Twitter ( / gerhardklings . DMs are open.
Hashtags
#datascience #python #yahoofinance
The full course is available for USD 3.59 here www.yunikarn.com/p/data-science-using-stata-complete-beginners-course, including datasets and Stata do files. The slides are available as an E-book (129 pages) gerhard-kling-s-school.teachable.com/p/my-downloadable-14033 - combined offer: USD 5.40.
Thanks, your guide helped me alot. I really appreciate your effort and share of knowledge. subscribed happily
I am glad it was useful. Welcome to our data nerd community!
Thanks for the video. is there a list of the tickers that can be used?
I am glad you liked it! You can get tickers from a Yahoo Finance search. Simply look for the company name and you get the ticker. If you want to get all stocks in an index, you can find lists online (e.g., S&P 500 en.wikipedia.org/wiki/List_of_S%26P_500_companies). You can also use other databases to obtain tickers.
Thanks
Fast, informative, useful.
Maybe instead of coffee u be drink nootropic)
Good luck
I am glad you find it useful. I am quite addicted to coffee and tea (afternoons) 🤓
how to export this as a csv file?
Sure. You can write a Pandas DataFrame to CSV files. Look for pandas.DataFrame.to_csv and you will find more details about parameters etc.
@YUNIKARN thanks I figured it out. The csv exports with data all in one column Tho. How to format it so data is split properly into columns?
@@christalball93_ I did a video which might address your issue: th-cam.com/video/TENfyla9uK8/w-d-xo.html