Why data inspection matters

When you're preparing your data, it's good to know the data you're dealing with. For example, listing statistics about your dataset that show you how many elements there are, and if there are any missing values. It's common that data has to be cleaned up before doing the analysis. Because the GeoPandas data objects are subclasses of pandas data objects, you can use their methods to do data inspection and cleaning. Take, for instance, the wildfire data shapefile we used earlier. By listing our dataframe object, it not only prints all of the attribute data, but also lists the total rows and columns, which is 20340 rows and 30 columns. The total amount of rows can also be printed this way:

In:        len(fires.index)Out: ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.