diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index 54c6bb58411..2c99f3b4e93 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -1634,7 +1634,7 @@ def aggfunc_continuous(x): df_tree["parent"] = df_tree["parent"].str.rstrip("/") if cols: df_tree[cols] = dfg[cols] - df_all_trees = df_all_trees.append(df_tree, ignore_index=True) + df_all_trees = pd.concat([df_all_trees, df_tree], ignore_index=True) # we want to make sure than (?) is the first color of the sequence if args["color"] and discrete_color: diff --git a/packages/python/plotly/plotly/figure_factory/_county_choropleth.py b/packages/python/plotly/plotly/figure_factory/_county_choropleth.py index 5494e9c973e..65c5e5ffede 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, sort=True) + gdf = pd.concat([gdf, 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, sort=True) + gdf = pd.concat([gdf, 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, sort=True) + gdf = pd.concat([gdf, 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, sort=True) + gdf = pd.concat([gdf, 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, sort=True) + gdf = pd.concat([gdf, row_2105], sort=True) gdf = gdf.rename(columns={"NAME": "COUNTY_NAME"}) gdf_reduced = gdf[["FIPS", "STATEFP", "COUNTY_NAME", "geometry"]]