@@ -24,30 +24,29 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
24
24
abs_dir_path = os .path .dirname (abs_file_path )
25
25
26
26
abs_plotly_dir_path = abs_dir_path [:abs_dir_path .find ('/figure_factory' )]
27
- abs_data_dir_path = abs_plotly_dir_path + '/package_data/data /'
27
+ abs_package_data_dir_path = abs_plotly_dir_path + '/package_data/'
28
28
29
- shape_pre2010 = 'gz_2010_us_050_00_500k/gz_2010_us_050_00_500k .shp'
30
- shape_pre2010 = abs_data_dir_path + shape_pre2010
29
+ shape_pre2010 = 'gz_2010_us_050_00_500k.shp'
30
+ shape_pre2010 = abs_package_data_dir_path + shape_pre2010
31
31
df_shape_pre2010 = gp .read_file (shape_pre2010 )
32
32
df_shape_pre2010 ['FIPS' ] = (df_shape_pre2010 ['STATE' ] +
33
33
df_shape_pre2010 ['COUNTY' ])
34
34
df_shape_pre2010 ['FIPS' ] = pd .to_numeric (df_shape_pre2010 ['FIPS' ])
35
35
36
- states_path = 'cb_2016_us_state_500k/cb_2016_us_state_500k .shp'
37
- states_path = abs_data_dir_path + states_path
36
+ states_path = 'cb_2016_us_state_500k.shp'
37
+ states_path = abs_package_data_dir_path + states_path
38
38
39
39
# state df
40
40
df_state = gp .read_file (states_path )
41
41
df_state = df_state [['STATEFP' , 'NAME' , 'geometry' ]]
42
42
df_state = df_state .rename (columns = {'NAME' : 'STATE_NAME' })
43
43
44
- county_url = 'plotly/package_data/data/cb_2016_us_county_500k/'
45
44
filenames = ['cb_2016_us_county_500k.dbf' ,
46
45
'cb_2016_us_county_500k.shp' ,
47
46
'cb_2016_us_county_500k.shx' ]
48
47
49
48
for j in range (len (filenames )):
50
- filenames [j ] = county_url + filenames [j ]
49
+ filenames [j ] = abs_package_data_dir_path + filenames [j ]
51
50
52
51
dbf = io .open (filenames [0 ], 'rb' )
53
52
shp = io .open (filenames [1 ], 'rb' )
0 commit comments