@property
    def _ndim(self):
        try:
            # From array protocol
            array = self.context.__array_interface__
            n = array['shape'][1]
            assert n == 2 or n == 3
            return n
        except __HOLE__:
            # Fall back on list
            return len(self.context[0])
dataset/ETHPy150Open Toblerity/Shapely/shapely/geometry/linestring.py/LineStringAdapter._ndim