I'm trying to create a csv from a query of a feature layer hosted in ArcGIS Online. The csv only needs to contain one field, where the query is met, geometry is not needed. I'm having issues getting the queried data moved into a dataframe and exported into a csv. From what I've read, you can use the SpatiallyEnabledDataframe to query and export data from a feature, but I'm getting stuck generating the dataframe.
from arcgis.gis import GIS from arcgis.features import FeatureLayer from arcgis.features import manage_data from datetime import date, time import pandas as pd from arcgis.features import SpatialDataFrame gis = GIS("https://------", username="---------", password="---------") item_id='---------' get = gis.content.get(item_id) feeder = get.layers sdf = pd.DataFrame.spatial.from_layer(feeder) df = feeder.query(where="feeder_status = 'Closed'").sdf df.head()
This throws the following error: AttributeError: type object 'DataFrame' has no attribute 'spatial'
Is this error thrown because pandas is looking for the features geometry?