centroid#

GeosDataFrameAccessor.centroid(*args, inplace=False, **kwargs)#

Computes the geometric center (center-of-mass) of a geometry.

Applies pgpd.GeosSeriesAccessor.centroid() to each column of “geos” dtype and aggregates the results in a DataFrame.

Parameters:
  • args – Arguments passed to centroid() after the first argument.

  • inplace (bool, optional) – Whether to perform the modifications inplace; Default False.

  • kwargs – Keyword arguments passed to centroid().

Returns:

DataFrame where each “geos” column from the original is transformed or None if inplace=True.

Return type:

pandas.DataFrame or None