Use pd.notnull() not bool()

bool(np.nan) evaluates to True. notnull() should be more of what
we want here.
This commit is contained in:
Jacob Wasserman committed 2014-10-13 09:57:46 +01:00
1 parent 301a26cf1c
commit 3f20779237
1 file changed
+2 -1
+2 -1
View File
@@ -6,6 +6,7 @@ from shapely.ops import cascaded_union, unary_union
import shapely.affinity as affinity
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, MultiIndex
import geopandas as gpd
@@ -70,7 +71,7 @@ class GeoPandasBase(object):
else:
stream = ((i, item.bounds, idx) for i, (idx, item) in
enumerate(self.geometry.iteritems()) if
item and not item.is_empty)
pd.notnull(item) and not item.is_empty)
try:
self._sindex = SpatialIndex(stream)
# What we really want here is an empty generator error, or