If you are a retail investor who is interested in the stock market, it is essential to research the stocks on your own. Yahoo Finance, among many other websites, provides stock data for users to interact with. For those who are versed with coding skills, there are a few API’s (application program interface) for programmatic access to Yahoo Finance data. yfinance, maintained by Ran Aroussi, is a Python module that provides access to multiple datasets.
This post will demonstrate some aspects of the yfinance module, and hopefully open the gateways for others to engage and explore.
Web scraping is a good way to obtain structured datasets from online sources, when desired structure does not readily exist for download. I have tried a few Python packages and my favorite is Beautiful Soup. I will use this post to document how I used it to scrape a corner of the U.S. News website, which is a source for various rankings (schools, hospitals etc.). The dataset I am aiming for is a detailed ranking of Pediatric Cancer hospitals, listed here. …
<The One Thing> evolves around the idea of Priority, and, Prioritizing what you ultimately want to do. It expands the topic with how to do it and how it benefits you. Co-authored by Gary Keller, cofounder and chairman of Keller Williams Realty, one of the largest real estate companies in the world, and Jay Papasan, vice president of learning at Keller Williams and Keller’s writing partner for more works, the book is a rather inspiring read, if not a little too self-help-ish. And it is not a long, boring read like many others, totaling about 230 pages.
In honor of…
when Python 2 won’t cut it anymore
Recently, I have been increasingly using Python 3 for some projects at work as well as some personal endeavors. I have been loyally using Python 2, as a habit retained from the first time I learned Python. I have the Anaconda distribution installed on all Macs I touch, so to be able to switch between 2 and 3, the task became adding Python 3 to Jupyter and enabling coding in notebooks with the kernel of choice.
Basically these 4 lines in Terminal did it for me:
python2 -m pip install ipykernel
python2 -m ipykernel…
The first time I learned about session variables was when I was trying to accomplish something like “find the top things with the n highest values in each group”. The article below gave me the idea (and the reference code) to make it happen.
Now, I’m occasionally using this to sort certain information that is not straightforward with a simple query. In addition, this is a great workaround to correlate information from different tables, where a simple join can’t do the trick. …
Data Science professional with experience in Finance, EV and Energy industries