@@ -86,7 +86,9 @@ 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 , sort = True )
89+ gdf_old = gdf .append (singlerow , sort = True )
90+ gdf = pd .concat ([gdf , singlerow ], sort = True )
91+ assert gdf .equals (gdf_old )
9092
9193 f = 51515
9294 singlerow = pd .DataFrame (
@@ -103,7 +105,9 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
103105 columns = ["State" , "ST" , "geometry" , "FIPS" , "STATEFP" , "NAME" ],
104106 index = [max (gdf .index ) + 1 ],
105107 )
106- gdf = gdf .append (singlerow , sort = True )
108+ gdf_old = gdf .append (singlerow , sort = True )
109+ gdf = pd .concat ([gdf , singlerow ], sort = True )
110+ assert gdf .equals (gdf_old )
107111
108112 f = 2270
109113 singlerow = pd .DataFrame (
@@ -120,19 +124,25 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
120124 columns = ["State" , "ST" , "geometry" , "FIPS" , "STATEFP" , "NAME" ],
121125 index = [max (gdf .index ) + 1 ],
122126 )
123- gdf = gdf .append (singlerow , sort = True )
127+ gdf_old = gdf .append (singlerow , sort = True )
128+ gdf = pd .concat ([gdf , singlerow ], sort = True )
129+ assert gdf .equals (gdf_old )
124130
125131 row_2198 = gdf [gdf ["FIPS" ] == 2198 ]
126132 row_2198 .index = [max (gdf .index ) + 1 ]
127133 row_2198 .loc [row_2198 .index [0 ], "FIPS" ] = 2201
128134 row_2198 .loc [row_2198 .index [0 ], "STATEFP" ] = "02"
129- gdf = gdf .append (row_2198 , sort = True )
135+ gdf_old = gdf .append (row_2198 , sort = True )
136+ gdf = pd .concat ([gdf , row_2198 ], sort = True )
137+ assert gdf .equals (gdf_old )
130138
131139 row_2105 = gdf [gdf ["FIPS" ] == 2105 ]
132140 row_2105 .index = [max (gdf .index ) + 1 ]
133141 row_2105 .loc [row_2105 .index [0 ], "FIPS" ] = 2232
134142 row_2105 .loc [row_2105 .index [0 ], "STATEFP" ] = "02"
135- gdf = gdf .append (row_2105 , sort = True )
143+ gdf_old = gdf .append (row_2105 , sort = True )
144+ gdf = pd .concat ([gdf , row_2105 ], sort = True )
145+ assert gdf .equals (gdf_old )
136146 gdf = gdf .rename (columns = {"NAME" : "COUNTY_NAME" })
137147
138148 gdf_reduced = gdf [["FIPS" , "STATEFP" , "COUNTY_NAME" , "geometry" ]]
0 commit comments