diff --git a/geopandas/base.py b/geopandas/base.py index abc8e9f..997032d 100644 --- a/geopandas/base.py +++ b/geopandas/base.py @@ -390,27 +390,6 @@ class GeoPandasBase(object): index=self.index, crs=self.crs) - # - # Implement standard operators for GeoSeries - # - - def __xor__(self, other): - """Implement ^ operator as for builtin set type""" - return self.symmetric_difference(other) - - def __or__(self, other): - """Implement | operator as for builtin set type""" - return self.union(other) - - def __and__(self, other): - """Implement & operator as for builtin set type""" - return self.intersection(other) - - def __sub__(self, other): - """Implement - operator as for builtin set type""" - return self.difference(other) - - def _array_input(arr): if isinstance(arr, (MultiPoint, MultiLineString, MultiPolygon)): # Prevent against improper length detection when input is a diff --git a/geopandas/geoseries.py b/geopandas/geoseries.py index 085382c..b8a9bc6 100644 --- a/geopandas/geoseries.py +++ b/geopandas/geoseries.py @@ -241,3 +241,23 @@ class GeoSeries(GeoPandasBase, Series): result.__class__ = GeoSeries result.crs = crs return result + + # + # Implement standard operators for GeoSeries + # + + def __xor__(self, other): + """Implement ^ operator as for builtin set type""" + return self.symmetric_difference(other) + + def __or__(self, other): + """Implement | operator as for builtin set type""" + return self.union(other) + + def __and__(self, other): + """Implement & operator as for builtin set type""" + return self.intersection(other) + + def __sub__(self, other): + """Implement - operator as for builtin set type""" + return self.difference(other)