Recently a question made me think of how to calculate statistics of all fields (all attributes) for each record of an attribute table. See thread here:how to add up all the fields in an attribute table
The OP actually wanted to get the summary statistics of a field (not sum all fields of a record), but I thought I would share a snippet of how you can accomplish this. See the code below:
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">main</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="comment token"># input featureclass and output field</SPAN>
fc <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'C:\GeoNet\SumAllFields\data.gdb\test_pol'</SPAN>
fld_result <SPAN class="operator token">=</SPAN> <SPAN class="string token">'AvgDate'</SPAN>
<SPAN class="comment token"># settings to play with</SPAN>
wild_card <SPAN class="operator token">=</SPAN> <SPAN class="string token">'*DATE'</SPAN> <SPAN class="comment token">#'FLD*'</SPAN>
stats_type <SPAN class="operator token">=</SPAN> <SPAN class="string token">'mean'</SPAN> <SPAN class="comment token"># min, max, sum, mean, count, std</SPAN>
fld_types <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'Date'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Double'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Integer'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Single'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SmallInteger'</SPAN><SPAN