Analyzing Stock Screener Data for Investing

Posted on Dec 20, 2019


The world of investing has always been fraught with a myriad of choices and decisions one must make to succeed. Everything from what financial products to invest in to when to purchase or sell. Stock screeners have been a tool that has made it easy to filter stocks based on user-defined metrics. I wanted to scrape data from a stock screener named "Finviz" in order to explore the stocks in the "New York Stock Exchange" (NYSE).

The objective of this web scraping project was to visualize the important data sets one must examine when an individual such as a portfolio manager is deciding what type of stocks to invest in over the long term.


All data the was scraped from the stock screener located at The filter was set to extract information from the NYSE. This resulted in 4353 rows of data with 11 different columns. "Scrapy" was used as the means of extracting the data.

Information Extracted:

  • No (Number)
  • Ticker
  • Company
  • Sector
  • Industry
  • Country
  • Market Cap
  • PE
  • Price
  • Change 
  • Volume

Data Analysis:

How many stocks are in each sector of the  NYSE?

The financial sector is the sector with the greatest number of stocks. An investor looking to diversify a portfolio must make sure they do not over-invest in the financial sector. 

What are the 5 top countries represented in the NYSE?

The top five countries in the NYSE are the USA, Canada, China, the United Kingdom and Brazil. An investor would get a better an idea of how to diversify a portfolio internationally and which countries to focus on. Nevertheless, the USA makes up a large portion of the NYSE.

What are the five (5) most popular industries?

Exchange traded funds makes up the top industry in the NYSE followed by closed end funds. This information would also help investors not be overexposed to any one industry.

What are the PE ratios in the NYSE?

PE ratios are price earning ratios and they are used to measure the share price of a stock relative to the annual net income earned by the firm per share. A high PE ratio usually means a stock is overvalued whereas a low PE ratio means the stock is undervalued.

The above chart has removed all PE ratios that are 0 or negative resulting in the highest range of PE ratios in the 15 to 20 range.

Examining sectors with respect to PE

It is a good idea to examine the relationship between the PE ratios and respective sectors of the economy. This would give an investor a good idea of which sectors are undervalued and overvalued.

All sectors except for the "financial sector" and "conglomerate sector" have an interquartile range between 0 and 22. The conglomerate sector has a few outliers but no interquartile range showing. The financial sector is also not showing an interquartile range but rather a spattering of PE values between approximately 22 to 50.

Analyzing the relationship between price, PE and the sectors 

The chart above shows the relationship between the price of each stock, the PE (price earnings ratio) and the relative sectors. This visualization makes it easy for an investor to determine how to invest by analyzing 3 of the most useful variables one must consider when creating a portfolio.

To make the relationship easier to analyze, we scale the x-axis to log scale in the chart below:

One can see the financial sector seems to dominate most of the chart.


In conclusion, our use of "Scrapy" and data visualization has allowed us to gain a greater understanding of the data one must consider when investing. The NYSE data we examined seemed to be primarily concentrated by financial stocks in the USA with the largest number of stocks having a PE range between 15 and 20.

Our key takeaway from this project is that our scraping and data science tools would definitely be important in analyzing and increasing profitability for anyone looking to invest in the stock market.

About Author


Steven Owusu

Steven Owusu has several years experience working as a credit analyst. He holds a Masters of Business Administration from Columbia Business School. Steven loves applying data science techniques to solving real world business problems.
View all posts by Steven Owusu >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp