swn.SurfaceWaterNetwork.segments_series#
- SurfaceWaterNetwork.segments_series(value, name=None)#
Generate a Series along the segments index.
- Parameters:
- valuescalar, list, dict or pandas.Series
If value is a Series, it is checked to ensure it is has the same index as
segments
. Otherwise value as a scalar, list or dict is cast as a Series withsegments.index
.- namestr, default None
Name used for series, if provided.
- Returns:
- pandas.Series
Examples
>>> import geopandas >>> import swn >>> lines = geopandas.GeoSeries.from_wkt([ ... "LINESTRING (60 100, 60 80)", ... "LINESTRING (40 130, 60 100)", ... "LINESTRING (70 130, 60 100)"]) >>> n = swn.SurfaceWaterNetwork.from_lines(lines) >>> n.segments_series(1.2) 0 1.2 1 1.2 2 1.2 dtype: float64 >>> n.segments_series([3, 2, 1], "codes") 0 3 1 2 2 1 Name: codes, dtype: int64