pandera.typing.geopandas.GeoDataFrame¶
- class pandera.typing.geopandas.GeoDataFrame(data=None, *args, geometry=None, crs=None, **kwargs)[source]¶
A generic type for geopandas.GeoDataFrame.
Attributes
TThe transpose of the DataFrame.
active_geometry_nameReturn the name of the active geometry column
areaReturns a
Seriescontaining the area of each geometry in theGeoSeriesexpressed in the units of the CRS.atAccess a single value for a row/column label pair.
attrsDictionary of global attributes of this dataset.
axesReturn a list representing the axes of the DataFrame.
boundaryReturns a
GeoSeriesof lower dimensional objects representing each geometry's set-theoretic boundary.boundsReturns a
DataFramewith columnsminx,miny,maxx,maxyvalues containing the bounds for each geometry.centroidReturns a
GeoSeriesof points representing the centroid of each geometry.columnsThe column labels of the DataFrame.
convex_hullReturns a
GeoSeriesof geometries representing the convex hull of each geometry.crsThe Coordinate Reference System (CRS) represented as a
pyproj.CRSobject.cxCoordinate based indexer to select by intersection with bounding box.
default_dtypedtypesReturn the dtypes in the DataFrame.
emptyIndicator whether Series/DataFrame is empty.
envelopeReturns a
GeoSeriesof geometries representing the envelope of each geometry.exteriorReturns a
GeoSeriesof LinearRings representing the outer boundary of each polygon in the GeoSeries.flagsGet the properties associated with this pandas object.
geom_typeReturns a
Seriesof strings specifying the Geometry Type of each object.geometryGeometry data for GeoDataFrame
has_sindexCheck the existence of the spatial index without generating it.
has_zReturns a
Seriesofdtype('bool')with valueTruefor features that have a z-component.iatAccess a single value for a row/column pair by integer position.
ilocPurely integer-location based indexing for selection by position.
indexThe index (row labels) of the DataFrame.
interiorsReturns a
Seriesof List representing the inner rings of each polygon in the GeoSeries.is_ccwReturns a
Seriesofdtype('bool')with valueTrueif a LineString or LinearRing is counterclockwise.is_closedReturns a
Seriesofdtype('bool')with valueTrueif a LineString's or LinearRing's first and last points are equal.is_emptyReturns a
Seriesofdtype('bool')with valueTruefor empty geometries.is_ringReturns a
Seriesofdtype('bool')with valueTruefor features that are closed.is_simpleReturns a
Seriesofdtype('bool')with valueTruefor geometries that do not cross themselves.is_validReturns a
Seriesofdtype('bool')with valueTruefor geometries that are valid.lengthReturns a
Seriescontaining the length of each geometry expressed in the units of the CRS.locAccess a group of rows and columns by label(s) or a boolean array.
ndimReturn an int representing the number of axes / array dimensions.
shapeReturn a tuple representing the dimensionality of the DataFrame.
sindexGenerate the spatial index
sizeReturn an int representing the number of elements in this object.
styleReturns a Styler object.
total_boundsReturns a tuple containing
minx,miny,maxx,maxyvalues for the bounds of the series as a whole.typeReturn the geometry type of each geometry in the GeoSeries
unary_unionReturns a geometry containing the union of all geometries in the
GeoSeries.valuesReturn a Numpy representation of the DataFrame.
Methods
- classmethod from_format(obj, config)[source]¶
Converts serialized data from a specific format specified in the
pandera.api.pandas.model.DataFrameModelconfig optionsfrom_formatandfrom_format_kwargs.- Parameters:
obj (
Any) – object representing a serialized dataframe.config – dataframe model configuration object.
- Return type:
GeoDataFrame
- classmethod pydantic_validate(obj, schema_model)[source]¶
Verify that the input can be converted into a pandas dataframe that meets all schema requirements.
This is for pydantic >= v2
- Return type:
GeoDataFrame
- classmethod to_format(data, config)[source]¶
Converts a geodataframe to the format specified in the
pandera.api.pandas.model.DataFrameModelconfig optionsto_formatandto_format_kwargs.- Parameters:
data (
GeoDataFrame) – convert this data to the specified formatconfig – :py:cl
- Return type: