Empty white space when plotting with Geopandas

Viewed 166

I am using Google Colab to try to plot some Geospatial data following this tutorial: Tutorial

Using the US Census .shp file: File this is the head of the data: df_head() and the .crs: crs

However every time I try to plot I get these weird empty spaces that looks like it's trying to plot the whole world map on the overlay like this: Geopandas Plot

My code is as simple as:

df_zipcodes = geopandas.read_file('cb_2018_us_zcta510_500k.shp')
df_zipcodes.plot()

Any thoughts? I tried changing the crs of the file but did not succeed, also I cleared and closed all figures before trying a new plot.

1 Answers

So I was trying to use the same filter as indicated in the tutorial:

df_states[~df_states['STUSPS'].isin(['AK','HI','AA','AE','AP','PR','RI','VI'])]

But in reality I had to apply:

df_states[~df_states['STUSPS'].isin(['PR', 'AK','VI','HI','AS','GU','MP'])]
Related