--- /dev/null
+#!/usr/bin/env python
+
+import matplotlib.mlab as ml
+import numpy as np
+import sys
+
+def get_sightings(filename, focusanimal):
+
+ # # Load table
+ # tab = ml.csv2rec(filename)
+
+ # focusanimal = focusanimal.capitalize()
+
+ # # Find number of records and total count of animals seen
+ # isfocus = (tab['animal'] == focusanimal)
+ # totalrecs = np.sum(isfocus)
+ # if totalrecs == 0:
+ # meancount = 0
+ # else:
+ # meancount = np.mean(tab['count'][isfocus])
+
+ # # Return num of records and animals seen
+ # return totalrecs, meancount
+
+
+ # Load table
+ tab = ml.csv2rec(filename)
+
+
+ # Loop through all records, countings recs and animals
+ totalrecs = 0.
+ totalcount = 0.
+ focusanimal = focusanimal.capitalize()
+
+ for rec in tab:
+ if rec['animal'] == focusanimal:
+ totalrecs += 1
+ totalcount += rec['count']
+
+ if totalrecs == 0:
+ meancount = 0
+ else:
+ meancount = totalcount/totalrecs
+ # Return num of records and animals seen
+ return totalrecs, meancount
+
+
+filename = sys.argv[1]
+animal = sys.argv[2]
+
+print get_sightings(filename, animal)