TableToNumPyArray—Data Access module | ArcGIS Desktop
NumPyArrayToTable—Data Access module | ArcGIS Desktop
a = arcpy.da.TableToNumPyArray(in_fc, "*", skip_nulls=True)
a.dtype.names
('OBJECTID', 'Shape', 'Id', 'Long_1', 'Short_1', 'Float_1', 'Double_1', 'Text_1',
'DT_str', 'Shape_Length', 'Shape_Area')
a0 = a[['Long_1', 'Double_1', 'Text_1']]
a0
array([(1, 100., 'A 10 chars'), (3, 300., 'C not null')],
dtype={'names':['Long_1','Double_1','Text_1'], 'formats':['<i4','<f8','<U10'],
'offsets':[24,36,44], 'itemsize':180})
np.sum(a0['Long_1'])
4
np.min(a0['Double_1'])
100.0
q = np.where(a0['Double_1'] > 200)
a0[q]
array([(3, 300., 'C not null')],
dtype={'names':['Long_1','Double_1','Text_1'], 'formats':['<i4','<f8','<U10'], 'offsets':[24,36,44], 'itemsize':180})
ar = a.view(np.recarray)
ar.Shape
array([[ 300005. , 5000005. ],
[ 300020. , 5000010.22]])
ar.Long_1
array([1, 3])
ar.DT_str
array(['2019/03/28 00:00:00', '2019/03/30 00:00:00'], dtype='<U20')