http://geopandas.org/ https://geohackweek.github.io/vector/06-geopandas-advanced/
In [1]:
!dir
In [ ]:
#import the package
import geopandas as gpd
In [ ]:
#enable plots to appear in the notebook
%matplotlib inline
In [ ]:
#read in the HUC12.shp feature class
gdf = gpd.read_file('../Data/HUC12.shp')
In [ ]:
#How many features in the dataset?
len(gdf)
In [ ]:
#show the data types in this dataset
gdf.dtypes
In [ ]:
#examine the attributes for the first feature
gdf.iloc[0]
In [ ]:
#show the first 5 values in the geometry field
gdf['geometry'][0:5]
In [ ]:
#show just the first value
gdf['geometry'][0]
In [ ]:
#Plotting
gdf.plot(column='HUC_8',
cmap='Paired',
categorical=True,
figsize=(14,18)
);
In [ ]:
#Dissolving
cols = []
huc8 =