import pandas as pd
df = pd.read_csv("/users/ryankelly/downloads/Mines.txt", sep="|")
addr = pd.read_csv('/users/ryankelly/projects/ultura/AddressOfRecord.txt', sep="|")
df.join(addr, on='MINE_ID',rsuffix="joined")
MINE_ID | CURRENT_MINE_NAME | COAL_METAL_IND | CURRENT_MINE_TYPE | CURRENT_MINE_STATUS | CURRENT_STATUS_DT | CURRENT_CONTROLLER_ID | CURRENT_CONTROLLER_NAME | CURRENT_OPERATOR_ID | CURRENT_OPERATOR_NAME | STATE | BOM_STATE_CD | FIPS_CNTY_CD | FIPS_CNTY_NM | CONG_DIST_CD | COMPANY_TYPE | CURRENT_CONTROLLER_BEGIN_DT | DISTRICT | OFFICE_CD | OFFICE_NAME | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 100003 | O'Neal Quarry & Mill | M | Surface | Active | 01/22/1979 | 0041044 | Lhoist Group | L13586 | Lhoist North America | AL | 1 | 117 | Shelby | 6 | Other | 07/01/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
1 | 100004 | Brierfield Quarry | M | Surface | Active | 03/04/2003 | 0041044 | Lhoist Group | L13586 | Lhoist North America of Alabama, LLC | AL | 1 | 7 | Bibb | 3 | Other | 06/14/2000 | M3 | M3661 | Birmingham AL Field Office | ... |
2 | 100005 | Birmingham Plant | M | Surface | Abandoned | 08/15/1989 | 0041044 | Lhoist Group | L10998 | Allied Lime Company | AL | 1 | 73 | Jefferson | 6 | Other | 07/31/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
3 | 100006 | Auburn Quarry | M | Surface | Active | 09/24/1976 | M00174 | Martin Marietta Materials Inc | L16197 | Martin Marietta Materials, Inc. | AL | 1 | 81 | Lee | 3 | Corporation | 01/17/2002 | M3 | M3661 | Birmingham AL Field Office | ... |
4 | 100008 | Landmark Plant | M | Surface | Active | 11/14/1975 | M31753 | Alan B Cheney | L31753 | Cheney Lime & Cement Company | AL | 1 | 117 | Shelby | 6 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
5 | 100009 | Dolcito Quarry | M | Surface | Active | 07/04/1976 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Construction Materials, L.P. | AL | 1 | 73 | Jefferson | 6 | Partnership | 04/21/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
6 | 100010 | Rockwood Mine | M | Underground | Active | 10/01/1994 | M01727 | Vetter Stone Company | L16123 | Alabama Stone Company | AL | 1 | 59 | Franklin | 4 | Corporation | 07/01/1998 | M3 | M3661 | Birmingham AL Field Office | ... |
7 | 100011 | Imerys Sylacauga Operations | M | Surface | Active | 11/14/1975 | M11763 | Imerys S A | 0090005 | Imerys Carbonates LLC | AL | 1 | 121 | Talladega | 3 | Other | 02/12/2008 | M3 | M3661 | Birmingham AL Field Office | ... |
8 | 100012 | Ohatchee Quarry | M | Surface | Active | 12/13/2011 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Constr. Materials, L.P. | AL | 1 | 15 | Calhoun | 3 | Partnership | 01/01/1986 | M3 | M3661 | Birmingham AL Field Office | ... |
9 | 100013 | C A Langford Co Inc | M | Surface | Active | 11/14/1975 | M31370 | Charles A Langford; William S Langford | L31370 | C A Langford Company Inc | AL | 1 | 95 | Marshall | 4 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
10 | 100015 | Citadel Cement | M | Facility | Abandoned | 10/01/1995 | M00187 | Medusa Corp | L13248 | Medusa Corp | AL | 1 | 63 | Greene | 7 | Corporation | 06/29/1993 | M3 | M3661 | Birmingham AL Field Office | ... |
11 | 100016 | Demopolis Plant Cemex Inc | M | Facility | Active | 04/12/1976 | M09149 | Cemex S A | L18165 | Cemex Inc | AL | 1 | 91 | Marengo | 7 | Corporation | 08/27/2001 | M3 | M3661 | Birmingham AL Field Office | ... |
12 | 100017 | ST. STEPHENS QUARRY | M | Surface | Abandoned | 09/20/1999 | M08390 | Bailey Jack A Sr | L10825 | Bailey'S Construction Company Inc | AL | 1 | 129 | Washington | 1 | Other | 12/16/1991 | M3 | M3661 | Birmingham AL Field Office | ... |
13 | 100018 | Longview #2 Plant | M | Surface | Abandoned | 11/02/1981 | M00223 | Dravo Corp | L00238 | Southern Stone Company Inc | AL | 1 | 117 | Shelby | 6 | Other | 06/01/1979 | M3 | M3000 | Southeast District - Birmingham | ... |
14 | 100020 | Madison Quarry Or Madison Quarry #117 | M | Surface | Abandoned | 01/24/1994 | 0071891 | Vulcan Materials Company | L00017 | Vulcan Materials Company | AL | 1 | 89 | Madison | 5 | Other | 01/01/1950 | M3 | M3811 | Franklin TN Field Office | ... |
15 | 100021 | HUNTSVILLE NORTH QUARRY | M | Surface | Active | 04/18/1975 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Constr. Materials, L.P. | AL | 1 | 89 | Madison | 5 | Partnership | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
16 | 100025 | Montevallo Quarry And Plant | M | Surface | Abandoned | 05/31/1985 | M00223 | Dravo Corp | L00238 | Southern Stone Company Inc | AL | 1 | 117 | Shelby | 6 | Other | 06/01/1979 | M3 | M3661 | Birmingham AL Field Office | ... |
17 | 100026 | Moretti Harrah Quarry | M | Surface | Abandoned | 10/23/1986 | M07019 | Moretti-Harrah Marble Company | L08875 | Moretti-Harrah Marble Company | AL | 1 | 121 | Talladega | 3 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
18 | 100027 | NATIONAL CEMENT COMPANY | M | Facility | Active | 11/26/1975 | M02802 | Vicat S A | L12645 | National Cement Co., of AL., Inc. | AL | 1 | 115 | St Clair | 3 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
19 | 100028 | Fort Payne Quarry | M | Surface | Active | 03/25/1977 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Construction Materials, L.P. | AL | 1 | 49 | De Kalb | 4 | Partnership | 05/04/2007 | M3 | M3661 | Birmingham AL Field Office | ... |
20 | 100029 | Gull Dredge Or Dredge Gull | M | Surface | Abandoned | 12/09/1982 | M00223 | Dravo Corp | L03645 | Radcliff Materials Inc | AL | 1 | 97 | Mobile | 1 | Other | 06/01/1979 | M3 | M3661 | Birmingham AL Field Office | ... |
21 | 100030 | Tuscumbia Quarry | M | Surface | Active | 06/21/1984 | M00452 | Rogers Group Inc | L06514 | Rogers Group Inc | AL | 1 | 33 | Colbert | 5 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
22 | 100031 | Woodstock Quarry & Mill | M | Surface | Abandoned | 02/09/1981 | M00223 | Dravo Corp | L00238 | Southern Stone Company Inc | AL | 1 | 7 | Bibb | 3 | Other | 06/01/1979 | M3 | M3000 | Southeast District - Birmingham | ... |
23 | 100032 | OYSTER SHELL PRODUCTS | M | Facility | Abandoned | 07/31/2000 | M00174 | Martin Marietta Materials Inc | L08284 | Martin Marietta Magnesia Specialties | AL | 1 | 97 | Mobile | 1 | Other | 01/03/1995 | M3 | M3661 | Birmingham AL Field Office | ... |
24 | 100033 | Oakwood Quarry | M | Surface | Abandoned | 03/12/1990 | 0071891 | Vulcan Materials Company | L00017 | Vulcan Materials Company | AL | 1 | 87 | Macon | 3 | Partnership | 01/01/1950 | M3 | M3811 | Franklin TN Field Office | ... |
25 | 100034 | LIVLITE DIVISION | M | Surface | Active | 11/26/1975 | M06183 | CRH PLC | L09995 | Big River Industries Inc | AL | 1 | 119 | Sumter | 7 | Corporation | 08/23/1988 | M3 | M3661 | Birmingham AL Field Office | ... |
26 | 100036 | Cherokee Quarry | M | Surface | Active | 12/27/1984 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Constr. Materials, L.P. | AL | 1 | 33 | Colbert | 5 | Partnership | 05/06/1996 | M3 | M3661 | Birmingham AL Field Office | ... |
27 | 100037 | CHILDERSBURG QUARRY | M | Surface | Active | 11/26/1975 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Construction Materials, L.P. | AL | 1 | 121 | Talladega | 3 | Partnership | 11/01/1984 | M3 | M3661 | Birmingham AL Field Office | ... |
28 | 100038 | Cyprus Industrial Minerals Company | M | Surface | Abandoned | 08/12/1988 | M03644 | Cyprus Amax Minerals Company | L04522 | Cyprus Industrial Minerals Company | AL | 1 | 121 | Talladega | 3 | Other | 09/22/1980 | M3 | M3661 | Birmingham AL Field Office | ... |
29 | 100039 | Trinity Quarry | M | Surface | Active | 12/27/1984 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Constr. Materials, L.P. | AL | 1 | 103 | Morgan | 5 | Partnership | 03/28/1981 | M3 | M3661 | Birmingham AL Field Office | ... |
30 | 100040 | Montevallo Quarry & Mill | M | Surface | Active | 04/05/1988 | 0041044 | Lhoist Group | L13586 | Lhoist North America of Alabama, LLC | AL | 1 | 117 | Shelby | 6 | Other | 07/31/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
31 | 100042 | Bessemer Plant & Quarry | M | Surface | Abandoned | 12/17/1985 | M00223 | Dravo Corp | L06813 | Dravo Basic Materials Company Inc | AL | 1 | 73 | Jefferson | 6 | Other | 07/14/1980 | M3 | M3661 | Birmingham AL Field Office | ... |
32 | 100043 | Leeds Plant | M | Facility | Active | 12/05/1975 | M00004 | Heidelberg Cement AG | L17551 | Lehigh Cement Company LLC | AL | 1 | 73 | Jefferson | 6 | Other | 02/01/2002 | M3 | M3661 | Birmingham AL Field Office | ... |
33 | 100045 | TUSCUMBIA QUARRY | M | Surface | Active | 01/30/1998 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Construction Materials, L.P. | AL | 1 | 33 | Colbert | 5 | Partnership | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
34 | 100047 | GLENCOE QUARRY | M | Surface | Active | 12/05/1975 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Construction Materials, L.P. | AL | 1 | 55 | Etowah | 4 | Partnership | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
35 | 100048 | Russellville Quarry | M | Surface | Abandoned | 07/23/1993 | 0071891 | Vulcan Materials Company | L00017 | Vulcan Materials Company | AL | 1 | 59 | Franklin | 4 | Other | 01/01/1950 | M3 | M3811 | Franklin TN Field Office | ... |
36 | 100050 | Calera Quarry | M | Surface | Active | 12/05/1975 | 0071891 | Vulcan Materials Company | L16168 | Vulcan Constr. Materials, L.P. | AL | 1 | 117 | Shelby | 6 | Partnership | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
37 | 100052 | Wade Sand & Gravel Co., Inc. | M | Surface | Active | 12/05/1975 | M38913 | Robin A Wade Jr | L39961 | Wade Sand & Gravel Co., Inc | AL | 1 | 73 | Jefferson | 6 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
38 | 100093 | Sandy Ridge Mill | M | Facility | Active | 12/05/1975 | M00015 | Amcol International Corp | L00006 | American Colloid Company Mineral Group | AL | 1 | 85 | Lowndes | 7 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
39 | 100094 | Bessemer Shale Mine | M | Surface | Active | 03/11/1990 | M00202 | Boral Limited | L09675 | Boral Bricks Inc | AL | 1 | 73 | Jefferson | 6 | Corporation | 07/20/1995 | M3 | M3661 | Birmingham AL Field Office | ... |
40 | 100095 | No 3 Plant & Cilla Mine Or Cilla Mine | M | Surface | Abandoned | 11/06/1980 | M00037 | R H Bickerstaff | L00003 | Bickerstaff Clay Products Company Inc | AL | 1 | 113 | Russell | 3 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
41 | 100096 | BORAL CLAY PITS | M | Surface | Intermittent | 03/16/2011 | M00202 | Boral Limited | L09675 | Boral Bricks Inc | AL | 1 | 113 | Russell | 3 | Corporation | 07/20/1995 | M3 | M3661 | Birmingham AL Field Office | ... |
42 | 100097 | No 4 Mines & Mill Or No 4 Mines | M | Surface | Abandoned | 06/08/1979 | M00037 | R H Bickerstaff | L00003 | Bickerstaff Clay Products Company Inc | AL | 1 | 113 | Russell | 3 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
43 | 100098 | Dixie Pit And Plant | M | Surface | Abandoned | 07/05/1993 | M32627 | Powell Gerald-W F Andrews | L32627 | Dixie Clay Company Of Alabama | AL | 1 | 15 | Calhoun | 3 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
44 | 100099 | SOUTHEAST REFRACTORIES, INC. | M | Surface | Abandoned | 01/03/2001 | M32684 | Jim Farrell; Doug Doss | L32684 | South East Refractories Inc | AL | 1 | 15 | Calhoun | 3 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
45 | 100100 | Fairhope Clay Products Incorporated | M | Surface | Abandoned | 03/13/1985 | M33158 | Jennings Bart Jr | L33158 | Fairhope Clay Products Inc | AL | 1 | 3 | Baldwin | 1 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
46 | 100101 | Stewart Mine | M | Surface | Abandoned | 01/08/1979 | M01265 | Dudley P Frame | L01420 | Frame Brick & Tile Company | AL | 1 | 15 | Calhoun | 3 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
47 | 100102 | Frame Mine & Mill Or Frame Mine | M | Surface | Abandoned | 10/13/1981 | M01265 | Dudley P Frame | L01420 | Frame Brick & Tile Company | AL | 1 | 15 | Calhoun | 3 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
48 | 100103 | Wheeler Lake | M | Surface | Abandoned | 03/06/1989 | M07480 | Marley Plc | L09534 | General Shale Products Corp | AL | 1 | 89 | Madison | 5 | Corporation | 06/30/1986 | M3 | M3811 | Franklin TN Field Office | ... |
49 | 100107 | Henry County Mine | M | Surface | Abandoned | 07/22/1988 | M00003 | Dresser Industries Inc | L00005 | Harbison-Walker Refractories U S | AL | 1 | 67 | Henry | 2 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
50 | 100109 | AXIS QUARRY | M | Surface | Abandoned | 04/22/2004 | M01644 | Holcim Ltd | 0051046 | Holcim (US) Incorporated | AL | 1 | 97 | Mobile | 1 | Corporation | 12/12/2001 | M3 | M3661 | Birmingham AL Field Office | ... |
51 | 100110 | Browder Pit | M | Surface | Abandoned | 08/21/1981 | M01543 | Jenkins Brick Company | L01719 | Jenkins Brick Company | AL | 1 | 101 | Montgomery | 2 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
52 | 100111 | Gober Pit | M | Surface | Abandoned | 07/05/1994 | M01543 | Jenkins Brick Company | L01719 | Jenkins Brick Company | AL | 1 | 51 | Elmore | 2 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
53 | 100113 | Brewton Mine And Plant | M | Surface | Abandoned | 01/08/1980 | M35119 | Keego Clay Prod Company Inc | L35119 | Keego Clay Prod Company Inc | AL | 1 | 53 | Escambia | 1 | Other | 01/01/1950 | M3 | M3000 | Southeast District - Birmingham | ... |
54 | 100114 | Cordova Loading | C | Facility | Abandoned | 07/29/1998 | C00866 | Drummond Company Inc | P17353 | Drummond Company, Inc. | AL | 1 | 127 | Walker | 4 | Corporation | 01/01/1950 | C11 | C1101 | Bessemer AL Field Office | ... |
55 | 100115 | Ragland | M | Surface | Active | 01/25/2013 | M11407 | G Geoff Dunlap | L14985 | Ragland Clay Products | AL | 1 | 115 | St Clair | 3 | Corporation | 11/08/1996 | M3 | M3661 | Birmingham AL Field Office | ... |
56 | 100122 | Parkwood Plant | M | Surface | Abandoned | 03/04/1994 | 0071891 | Vulcan Materials Company | L00017 | Vulcan Materials Company | AL | 1 | 73 | Jefferson | 6 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
57 | 100123 | Coosa River Clay Pit | M | Surface | Abandoned | 11/15/1982 | M00624 | Hepworth Plc | L00761 | W S Dickey Clay Manufacturing Company | AL | 1 | 7 | Bibb | 3 | Other | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
58 | 100124 | Bessemer Clay Mines | M | Facility | Abandoned | 05/14/1990 | M06908 | Hardin Donald A | L08724 | Donald Hardin Construction Company Inc | AL | 1 | 73 | Jefferson | 6 | Other | 04/09/1986 | M3 | M3661 | Birmingham AL Field Office | ... |
59 | 100125 | Watkins Brick & Tile Corp Mine #1 | M | Surface | Abandoned | 09/21/1989 | M07434 | Araneta Francisco | L09476 | Watkins Brick & Tile Corp | AL | 1 | 73 | Jefferson | 6 | Corporation | 05/01/1986 | M3 | M3661 | Birmingham AL Field Office | ... |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
84968 rows × 79 columns
df.head()
# pd.unique(df.PRIMARY_SIC)
# pd.unique(df.SECONDARY_SIC)
# pd.unique(df.CURRENT_103I)
MINE_ID | CURRENT_MINE_NAME | COAL_METAL_IND | CURRENT_MINE_TYPE | CURRENT_MINE_STATUS | CURRENT_STATUS_DT | CURRENT_CONTROLLER_ID | CURRENT_CONTROLLER_NAME | CURRENT_OPERATOR_ID | CURRENT_OPERATOR_NAME | STATE | BOM_STATE_CD | FIPS_CNTY_CD | FIPS_CNTY_NM | CONG_DIST_CD | COMPANY_TYPE | CURRENT_CONTROLLER_BEGIN_DT | DISTRICT | OFFICE_CD | OFFICE_NAME | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 100003 | O'Neal Quarry & Mill | M | Surface | Active | 01/22/1979 | 0041044 | Lhoist Group | L13586 | Lhoist North America | AL | 1 | 117 | Shelby | 6 | Other | 07/01/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
1 | 100004 | Brierfield Quarry | M | Surface | Active | 03/04/2003 | 0041044 | Lhoist Group | L13586 | Lhoist North America of Alabama, LLC | AL | 1 | 7 | Bibb | 3 | Other | 06/14/2000 | M3 | M3661 | Birmingham AL Field Office | ... |
2 | 100005 | Birmingham Plant | M | Surface | Abandoned | 08/15/1989 | 0041044 | Lhoist Group | L10998 | Allied Lime Company | AL | 1 | 73 | Jefferson | 6 | Other | 07/31/1989 | M3 | M3661 | Birmingham AL Field Office | ... |
3 | 100006 | Auburn Quarry | M | Surface | Active | 09/24/1976 | M00174 | Martin Marietta Materials Inc | L16197 | Martin Marietta Materials, Inc. | AL | 1 | 81 | Lee | 3 | Corporation | 01/17/2002 | M3 | M3661 | Birmingham AL Field Office | ... |
4 | 100008 | Landmark Plant | M | Surface | Active | 11/14/1975 | M31753 | Alan B Cheney | L31753 | Cheney Lime & Cement Company | AL | 1 | 117 | Shelby | 6 | Corporation | 01/01/1950 | M3 | M3661 | Birmingham AL Field Office | ... |
5 rows × 59 columns
for column in df.columns:
print column
MINE_ID CURRENT_MINE_NAME COAL_METAL_IND CURRENT_MINE_TYPE CURRENT_MINE_STATUS CURRENT_STATUS_DT CURRENT_CONTROLLER_ID CURRENT_CONTROLLER_NAME CURRENT_OPERATOR_ID CURRENT_OPERATOR_NAME STATE BOM_STATE_CD FIPS_CNTY_CD FIPS_CNTY_NM CONG_DIST_CD COMPANY_TYPE CURRENT_CONTROLLER_BEGIN_DT DISTRICT OFFICE_CD OFFICE_NAME ASSESS_CTRL_NO PRIMARY_SIC_CD PRIMARY_SIC PRIMARY_SIC_CD_1 PRIMARY_SIC_CD_SFX SECONDARY_SIC_CD SECONDARY_SIC SECONDARY_SIC_CD_1 SECONDARY_SIC_CD_SFX PRIMARY_CANVASS_CD PRIMARY_CANVASS SECONDARY_CANVASS_CD SECONDARY_CANVASS CURRENT_103I CURRENT_103I_DT PORTABLE_OPERATION PORTABLE_FIPS_ST_CD DAYS_PER_WEEK HOURS_PER_SHIFT PROD_SHIFTS_PER_DAY MAINT_SHIFTS_PER_DAY NO_EMPLOYEES PART48_TRAINING LONGITUDE LATITUDE AVG_MINE_HEIGHT MINE_GAS_CATEGORY_CD METHANE_LIBERATION NO_PRODUCING_PITS NO_NONPRODUCING_PITS NO_TAILING_PONDS PILLAR_RECOVERY_USED HIGHWALL_MINER_USED MULTIPLE_PITS MINERS_REP_IND SAFETY_COMMITTEE_IND MILES_FROM_OFFICE DIRECTIONS_TO_MINE NEAREST_TOWN
pd.unique(data.CURRENT_MINE_TYPE)
#qplot(data.NO_PRODUCING_PITS)+geom_histogram()
array(['Surface', 'Facility', 'Underground', nan], dtype=object)
gold = df.PRIMARY_SIC == "Gold Ore"
data = df[gold]
data['lon'] = -data.LONGITUDE
data['lon']
data['CURRENT_MINE_STATUS'][data['CURRENT_MINE_STATUS'] == "New Mine"] = "Active"
print "Total Gold Mines since 1970".format(len(data))
print "there are {} gold mines missing lat/longs".format(len(data[data.LONGITUDE.isnull()]))
active = data[data.CURRENT_MINE_STATUS=="Active"]
print "{} active mines".format(len(active))
print "{} active mines with missing lat/long".format(len(active[active.lon.isnull()]))
from ggplot import *
%matplotlib inline
ggplot(data, aes("lon", "LATITUDE", color = "CURRENT_MINE_STATUS"))+geom_point()
Total Gold Mines since 1970 there are 2544 gold mines missing lat/longs 78 active mines 5 active mines with missing lat/long
<ggplot: (305327097)>
data.groupby('CURRENT_MINE_STATUS').size()
CURRENT_MINE_STATUS Abandoned 2626 Active 78 Intermittent 92 NonProducing 9 Temporarily Idled 34 dtype: int64
# Write to file:
data.to_csv("/users/ryankelly/projects/ultura/active_goldmines.csv", sep=",")
#print addr.columns
gold_addr = addr[addr.PRIMARY_SIC_CD == "Gold Ore"]
print len(gold_addr)
print len(gold_addr[gold_addr.STREET.isnull()])
print len(gold_addr[gold_addr.ZIP_CD.isnull()])
print len(gold_addr[gold_addr.CITY.isnull()])
print len(gold_addr[gold_addr.STATE.isnull()])
print len(gold_addr[gold_addr.STREET.isnull() & gold_addr.ZIP_CD.isnull()])
2691 1146 25 15 22 15
print addr.columns
gold_addr[['STREET', "CITY", "STATE", 'MINE_STATUS', 'BUSINESS_NAME', 'CONTACT_TITLE', 'MINE_NAME']].tail()
Index([u'MINE_ID', u'MINE_NAME', u'CONTACT_TITLE', u'NEAREST_TOWN', u'BUSINESS_NAME', u'STREET', u'PO_BOX', u'CITY', u'STATE_ABBR', u'FIPS_STATE_CD', u'STATE', u'ZIP_CD', u'COUNTRY', u'PROVINCE', u'POSTAL_CD', u'MINE_TYPE_CD', u'MINE_STATUS', u'MINE_STATUS_DT', u'PRIMARY_SIC_CD', u'COAL_METAL_IND'], dtype='object')
STREET | CITY | STATE | MINE_STATUS | BUSINESS_NAME | CONTACT_TITLE | MINE_NAME | |
---|---|---|---|---|---|---|---|
84158 | Mile 128 Steese Hwy | Central | Alaska | Intermittent | John A Brown | Owner | John Brown Mine |
84159 | 3937 Dobro Drive | Fairbanks | Alaska | Intermittent | Daniel Even | Owner | Daniel Even |
84160 | 1725 Fiddle Way | Fairbanks | Alaska | Intermittent | Tracy Freel | Owner | Brant, Tracy |
84162 | 3800 Hwy 2 and 52 | Minot | North Dakota | Intermittent | Blue Ribbon Gold Inc | President | Cahoon #1 |
84163 | NA, P.O. box is only avalible option | Haines | Alaska | Intermittent | Hurt LLC | Owner | MK Falls |
5 rows × 7 columns
#data[['CURRENT_OPERATOR_NAME','STATE']]
gold_addr.
3541 1 4140 0 5310 0 5556 0 5657 0 5692 0 6278 0 6702 0 6937 1 7405 0 7472 0 7736 0 8675 1 12828 0 12891 0 ... 42823 0 42843 0 42846 0 59633 2 60215 0 66382 0 73544 1 73861 1 73966 0 83779 0 83965 1 84035 0 84037 0 84062 0 84274 0 Name: NO_TAILING_PONDS, Length: 78, dtype: float64