Select to view content in your preferred language

API Python view attribute table of a webmap layer

456
1
11-26-2022 03:34 PM
RoslynPeters
New Contributor

Hello, I have been struggling to open the attribute tables for these data layers. I want to be able to view the TOTACRES field, and use that to view the sum of that field. What would an example look like to view attributes?

These are the layers I brought in already

RoslynPeters_0-1669506075175.png

 

1 Reply
NicholasGiner1
Esri Contributor

Hi @RoslynPeters - thanks for the question.  You can read in the feature layers as Spatially enabled dataframes (SeDF) and work with them as you would a traditional Pandas dataframe.  You can use the code snippet to retrieve the feature layer and convert to SeDF from this link

NicholasGiner1_0-1685980615299.png

then use the .sum() function to calculate the total from the column you need.

NicholasGiner1_1-1685980786373.png

 

0 Kudos