-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c74ebd2
commit 3a329a0
Showing
10 changed files
with
361 additions
and
155 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from numpy import * | ||
from scipy.interpolate import * | ||
from matplotlib.pyplot import * | ||
from scipy.stats import * | ||
|
||
#The Data | ||
population_density = array([1901, 1292, 1423.6, 1069.2, 731.9, 2163.9, 1467.7, 327.6, 768.5, 2.4]) | ||
population = array ([94192, 1129, 6619, 2023, 2486, 23691, 14504, 172, 2376, 146]) | ||
sqm = array([16.15, 17.17, 16.88, 17.44, 19.11, 15.87, 16.89, 19.79, 18.57, 21.35]) | ||
print(population_density) | ||
print(population) | ||
print(sqm) | ||
|
||
#Finds the formula to describe the correlation between population density and photopollution | ||
p1 = polyfit(population_density,sqm,1) | ||
print(p1) | ||
#Finds the correlation coefficient in the case of population density | ||
slope,intercept,r_value,p_value,std_err = linregress(population_density,sqm) | ||
correlation = (pow(r_value,2)) | ||
print(correlation) | ||
#Finds the formula to describe the correlation between population and photopollution (Normalization of Walker's Law.) | ||
p2 = polyfit(population,sqm,1) | ||
print(p2) | ||
#Finds the correlation coefficient in the case of population | ||
slope,intercept2,r_value2,p_value2,std_err2 = linregress(population,sqm) | ||
correlation2 = (pow(r_value2,2)) | ||
print (correlation2) | ||
#Calculate Standard Deviation | ||
stddev = std(sqm) | ||
print(stddev) |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,26 +8,19 @@ Welcome to the Photopollution Calculator. This program is based on the mathemati | |
To run this program you will need: | ||
|
||
* Python (Preferably Python 2.7) | ||
* Python 3 | ||
* Pandas | ||
* Scipy | ||
* Numpy | ||
* Mathplotlib | ||
|
||
All the necessary tools needed to run this program are available through [Anaconda](https://www.anaconda.com/download/). | ||
Choose the operating system you are using, download the Python 2.7 version, and follow the Installation instructions available on their website. | ||
Choose the operating system you are using, download the Python 3 version, and follow the Installation instructions available on their website. | ||
|
||
To install and run this program, open a command line and type the following: | ||
|
||
``` bash | ||
$ git clone https://www.github.com/conorcaseyc/Photopollution-Calculator | ||
$ cd Photopollution-Calculator | ||
$ python2 Program.py | ||
``` | ||
If you are using Python 3, use the following command instead of the final command previously mentioned: | ||
|
||
```bash | ||
$ python3 Program_3.py | ||
$ python main.py | ||
``` | ||
|
||
If you have any problems, please [email me.](mailto:[email protected]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters