In this article How to install and use pandas_datareader I will write.
pandas_datareader is a Python library that can collect economic data and price data of financial products.
Since it has the name pandas, it seems that it will be included with pandas (like it used to be), but it is a different mon. It is not included in Anaconda, so I have to install it. Get data with the Python library pandas_datareader-Python, books, kids, chat and
Library ↓ pandas-datareader — pandas-datareader 0.9.0rc1+2.g427f658 documentation
As mentioned above, pandas_datareader is a Python library. It is not included in Anaconda, so I will install it. Installation is done with pip.
pip install pandas_datareader
This completes the installation.
Try importing and using it to get the stock price. This time, let's take a look at the stock price of Toyota Motor Corporation. Since the security number is '7203', pass '7203.JP' as the first argument of DataReader and'stooq' as the second argument. I don't really understand'stooq', but I think it's an image of pulling stock prices from a site called'stooq'. (Please do not refer to it)
from pandas_datareader import data
df = data.DataReader('7203.JP', 'stooq')
df.head()
Execution result I will omit the details, but I was able to get the stock price.
This time, How to install and use pandas_datareader I wrote.
Keep in mind that you will be in trouble if you cannot get the stock price and graph it. In the future, we plan to improve graphing and data analysis.
Get data with the Python library pandas_datareader-Python, books, kids, chat and pandas-datareader — pandas-datareader 0.9.0rc1+2.g427f658 documentation
This article was written by a programming beginner and may be incorrect. Thank you for your understanding. Also, if you notice any mistakes, we would appreciate it if you could point them out. Thank you.
Recommended Posts