From b6efa41ff93f08be8659fc9997d58a61e7d92c77 Mon Sep 17 00:00:00 2001 From: harupy Date: Sat, 2 Nov 2019 01:14:10 +0900 Subject: [PATCH] Add sort=True --- .../plotly/plotly/figure_factory/_county_choropleth.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/python/plotly/plotly/figure_factory/_county_choropleth.py b/packages/python/plotly/plotly/figure_factory/_county_choropleth.py index 93a840ad785..5e8dfea47a0 100644 --- a/packages/python/plotly/plotly/figure_factory/_county_choropleth.py +++ b/packages/python/plotly/plotly/figure_factory/_county_choropleth.py @@ -86,7 +86,7 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict): columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"], index=[max(gdf.index) + 1], ) - gdf = gdf.append(singlerow) + gdf = gdf.append(singlerow, sort=True) f = 51515 singlerow = pd.DataFrame( @@ -103,7 +103,7 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict): columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"], index=[max(gdf.index) + 1], ) - gdf = gdf.append(singlerow) + gdf = gdf.append(singlerow, sort=True) f = 2270 singlerow = pd.DataFrame( @@ -120,19 +120,19 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict): columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"], index=[max(gdf.index) + 1], ) - gdf = gdf.append(singlerow) + gdf = gdf.append(singlerow, sort=True) row_2198 = gdf[gdf["FIPS"] == 2198] row_2198.index = [max(gdf.index) + 1] row_2198.loc[row_2198.index[0], "FIPS"] = 2201 row_2198.loc[row_2198.index[0], "STATEFP"] = "02" - gdf = gdf.append(row_2198) + gdf = gdf.append(row_2198, sort=True) row_2105 = gdf[gdf["FIPS"] == 2105] row_2105.index = [max(gdf.index) + 1] row_2105.loc[row_2105.index[0], "FIPS"] = 2232 row_2105.loc[row_2105.index[0], "STATEFP"] = "02" - gdf = gdf.append(row_2105) + gdf = gdf.append(row_2105, sort=True) gdf = gdf.rename(columns={"NAME": "COUNTY_NAME"}) gdf_reduced = gdf[["FIPS", "STATEFP", "COUNTY_NAME", "geometry"]]