April 2018
Beginner to intermediate
440 pages
11h 36m
English
The following script combines pandas dataframe methods on GeoPandas GeoDataFrame objects. Together, you can easily subset data and plot separate feature geometries. We start with importing the module, the magic command for plotting data inside a Juypter Notebook and input data, which is a shapefile with all US state boundaries:
In: import geopandas as gpd %matplotlib inline df = gpd.read_file\ (r"C:\data\gdal\NE\110m_cultural\ne_110m_admin_1_states_provinces.shp" ) df
Some simple data inspection methods—type(df) returns the object type, which is a GeoPandas GeoDataFrame, which takes in the same methods as pandas dataframes. The shape method returns a tuple with rows and column ...