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
import csv, statistics | |
with open('nc_county_time_series0611.csv', 'rU') as time_series_file: | |
filereader = csv.reader(time_series_file) | |
with open('sts_county_transposed.csv','w') as transposed_file: | |
fieldnames = ['nc_county','date', 'date_count', 'cases','new_cases', 'rolling_avg'] | |
filewriter = csv.DictWriter(transposed_file, fieldnames = fieldnames) | |
filewriter.writeheader() | |
rowcounter = 0 | |
for row in filereader: |
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
Acupuncturist | |
Adult Care Administrator | |
Aerial Pesticide Applicator | |
Air Traffic Control Tower Operator | |
Aircraft Dispatcher | |
Aircraft Mechanic | |
Aircraft Repairperson | |
Alarm Installer | |
Alarm System Business Licensee | |
Alcoholic Beverage Distributor/Vendor Representative |
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
@echo off | |
::Enter a project name to create a new project directory | |
::Provided you have a template folder with the following structure: | |
::chron.docx | |
::documents | |
::interviews | |
::>audio | |
::questions.txt | |
::data | |
::>data-diary.txt |
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
Sub savemsg() | |
Debug.Print "Running..." | |
ListFilesInFolder "SOURCE DIR HERE" | |
End Sub | |
Sub ListFilesInFolder(SourceFolderName As String) | |
Debug.Print "Loading source folder..." | |
Debug.Print SourceFolderName | |
Dim FSO As Scripting.FileSystemObject | |
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder |
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
#import the datetime library | |
from datetime import datetime | |
#Get a python date object from a date string | |
#specify the date string with ex '%Y%m%d' | |
def parse_date(d, date_string): | |
if d: | |
try: | |
parsed_date = datetime.strptime(d, date_string).date() | |
except ValueError, e: |
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
COUNTY_CODE_CHOICES = ( | |
('000','Alamance'), | |
('010','Alexander'), | |
('020','Alleghany'), | |
('030','Anson'), | |
('040','Ashe'), | |
('050','Avery'), | |
('060','Beaufort'), | |
('070','Bertie'), | |
('080','Bladen'), |
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
#import a python library to help us work with dates and times | |
import datetime | |
# define a FUNCTION to run a specified task | |
def main(): | |
print 'Hello World!' | |
print 'I am some prepackaged code.' | |
print "I don't do much, but I'm still special!" | |
# another function, but we won't run this at first |
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
''' | |
A generalized script to gather data from | |
DOE's College Scorecard site using JSON | |
USAGE | |
python collegescorecard_v2.py 'https://api.data.gov/ed/collegescorecard/v1/schools.json?school.ownership=2&fields=id,school.name,2014.student.share_firstgeneration&page=0&per_page=100&api_key=MY_API_KEY_HIDDEN' | |
''' | |
#import libraries | |
#the time library allows us to pause for a second | |
from time import sleep |
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
[ | |
['Alabama','AL'], | |
['Montana','MT'], | |
['Alaska','AK'], | |
['Nebraska','NE'], | |
['Arizona','AZ'], | |
['Nevada','NV'], | |
['Arkansas','AR'], | |
['New Hampshire','NH'], | |
['California','CA'], |
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
[ | |
'Alamance', | |
'Alexander', | |
'Alleghany', | |
'Anson', | |
'Ashe', | |
'Avery', | |
'Beaufort', | |
'Bertie', | |
'Bladen', |