Created on 6/20/2017
There is a continuous discussion about whether or not the [illegal] immigrants infiltrating the USA from Mexico positively affect the crime rate in the border neighborhoods. This program's purpose is to cast some light on the situation using data from Wikipedia. Check out our report in the document folder for more detailed information.
The program was built using Python, matplotlib, and CSV and BeautifulSoup module.
-
Download and extract crime-related data (namely, the total violent crime rate per 100,000 people) from the major US cities from the List of US cities by crime rate. (cache was used) here
-
For each city, follow the link to its Wikipedia page and extract its coordinates. Calculate the distance to the border as the smallest distance from each city to San Ysidro, Yuma, Tucson, El Paso, Laredo, Del Rio, and Brownsville, TX.
-
Save the city names, crime rates, and smallest distances to the border in a 3-column CSV file for further analysis
- Download Anaconda Navigator here
- Install Spider within Anaconda Navigator
- Launch Spider and import the source code (File --> Open --> select the CrimeBorder.py)
- Run the program