AnsweredAssumed Answered

Error exporting Spatially Enabled DataFrame to shapefile

Question asked by johndinning.thecb on Jun 7, 2019

I'm running a jupyter notebook and using spatially enabled data frames for the first time. When I export the data to a shapefile following the example here, I am getting the error below. The export does producing the shapefile I'm looking for. But I'd like to know how to avoid the error message, so that I can share a clean jupyter notebook.


Any insights would be appreciated.



#Read csv as pandas dataframe (Monday)
Monday = pd.read_csv("Fall2018.csv", dtype={'BLDGCODE': 'str'})


#Import shapefile as Spatially Enabled Dataframe (Buildings)

Buildings = pd.DataFrame.spatial.from_featureclass("Shapefile/Building_Cartographic_Shape.shp")


#merge Monday data with Buildings polygons
MondayPolys = pd.merge(Monday, Buildings, how='left', on=['BLDGCODE'] , validate="one_to_many")


#Export to shapefile




ValueError                                Traceback (most recent call last)~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\pandas\core\ in __nonzero__(self)   1574         raise ValueError("The truth value of a {0} is ambiguous. "   1575                          "Use a.empty, a.bool(), a.item(), a.any() or a.all()."-> 1576                          .format(self.__class__.__name__))   1577    1578     __bool__ = __nonzero__ ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().