<commit_before><commit_msg>TST: Some tests for pandas methods returning GeoSeries type<commit_after>import unittest
from shapely.geometry import Point
from geopandas import GeoSeries


class TestSeries(unittest.TestCase):

    def setUp(self):
        N = self.N = 10
        r = 0.5
        self.pts = GeoSeries([Point(x, y) for x, y in zip(range(N), range(N))])
        self.polys = self.pts.buffer(r)

    def test_slice(self):
        assert type(self.pts[:2]) is GeoSeries
        assert type(self.pts[::2]) is GeoSeries
        assert type(self.polys[:2]) is GeoSeries

    def test_head(self):
        assert type(self.pts.head()) is GeoSeries

    def test_tail(self):
        assert type(self.pts.tail()) is GeoSeries

    def test_sort_index(self):
        assert type(self.pts.sort_index()) is GeoSeries

    def test_sort_order(self):
        """It's not clear this would be meaningful for GeoSeries"""
        assert type(self.pts.order()) is GeoSeries

    def test_loc(self):
        assert type(self.pts.loc[5:]) is GeoSeries

    def test_iloc(self):
        assert type(self.pts.iloc[5:]) is GeoSeries

    def test_fancy(self):
        idx = (self.pts.index % 2).astype(bool)
        assert type(self.pts[idx]) is GeoSeries

    def test_take(self):
        assert type(self.pts.take(range(0, self.N, 2))) is GeoSeries

    def test_select(self):
        # this method is actually entirely broken
        assert type(self.pts.select(lambda x: x % 2 == 0)) is GeoSeries

    def test_groupby(self):
        for f, s in self.pts.groupby(lambda x: x % 2):
            assert type(s) is GeoSeries
{'fraction_non_alphanumeric': 0.1154562383612663, 'fraction_numerical': 0.00931098696461825, 'mean_word_length': 2.810874704491726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '876803', 'n_tokens_mistral': 546, 'n_tokens_neox': 505, 'n_words': 144}