This file contains hidden or 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
| {"13,2,16": "Watching hockey", "13,2,17": "Watching martial arts ", "13,2,14": "Watching golfing", "13,2,15": "Watching gymnastics", "13,2,12": "Watching fishing", "13,2,13": "Watching football", "13,2,10": "Watching equestrian sports", "13,2,11": "Watching fencing", "15,2,2": "Collecting & delivering clothing & other goods", "15,2,3": "Providing care", "1,4": "Personal Activities", "15,2,1": "Food preparation, presentation, clean-up", "1,2": "Grooming", "1,3": "Health-related self care", "13,2,18": "Watching racquet sports", "13,2,19": "Watching rodeo competitions", "5,4,99": "Job search and Interviewing, n.e.c.*", "15": "Volunteer Activities ", "3,1,99": "Caring for & helping hh children, n.e.c.*", "2,4,99": "Exterior maintenance, repair & decoration, n.e.c.*", "16,99": "Telephone Calls, n.e.c.*", "2,2,3": "Kitchen and food clean-up", "2,2,2": "Food presentation", "9,2,2": "Waiting associated w/ home main/repair/d\u00e9cor/constr", "9,2,1": "Using home maint/repair/d\u00e9cor/construction svcs", "7,1,3": "P |
This file contains hidden or 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
| {"TRTOHH_LN": {"files": ["Activity File"], "note": "TRTOHH_LN is calculated using TUCC5. It does not include activities with TRTIER2P=0101, 0301, 0302, 0303, or with TRCODEP=180381. It does not include any activity or part of any activity in which no household child was awake (determined by TUCC2 and TUCC4).", "validEntries": {"0": "Min Value", "1440": "Max Value"}, "description": "Total time spent during activity providing secondary childcare for own household children < 13 (in minutes)"}, "TRELHH": {"files": ["EC Roster File"], "note": "Questions about eldercare were introduced in January 2011.", "validEntries": {"1": "Recipient is a household member", "0": "Recipient is not a household member"}, "description": "Eldercare recipient is a household member"}, "PELAYLK": {"files": ["ATUS-CPS File"], "note": null, "validEntries": {"1": "Yes", "2": "No"}, "description": "Edited: even though you are to be called back to work, have you been looking for work during the last 4 weeks?"}, "PTDTRACE": {"files": ["ATUS-C |
This file contains hidden or 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 sys | |
| import xml.etree.ElementTree as ET | |
| import re, htmlentitydefs, textwrap | |
| def wrap(text): | |
| paragraphs = re.split('\n{2,}', text) | |
| wrapped = [] | |
| for para in paragraphs: | |
| para = re.sub('\s{2,}', ' ', para).strip() | |
| wrapped.append('\n'.join(textwrap.wrap(para, 80))) |
This file contains hidden or 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 xml.etree.ElementTree as ET | |
| import csv | |
| from collections import defaultdict | |
| # Note that 1Password is quite particular about the kind of escaping you use. | |
| # The default Excel dialect blows it up & there is in fact no Python dialect | |
| # corresponding to 1Password's requirements due to http://bugs.python.org/issue12178 | |
| output = csv.writer(open('keepass.csv', 'wb'), doublequote=False, escapechar='\\', quoting=csv.QUOTE_ALL) | |
| dom = ET.parse('keepass.xml') |
This file contains hidden or 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 pandas as pd | |
| import numpy as np | |
| import re | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.basemap import Basemap | |
| def load_grid(path): | |
| f = open(path, 'r') | |
| headers = None |
This file contains hidden or 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
| from IPython import get_ipython | |
| # Levels less than warn (info, debug, etc.) are surpressed in the console output. | |
| get_ipython().kernel.log.warn("Hello, world!") |
OlderNewer