@@ -86,7 +86,9 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
86
86
columns = ["State" , "ST" , "geometry" , "FIPS" , "STATEFP" , "NAME" ],
87
87
index = [max (gdf .index ) + 1 ],
88
88
)
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 )
90
92
91
93
f = 51515
92
94
singlerow = pd .DataFrame (
@@ -103,7 +105,9 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
103
105
columns = ["State" , "ST" , "geometry" , "FIPS" , "STATEFP" , "NAME" ],
104
106
index = [max (gdf .index ) + 1 ],
105
107
)
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 )
107
111
108
112
f = 2270
109
113
singlerow = pd .DataFrame (
@@ -120,19 +124,25 @@ def _create_us_counties_df(st_to_state_name_dict, state_to_st_dict):
120
124
columns = ["State" , "ST" , "geometry" , "FIPS" , "STATEFP" , "NAME" ],
121
125
index = [max (gdf .index ) + 1 ],
122
126
)
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 )
124
130
125
131
row_2198 = gdf [gdf ["FIPS" ] == 2198 ]
126
132
row_2198 .index = [max (gdf .index ) + 1 ]
127
133
row_2198 .loc [row_2198 .index [0 ], "FIPS" ] = 2201
128
134
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 )
130
138
131
139
row_2105 = gdf [gdf ["FIPS" ] == 2105 ]
132
140
row_2105 .index = [max (gdf .index ) + 1 ]
133
141
row_2105 .loc [row_2105 .index [0 ], "FIPS" ] = 2232
134
142
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 )
136
146
gdf = gdf .rename (columns = {"NAME" : "COUNTY_NAME" })
137
147
138
148
gdf_reduced = gdf [["FIPS" , "STATEFP" , "COUNTY_NAME" , "geometry" ]]
0 commit comments