Skip to content

Commit 6a7e7f2

Browse files
committed
removed data/ folder and modified choropleth code to match file names
1 parent 5818d2b commit 6a7e7f2

10 files changed

+6
-7
lines changed

Diff for: plotly/figure_factory/_county_choropleth.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,29 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
2424
abs_dir_path = os.path.dirname(abs_file_path)
2525

2626
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/'
2828

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
3131
df_shape_pre2010 = gp.read_file(shape_pre2010)
3232
df_shape_pre2010['FIPS'] = (df_shape_pre2010['STATE'] +
3333
df_shape_pre2010['COUNTY'])
3434
df_shape_pre2010['FIPS'] = pd.to_numeric(df_shape_pre2010['FIPS'])
3535

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
3838

3939
# state df
4040
df_state = gp.read_file(states_path)
4141
df_state = df_state[['STATEFP', 'NAME', 'geometry']]
4242
df_state = df_state.rename(columns={'NAME': 'STATE_NAME'})
4343

44-
county_url = 'plotly/package_data/data/cb_2016_us_county_500k/'
4544
filenames = ['cb_2016_us_county_500k.dbf',
4645
'cb_2016_us_county_500k.shp',
4746
'cb_2016_us_county_500k.shx']
4847

4948
for j in range(len(filenames)):
50-
filenames[j] = county_url + filenames[j]
49+
filenames[j] = abs_package_data_dir_path + filenames[j]
5150

5251
dbf = io.open(filenames[0], 'rb')
5352
shp = io.open(filenames[1], 'rb')

0 commit comments

Comments
 (0)