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
T
The transpose of the DataFrame.
active_geometry_name
Return the name of the active geometry column
area
Returns a
Series
containing the area of each geometry in theGeoSeries
expressed in the units of the CRS.at
Access a single value for a row/column label pair.
attrs
Dictionary of global attributes of this dataset.
axes
Return a list representing the axes of the DataFrame.
boundary
Returns a
GeoSeries
of lower dimensional objects representing each geometry's set-theoretic boundary.bounds
Returns a
DataFrame
with columnsminx
,miny
,maxx
,maxy
values containing the bounds for each geometry.centroid
Returns a
GeoSeries
of points representing the centroid of each geometry.columns
The column labels of the DataFrame.
convex_hull
Returns a
GeoSeries
of geometries representing the convex hull of each geometry.crs
The Coordinate Reference System (CRS) represented as a
pyproj.CRS
object.cx
Coordinate based indexer to select by intersection with bounding box.
default_dtype
dtypes
Return the dtypes in the DataFrame.
empty
Indicator whether Series/DataFrame is empty.
envelope
Returns a
GeoSeries
of geometries representing the envelope of each geometry.exterior
Returns a
GeoSeries
of LinearRings representing the outer boundary of each polygon in the GeoSeries.flags
Get the properties associated with this pandas object.
geom_type
Returns a
Series
of strings specifying the Geometry Type of each object.geometry
Geometry data for GeoDataFrame
has_sindex
Check the existence of the spatial index without generating it.
has_z
Returns a
Series
ofdtype('bool')
with valueTrue
for features that have a z-component.iat
Access a single value for a row/column pair by integer position.
iloc
Purely integer-location based indexing for selection by position.
index
The index (row labels) of the DataFrame.
interiors
Returns a
Series
of List representing the inner rings of each polygon in the GeoSeries.is_ccw
Returns a
Series
ofdtype('bool')
with valueTrue
if a LineString or LinearRing is counterclockwise.is_closed
Returns a
Series
ofdtype('bool')
with valueTrue
if a LineString's or LinearRing's first and last points are equal.is_empty
Returns a
Series
ofdtype('bool')
with valueTrue
for empty geometries.is_ring
Returns a
Series
ofdtype('bool')
with valueTrue
for features that are closed.is_simple
Returns a
Series
ofdtype('bool')
with valueTrue
for geometries that do not cross themselves.is_valid
Returns a
Series
ofdtype('bool')
with valueTrue
for geometries that are valid.length
Returns a
Series
containing the length of each geometry expressed in the units of the CRS.loc
Access a group of rows and columns by label(s) or a boolean array.
ndim
Return an int representing the number of axes / array dimensions.
shape
Return a tuple representing the dimensionality of the DataFrame.
sindex
Generate the spatial index
size
Return an int representing the number of elements in this object.
style
Returns a Styler object.
total_bounds
Returns a tuple containing
minx
,miny
,maxx
,maxy
values for the bounds of the series as a whole.type
Return the geometry type of each geometry in the GeoSeries
unary_union
Returns a geometry containing the union of all geometries in the
GeoSeries
.values
Return 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.DataFrameModel
config optionsfrom_format
andfrom_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.DataFrameModel
config optionsto_format
andto_format_kwargs
.- Parameters:
data (
GeoDataFrame
) – convert this data to the specified formatconfig – :py:cl
- Return type: