From e6251da15904ce55a9dcc137eec33aabaa322cfb Mon Sep 17 00:00:00 2001 From: Kelsey Jordahl Date: Tue, 28 Apr 2015 22:08:08 -0700 Subject: [PATCH] CLN: Use apply() rather than str to get len of each element --- geopandas/tools/sjoin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geopandas/tools/sjoin.py b/geopandas/tools/sjoin.py index 5491aee..2e09dbf 100644 --- a/geopandas/tools/sjoin.py +++ b/geopandas/tools/sjoin.py @@ -52,7 +52,7 @@ def sjoin(left_df, right_df, how='inner', op='intersects', # FIND INTERSECTION OF SPATIAL INDEX idxmatch = (left_df['geometry'].apply(lambda x: x.bounds) .apply(lambda x: list(tree_idx.intersection(x)))) - idxmatch = idxmatch[idxmatch.str.len() > 0] + idxmatch = idxmatch[idxmatch.apply(len) > 0] r_idx = np.concatenate(idxmatch.values) l_idx = np.concatenate([[i] * len(v) for i, v in idxmatch.iteritems()])