lookup = { 'state': { 'AL': 0.7122, 'AR': 0.7773, 'AZ': 0.7773, 'CO': 0.6772, 'CT': 1.1464, 'FL': 1.2350, 'GA': 0.8471, 'IA': 0.5930, 'ID': 1.0000, 'IL': 0.5930, 'IN': 0.6585, 'KS': 0.8471, 'KY': 1.0737, 'LA': 1.1464, 'MA': 1.5116, 'MD': 1.0000, 'ME': 1.2350, 'MI': 1.0000, 'MN': 0.8471, 'MO': 0.6585, 'MS': 0.8955, 'ND': 1.0737, 'NE': 0.6772, 'NJ': 1.1464, 'NM': 1.1464, 'NV': 0.8471, 'NY': 1.1464, 'OH': 0.6772, 'OK': 0.7773, 'OR': 1.0000, 'PA': 0.8955, 'RI': 0.6585, 'SC': 0.7773, 'SD': 1.5116, 'TN': 0.7485, 'TX': 0.8955, 'UT': 0.7122, 'VA': 0.7122, 'WA': 0.8955, 'WI': 0.7485, 'WV': 1.1464}, 'residence_type': { 'Rent': 1.0000, 'Other': 1.0000, 'Own co-op': 1.0000, 'Own home/condo': 1.0155, 'Own mobile home': 0.9719, 'Live with parents': 1.0155}, 'loss_tier':{ '01': 1.0818, '03': 1.0818, '06': 1.0818, '07': 1.0818, '08': 1.0818, '10': 1.0818, '11': 1.0818, '12': 1.0818, '13': 1.0818, '14': 1.0818, '16': 1.0818, '17': 1.0818, '18': 1.0818, '19': 1.0818, '20': 1.0818, '22': 1.0818, '23': 1.0818, '24': 1.0818, '25': 1.0818, '26': 1.0818, '27': 1.0818, '28': 1.0818, '29': 1.0818, '30': 1.0818, '31': 1.0818, '32': 1.0818, '33': 1.0818, '34': 1.0818, '35': 1.0818, '36': 1.0818, '37': 1.0818, '39': 1.0818, '40': 1.0818, '41': 1.0818, '42': 1.0818, '43': 1.0818, '44': 1.0818, '45': 1.0818, '48': 1.0818, '50': 1.0818, '57': 1.0818, '58': 1.0818, '59': 1.0818, '61': 1.0818, '62': 1.0818, '63': 1.0818, '64': 1.0818, '66': 1.0818, '67': 1.0818, '68': 1.0818, '69': 1.0818, '70': 1.0818, '71': 1.0818, '72': 1.0818, '73': 1.0818, '74': 1.0818, '75': 1.0818, '76': 1.0818, '77': 1.0818, '78': 1.0818, '79': 1.0818, '80': 1.0818, '81': 1.0818, '82': 1.0818, '83': 1.0818, '85': 1.0818, '86': 1.0818, '87': 1.0818, '88': 1.0818, '89': 1.0818, '92': 1.0818, '94': 1.0818, '97': 1.0818, '98': 1.0818, 'NS': 1.0818, 'MM': 1.0549, 'ST': 1.0549, 'PR': 1.0411, 'UL': 1.0000 }, 'rating_bi': { 'No Current Limit': 0.8923, '$10,000/$20,000': 0.8923, '$12,500/$25,000': 0.8923, '$15,000/$30,000': 1.0200, '$20,000/$40,000': 1.0200, '$25,000/$50,000': 1.0200, '$30,000/$60,000': 1.0200, '$35,000/$80,000': 1.0200, '$50,000/$100,000': 1.0200, '$100,000/$300,000': 1.0000, '$250,000/$500,000': 1.0000, '$300,000 (Single Limit)': 1.0288 }, 'traffic_source': { 'Affiliates': 1.0000, 'Branded Search': 1.0000, 'CUNA': 1.1864, 'Display': 0.9834, 'Other': 1.0000, 'Paid Search': 1.0000, 'Remarketing': 0.9834, 'Untracked': 1.0000 }, 'ssn_entered': { 'N': 1.0080, 'Y': 1.0000 }, 'disclosed_incidents': { 0: 1.0000, 1: 1.0757, 2: 1.0000 }, 'day_of_week': { 'Monday': 1.0000, 'Tuesday': 1.0000, 'Wednesday': 1.0000, 'Thursday': 1.0000, 'Friday': 1.0000, 'Saturday': 1.0000, 'Sunday': 0.9949 }, 'age': { 15: 2.3787, 16: 2.0717, 17: 1.8318, 18: 1.6425, 19: 1.4917, 20: 1.3707, 21: 1.2731, 22: 1.1939, 23: 1.1296, 24: 1.0772, 25: 1.0346, 26: 1.0000, 27: 0.9720, 28: 0.9495, 29: 0.9315, 30: 0.9174, 31: 0.9063, 32: 0.8979, 33: 0.8916, 34: 0.8870, 35: 0.8837, 36: 0.8815, 37: 0.8801, 38: 0.8792, 39: 0.8786, 40: 0.8782, 41: 0.8778, 42: 0.8772, 43: 0.8764, 44: 0.8752, 45: 0.8737, 46: 0.8717, 47: 0.8693, 48: 0.8664, 49: 0.8631, 50: 0.8593, 51: 0.8552, 52: 0.8507, 53: 0.8459, 54: 0.8410, 55: 0.8359, 56: 0.8308, 57: 0.8257, 58: 0.8207, 59: 0.8159, 60: 0.8115, 61: 0.8074, 62: 0.8037, 63: 0.8006, 64: 0.7981, 65: 0.7964, 66: 0.7953, 67: 0.7952, 68: 0.7959, 69: 0.7975, 70: 0.8001, 71: 0.8038, 72: 0.8086, 73: 0.8144, 74: 0.8214, 75: 0.8295, 76: 0.8387, 77: 0.8490, 78: 0.8603, 79: 0.8727, 80: 0.8859, 81: 0.8999, 82: 0.9145, 83: 0.9296, 84: 0.9448, 85: 0.9600, 86: 0.9747, 87: 0.9886, 88: 1.0013, 89: 1.0122, 90: 1.0207, 91: 1.0264, 92: 1.0285 }, 'vehicle1_age': { -1: 1.0030, 0: 1.0159, 1: 1.0296, 2: 1.0394, 3: 1.0420, 4: 1.0361, 5: 1.0218, 6: 1.0000, 7: 0.9727, 8: 0.9419, 9: 0.9097, 10: 0.8780, 11: 0.8481, 12: 0.8210, 13: 0.7973, 14: 0.7772, 15: 0.7602, 16: 0.7461, 17: 0.7338, 18: 0.7225, 19: 0.7110, 20: 0.6982, 21: 0.6831, 22: 0.6648, 23: 0.6431, 24: 0.6182, 25: 0.5910, 26: 0.5632, 27: 0.5368, 28: 0.5150, 29: 0.5013, 30: 0.5009, 31: 0.5212, 32: 0.5754, 33: 0.6898, }, 'education_level': { 'Less than high school': 1.0712, 'High school graduate/GED': 1.0265, 'Currently in college': 1.0000, 'Vocational or trade school degree': 1.0000, 'Associates degree': 1.0265, 'Some college': 1.0000, 'Bachelors degree': 0.9733, 'Graduate or doctoral degree': 1.0016 }, 'prior_carrier': { '21st Century': 1.0000, 'AAA': 1.0000, 'AIG': 1.0239, 'Allstate': 1.0000, 'American Family': 1.0000, 'Esurance': 1.0000, 'Farmers': 1.0000, 'GEICO': 1.0239, 'GMAC Insurance Holdings': 1.0000, 'Hartford': 1.0000, 'Liberty Mutual': 1.0000, 'Mercury': 1.0000, 'N/A': 1.0000, 'Nationwide': 1.0239, 'Other': 1.0000, 'Progressive': 1.0239, 'SAFECO': 1.0000, 'State Farm': 1.0239, 'Travelers': 1.0000, 'USAA': 1.0239, 'Unitrin': 1.0000 }, 'days_adv_shopping': { 'Less than 7': 1.0000, '7 to 60': 0.9695, 'More than 60': 1.0000 }, 'mapped_pre_credit_tier': { '-1': 1.0000, '0': 1.0000, '1': 1.0871, '2': 1.0871, '3': 1.0871, '4': 1.0871, '5': 1.0871, '6': 1.0871, '7': 1.0871, '8': 0.9988, '9': 0.9988, '10': 0.9988, '11': 0.9988, '12': 0.9988, '13': 0.9988, '14': 0.9988, '15': 0.9988, '16': 0.9988, '17': 0.9988, '18': 0.9988, '19': 0.9988, '20': 0.9988, '21': 0.9988, '22': 0.9988, '23': 0.9988, '24': 0.9988, } } sorted(lookup.keys()) # missing: zip code
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question