In [170]:
top_directory = '/Users/iaincarmichael/Dropbox/Research/law/law-net/'

import os
import sys
import time
from math import *
import copy
import cPickle as pickle
import re
import datetime


# data
import numpy as np
import pandas as pd

# viz
import matplotlib.pyplot as plt


# graph
import igraph as ig


# our code
sys.path.append(top_directory + 'code/')
from load_data import load_and_clean_graph, case_info
from pipeline.download_data import download_bulk_resource
from pipeline.make_clean_data import *
from viz import print_describe

from pipeline.make_raw_case_metadata import *


# directory set up
data_dir = top_directory + 'data/'

court_name = 'scotus'

# jupyter notebook settings
%load_ext autoreload
%autoreload 2
%matplotlib inline


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

add data from SCDB


In [304]:
%time case_metadata = get_raw_case_metadata_from_court(court_name, data_dir)


CPU times: user 1min 51s, sys: 10.7 s, total: 2min 2s
Wall time: 2min 34s

In [305]:
case_metadata


Out[305]:
date court name judges scdb_id term issueArea decisionDirection majVotes minVotes
id
142945 2005-03-07 scotus united-states-v-glendale-federal-bank-fsb 2004 NaN NaN NaN NaN
96546 1906-12-10 scotus new-jersey-v-anderson Day, After Making the Foregoing Statement 1906-049 1906 8.0 1.0 5.0 3.0
110557 1981-07-01 scotus cbs-v-federal-communications-commission 1980-145 1980 8.0 2.0 6.0 3.0
130423 2003-06-09 scotus hannum-v-united-states 2002 NaN NaN NaN NaN
106300 1961-11-13 scotus hamilton-v-alabama Douglas 1961-004 1961 1.0 2.0 9.0 0.0
89372 1876-12-18 scotus barkley-v-levee-commissioners Bradley 1876-054 1876 8.0 2.0 9.0 0.0
89373 1876-12-18 scotus broughton-v-pensacola Field 1876-055 1876 8.0 2.0 9.0 0.0
89374 1876-12-18 scotus dalton-v-jennings Miller 1876-067 1876 8.0 2.0 9.0 0.0
89375 1876-12-11 scotus windsor-v-mcveigh Field 1876-061 1876 4.0 2.0 6.0 3.0
89376 1876-12-11 scotus bigelow-v-berkshire-life-ins-co Davis 1876-062 1876 8.0 1.0 9.0 0.0
106301 1961-11-13 scotus oxenberg-v-alaska Per Curiam 1961 NaN NaN NaN NaN
89378 1876-12-18 scotus indianapolis-st-louis-r-co-v-horst Swayne 1876-056 1876 1.0 2.0 9.0 0.0
89379 1876-11-27 scotus the-atlas Clifford 1876-046 1876 9.0 1.0 9.0 0.0
96076 1904-04-25 scotus united-states-v-sing-tuck Holmes 1903-137 1903 2.0 1.0 7.0 2.0
106302 1961-11-20 scotus hoyt-v-florida Harlan 1961-005 1961 2.0 1.0 9.0 0.0
91138 1884-05-05 scotus barrett-v-failing Gray 1883-246 1883 2.0 1.0 9.0 0.0
137047 2004-06-14 scotus northern-voyager-limited-partnership-v-united-... 2003 NaN NaN NaN NaN
106303 1961-12-04 scotus western-union-telegraph-co-v-pennsylvania Black 1961-006 1961 4.0 2.0 9.0 0.0
1859650 2007-03-19 scotus verity-international-ltd-v-federal-trade-commi... 2006 NaN NaN NaN NaN
137046 2004-06-14 scotus mcgregor-v-mineta-secretary-of-transportation 2003 NaN NaN NaN NaN
106304 1961-12-04 scotus icc-v-j-t-transport-co Douglas 1961-007 1961 8.0 2.0 6.0 3.0
110551 1981-06-26 scotus california-medical-assn-v-federal-election-commn Marshall 1980-139 1980 3.0 1.0 5.0 0.0
137045 2004-06-14 scotus wyatt-v-united-states 2003 NaN NaN NaN NaN
106305 1961-12-04 scotus hodges-v-united-states Per Curiam 1961-008 1961 1.0 1.0 6.0 3.0
103549 1941-11-10 scotus baltimore-ohio-r-co-v-kepner Reed 1941-002 1941 10.0 2.0 6.0 3.0
103548 1941-11-10 scotus reitz-v-mealey Roberts 1941-022 1941 8.0 1.0 5.0 4.0
127479 2003-02-24 scotus dixon-v-united-states-district-court-for-the-e... 2002 NaN NaN NaN NaN
127478 2003-02-24 scotus villarino-pacheco-v-united-states 2002 NaN NaN NaN NaN
106306 1961-12-04 scotus sylvester-johnson-v-state-of-new-jersey 1961 NaN NaN NaN NaN
103541 1941-10-13 scotus unio-pac-r-co-v-united-states 1940-068 1941 8.0 2.0 4.0 3.0
... ... ... ... ... ... ... ... ... ... ...
143880 2005-04-18 scotus caldwell-v-united-states 2004 NaN NaN NaN NaN
143881 2005-04-18 scotus united-states-ex-rel-graves-v-itt-educational-... 2004 NaN NaN NaN NaN
96208 1905-02-20 scotus mcdaniel-v-traylor Harlan, After Making the Foregoing Statement 1904-179 1904 14.0 3.0 9.0 0.0
96209 1905-02-20 scotus caledonian-coal-co-v-baker Harlan, After Making the Foregoing Statement 1904-180 1904 9.0 1.0 9.0 0.0
142944 2005-03-07 scotus ssa-gulf-inc-v-magee 2004 NaN NaN NaN NaN
143882 2005-04-18 scotus ronald-moran-cadillac-inc-v-united-states 2004 NaN NaN NaN NaN
96200 1905-01-23 scotus rooney-v-north-dakota Harlan, After Making the Foregoing Statement 1904-171 1904 1.0 1.0 9.0 0.0
96201 1905-01-23 scotus united-states-v-crosley Day, After Making the Foregoing Statement 1904-172 1904 6.0 1.0 9.0 0.0
96202 1905-01-30 scotus mining-company-v-tunnel-company Brewer 1904-173 1904 14.0 3.0 9.0 0.0
143883 2005-04-18 scotus hargrave-thomas-v-yukins-warden 2004 NaN NaN NaN NaN
96204 1905-01-30 scotus munsey-v-clough Peckham 1904-175 1904 4.0 1.0 9.0 0.0
96205 1905-01-30 scotus swift-co-v-united-states Holmes 1904-176 1904 8.0 2.0 9.0 0.0
96206 1905-01-30 scotus small-v-rakestraw Holmes 1904-177 1904 2.0 2.0 9.0 0.0
96207 1905-02-20 scotus hamburg-american-ss-co-v-grube Fuller, After Making the Foregoing Statement 1904-178 1904 8.0 1.0 9.0 0.0
88971 1875-01-11 scotus murdock-v-memphis Miller (Now, January 11th, 1875) 1874-062 1874 9.0 1.0 7.0 0.0
88970 1875-01-11 scotus clark-v-iowa-city Field 1874-061 1874 9.0 2.0 8.0 1.0
130422 2003-06-09 scotus myers-v-united-states 2002 NaN NaN NaN NaN
88972 1875-01-11 scotus the-railroad-company-v-maryland-on-motion 1874-063 1874 9.0 2.0 9.0 0.0
88975 1875-01-11 scotus treat-v-jemison 1874-066 1874 9.0 1.0 9.0 0.0
88974 1875-01-11 scotus cadle-v-baker 1874-065 1874 2.0 1.0 9.0 0.0
103099 1938-12-05 scotus consolidated-edison-co-v-nlrb Hughes 1938-001 1938 7.0 2.0 8.0 0.0
103098 1938-12-05 scotus lyeth-v-hoey Hughes 1938-016 1938 12.0 1.0 8.0 0.0
103097 1938-12-05 scotus shields-v-utah-idaho-central-r-co Hughes 1938-003 1938 9.0 1.0 8.0 0.0
103096 1938-12-19 scotus stoll-v-gottlieb Reed 1938-006 1938 9.0 2.0 8.0 0.0
103095 1938-12-12 scotus harris-v-avery-brundage-co Black 1938-005 1938 8.0 1.0 8.0 0.0
103094 1938-12-19 scotus welch-v-henry 1938-007 1938 8.0 2.0 5.0 3.0
103093 1939-01-03 scotus general-pictures-co-v-electric-co Brandeis 1938-008 1938 8.0 1.0 5.0 2.0
103092 1938-12-12 scotus kellogg-co-v-national-biscuit-co Brandeis 1938-009 1938 8.0 1.0 6.0 2.0
103091 1938-12-05 scotus waialua-agricultural-co-v-christian Reed 1938-032 1938 14.0 3.0 8.0 0.0
103090 1938-11-07 scotus hines-v-lowrey Black 1938-031 1938 10.0 1.0 8.0 0.0

63859 rows × 10 columns


In [ ]: