Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a3d9d30

Browse filesBrowse files
harupyemmanuelle
authored andcommitted
Add sort=True (plotly#1856)
1 parent d68b369 commit a3d9d30
Copy full SHA for a3d9d30

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎packages/python/plotly/plotly/figure_factory/_county_choropleth.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/figure_factory/_county_choropleth.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
8686
columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"],
8787
index=[max(gdf.index) + 1],
8888
)
89-
gdf = gdf.append(singlerow)
89+
gdf = gdf.append(singlerow, sort=True)
9090

9191
f = 51515
9292
singlerow = pd.DataFrame(
@@ -103,7 +103,7 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
103103
columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"],
104104
index=[max(gdf.index) + 1],
105105
)
106-
gdf = gdf.append(singlerow)
106+
gdf = gdf.append(singlerow, sort=True)
107107

108108
f = 2270
109109
singlerow = pd.DataFrame(
@@ -120,19 +120,19 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
120120
columns=["State", "ST", "geometry", "FIPS", "STATEFP", "NAME"],
121121
index=[max(gdf.index) + 1],
122122
)
123-
gdf = gdf.append(singlerow)
123+
gdf = gdf.append(singlerow, sort=True)
124124

125125
row_2198 = gdf[gdf["FIPS"] == 2198]
126126
row_2198.index = [max(gdf.index) + 1]
127127
row_2198.loc[row_2198.index[0], "FIPS"] = 2201
128128
row_2198.loc[row_2198.index[0], "STATEFP"] = "02"
129-
gdf = gdf.append(row_2198)
129+
gdf = gdf.append(row_2198, sort=True)
130130

131131
row_2105 = gdf[gdf["FIPS"] == 2105]
132132
row_2105.index = [max(gdf.index) + 1]
133133
row_2105.loc[row_2105.index[0], "FIPS"] = 2232
134134
row_2105.loc[row_2105.index[0], "STATEFP"] = "02"
135-
gdf = gdf.append(row_2105)
135+
gdf = gdf.append(row_2105, sort=True)
136136
gdf = gdf.rename(columns={"NAME": "COUNTY_NAME"})
137137

138138
gdf_reduced = gdf[["FIPS", "STATEFP", "COUNTY_NAME", "geometry"]]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.