The application of computational methods to all aspects of the process of scientific investigation – data acquisition, data management, analysis, visualization, and sharing of methods and results.
import arcpy
arcpy.sa
arcpy.mapping
arcpy.na
arcpy.ga
arcpy.da
arcpy.mp
instead of arcpy.mapping
Package | KLOC | Contributors | Stars |
---|---|---|---|
matplotlib | 118 | 426 | 3359 |
Nose | 7 | 79 | 912 |
NumPy | 236 | 405 | 2683 |
Pandas | 183 | 407 | 5834 |
SciPy | 387 | 375 | 2150 |
SymPy | 243 | 427 | 2672 |
Totals | 1174 | 1784 |
unittest
framework, extends it to make testing easy.SciPy Lectures, CC-BY
Computational methods for:
import scipy.stats
rast_in = 'data/input_raster.tif'
rast_as_numpy_array = arcpy.RasterToNumPyArray(rast_in)
raster_geometric_mean = scipy.stats.stats.gmean(
rast_as_numpy_array, axis=None)
scipy.ndimage
to perform basic multiscale analysisscipy.stats
to compute circular statisticsimport arcpy
import scipy.ndimage as nd
from matplotlib import pyplot as plt
ras = "data/input_raster.tif"
r = arcpy.RasterToNumPyArray(ras, "", 200, 200, 0)
fig = plt.figure(figsize=(10, 10))
for i in xrange(25):
size = (i+1) * 3
print "running {}".format(size)
med = nd.median_filter(r, size)
a = fig.add_subplot(5, 5,i+1)
plt.imshow(med, interpolation='nearest')
a.set_title('{}x{}'.format(size, size))
plt.axis('off')
plt.subplots_adjust(hspace = 0.1)
prev = med
plt.savefig("btm-scale-compare.png", bbox_inches='tight')
sin()
and cos()
variablesSummary statistics from SciPy include circular statistics (source).
import scipy.stats.morestats
ras = "data/aspect_raster.tif"
r = arcpy.RasterToNumPyArray(ras)
morestats.circmean(r)
morestats.circstd(r)
morestats.circvar(r)
(Source)
import netCDF4
nc = netCDF4.Dataset('test.nc', 'r', format='NETCDF4')
print nc.file_format
# outputs: NETCDF4
nc.close()
(Source)
import pandas
data = pandas.read_csv('data/season-ratings.csv')
data.columns
Index([u'season', u'households', u'rank', u'tv_households', \
u'net_indep', u'primetime_pct'], dtype='object')
majority_simpsons = data[data.primetime_pct > 50]
season households tv_households net_indep primetime_pct
0 1 13.4m[41] 92.1 51.6 80.751174
1 2 12.2m[n2] 92.1 50.4 78.504673
2 3 12.0m[n3] 92.1 48.4 76.582278
3 4 12.1m[48] 93.1 46.2 72.755906
4 5 10.5m[n4] 93.1 46.5 72.093023
5 6 9.0m[50] 95.4 46.1 71.032357
6 7 8.0m[51] 95.9 46.6 70.713202
7 8 8.6m[52] 97.0 44.2 67.584098
8 9 9.1m[53] 98.0 42.3 64.383562
9 10 7.9m[54] 99.4 39.9 60.916031
10 11 8.2m[55] 100.8 38.1 57.466063
11 12 14.7m[56] 102.2 36.8 53.958944
12 13 12.4m[57] 105.5 35.0 51.094891
from sympy import *
x = symbol('x')
eq = Eq(x**3 + 2*x**2 + 4*x + 8, 0)
solve(eq, x)
scikit-learn
, scikit-image
, ...)theano
, ...)PyMC
)
statsmodels
)Courses:
Books:
Only require SciPy Stack:
futurize
script to initially a project written for one version.iOS, Android: Feedback from within the app
Windows Phone, or no smartphone? Cuneiform tablets accepted.