Edit: here's the current code I've got so far:
itsct_nparr = arcpy.da.FeatureClassToNumPyArray(prItsct, ['FID_preproc','NAME','Shape_Area'])
itsct_df = DataFrame(itsct_nparr, columns=['FID_preproc','NAME','Shape_Area'])
maxarea = itsct_df.groupby(['FID_preproc','NAME'], as_index=False).max()
maxarea.to_csv(csvout)
del itsct_nparr
I need to come up with a solution that allows me to summarize an input table, performing a GroupBy on 2 columns ("FID_preproc" and "Shape_Area") and keep all of the fields in the original table in the output/result. From there I'll be joining that result with another table and calculating a field using the NAME column.
From the example, I need to maintain the FID_preproc, and NAME fields (see the desired result). GroupBy on FID_preproc and MAX(Shape_Area).
Any method is acceptable (numpy, pandas, summarize table, da.SearchCursor, etc.) -- whatever you have I can use!
Input: | | |
FID_preproc | NAME | Shape_Area |
1340 | A | 25952.35775 |
1341 | A | 118099.5219 |
1341 | B | 305220.1244 |
1342 | A | 12053.13585 |
| | |
Desired Result: | | |
FID_preproc | NAME | Shape_Area |
1340 | A | 25952.35775 |
1341 | B | 305220.1244 |
1342 | A | 12053.13585 |