Skip to content

Scraps recent stock prices of top 500 companies and plots them on a graph comparing it to what would be expected if they folowed Benford's Law

Notifications You must be signed in to change notification settings

gugajazz/Benford_Scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Benford_Scraper

A program created to verify first hand that the counter intuitive nature of the Benford's law applies to a random set of numbers, in this particular case stock prices.

Usage

Scrapper.py grabs recent stock prices of top 500 companies from all pages of markets.businessinsider.com/index/s&p_500 and stores them in a csv.
Benford.py then plots them on a graph comparing it to what would be expected if they followed Benford's Law. Due to the volatile nature of scrapping from a website I don't control slight changes might be necessary to the code to keep it working but so far that hasen't happened.

Running it

The required libraries are: requests, bs4, lxml, numpy and matplotlib.
Run first Scrapper.py in order to update the data according to the website, folowed by Benford.py.

Images

alt text

About

Scraps recent stock prices of top 500 companies and plots them on a graph comparing it to what would be expected if they folowed Benford's Law

Topics

Resources

Stars

Watchers

Forks

Languages