pandera.engines.geopandas_engine.Geometry

class pandera.engines.geopandas_engine.Geometry(crs=None)[source]

geopandas的语义表示 geopandas.array.GeometryDtype

通过允许指定在GeometryArray、GeoSeries和GeoDataFrame中找到的坐标参考系统(CRS),扩展了原生的GeometryDtype。当定义了CRS时,验证器将检查匹配的CRS,而coerce将通过GeoPandas的‘to_crs’方法转换坐标值。否则,数据的CRS将被忽略。

属性

auto_coerce

在所有情况下是否强制转换为True

continuous

数字数据类型是否是连续的。

crs

几何对象的坐标参考系统。

type

由数据类型封装的原生 pandas 数据类型。

方法

__init__(crs=None)[source]
check(pandera_dtype, data_container=None)[source]

检查数据容器是否符合指定的数据类型。

Return type:

Union[bool, Iterable[bool]]

coerce(data_container)[source]

将数据容器强制转换为指定的数据类型。

Return type:

Union[Series, DataFrame, GeoSeries, GeoDataFrame]

coerce_value(value)[source]

将一个值强制转换为特定类型。

Return type:

Any

try_coerce(data_container)[source]

强制数据容器转换为数据类型, 如果强制转换失败,则引发 ParserError :raises: ParserError: 如果强制转换失败

Return type:

Union[Series, DataFrame]

__call__(data_container)[source]

将数据容器强制转换为数据类型。