10000 Fixing choropleth by Kully · Pull Request #940 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Fixing choropleth #940

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove unnecessary data files in tests and robust data-path searching
  • Loading branch information
Kully committed Feb 19, 2018
commit 065e59c385b09634d164b76dadb8cb7f37988386
13 changes: 10 additions & 3 deletions plotly/figure_factory/_county_choropleth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import io
import numpy as np
import os
import pandas as pd
import warnings

Expand All @@ -19,17 +20,23 @@

def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
# URLS
data_url = 'plotly/package_data/data/'
abs_file_path = os.path.realpath(__file__)
abs_dir_path = os.path.dirname(abs_file_path)

abs_plotly_dir_path = abs_dir_path[:abs_dir_path.find('/figure_factory')]
abs_data_dir_path = abs_plotly_dir_path + '/package_data/data/'

print abs_data_dir_path

shape_pre2010 = 'gz_2010_us_050_00_500k/gz_2010_us_050_00_500k.shp'
shape_pre2010 = data_url + shape_pre2010
shape_pre2010 = abs_data_dir_path + shape_pre2010
df_shape_pre2010 = gp.read_file(shape_pre2010)
df_shape_pre2010['FIPS'] = (df_shape_pre2010['STATE'] +
df_shape_pre2010['COUNTY'])
df_shape_pre2010['FIPS'] = pd.to_numeric(df_shape_pre2010['FIPS'])

states_path = 'cb_2016_us_state_500k/cb_2016_us_state_500k.shp'
states_path = data_url + states_path
states_path = abs_data_dir_path + states_path

# state df
df_state = gp.read_file(states_path)
Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0