Here is the relevant code:
import geopandas as gpd
#A shape file (.shp) is imported here, contents do not matter, since the "size()" function gets the size of the contents
shapefile = 'Data/Code_Specific/ne_50m_admin_1_states_provinces/ne_50m_admin_1_states_provinces.shp'
gdf = gpd.read_file(shapefile)[['admin', 'adm0_a3', 'postal', 'geometry']]
#size
#Return an int representing the number of elements in this object.
print(gdf.size())
I am getting an error for the last line of code,
TypeError: 'numpy.int32' object is not callable
The main purpose for this is that I am trying to integrade gdf.size() into a for loop:
for index in range(gdf.size()):
print("test", index)
#if Austrailia, remove
if gdf.get('adm0_a3')[index] == "AUS":
gdf = gdf.drop(gdf.index[index])
I have absolutely no clue what to do here, this is my first post on this site ever. Hope I don't get guilded with a badge of honor for how stupid or simple this is, I'm stumped.