.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_san_francisco_trees.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_san_francisco_trees.py: Quadtree of San Francisco street trees ====================================== This example shows the geospatial nullity pattern (whether records are more or less likely to be null in one region versus another) of a dataset on city-maintained street trees by species in San Francisco. In this case we see that there is small but significant amount of variation in the percentage of trees classified per area, which ranges from 88% to 98%. For more tools for visualizing data nullity, `check out the ``missingno`` library `_. .. GENERATED FROM PYTHON SOURCE LINES 15-32 .. image:: /gallery/images/sphx_glr_plot_san_francisco_trees_001.png :alt: plot san francisco trees :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /Users/alekseybilogur/opt/miniconda3/envs/geoplot-dev/lib/python3.8/site-packages/geopandas/geoseries.py:644: UserWarning: GeoSeries.isna() previously returned True for both missing (None) and empty geometries. Now, it only returns True for missing values. Since the calling GeoSeries contains empty geometries, the result has changed compared to previous versions of GeoPandas. Given a GeoSeries 's', you can use 's.is_empty | s.isna()' to get back the old behaviour. To further ignore this warning, you can do: import warnings; warnings.filterwarnings('ignore', 'GeoSeries.isna', UserWarning) return self.isna() | .. code-block:: default import geopandas as gpd import geoplot as gplt import geoplot.crs as gcrs trees = gpd.read_file(gplt.datasets.get_path('san_francisco_street_trees_sample')) sf = gpd.read_file(gplt.datasets.get_path('san_francisco')) ax = gplt.quadtree( trees.assign(nullity=trees['Species'].notnull().astype(int)), projection=gcrs.AlbersEqualArea(), hue='nullity', nmax=1, cmap='Greens', scheme='Quantiles', legend=True, clip=sf, edgecolor='white', linewidth=1 ) gplt.polyplot(sf, facecolor='None', edgecolor='gray', linewidth=1, zorder=2, ax=ax) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 7.568 seconds) .. _sphx_glr_download_gallery_plot_san_francisco_trees.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_san_francisco_trees.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_san_francisco_trees.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_