Essentially, I need to get a Numpy array (rows = x, cols = 3) to a geodatabase table. What is happening is when I specify the dtype of the array to get the field names / types for the table, the array gets reshaped.

Any ideas?

`#format array to create table from`

#array of nearest values... reshaped to: rows=(inXY * toReturn), columns=3

formArray = numpy.array(listArray).reshape(-1,3)

dts = [('IN_OID', '<i4'),('NEAR_OID', '<i4'),('NEAR_DIST', '<f8')]

finalArray = numpy.rec.fromrecords(formArray, dtype = dts)

#export to geodatabase table

arcpy.da.NumPyArrayToTable(finalArray, r'...\ArcGIS\Default.gdb\out_table')

How the array structure should look: How the array looks after specifying dtype

And this is what the output table looks like (notice it has 60 rows... it should only contain 20)

Don't respecify the dtype. your structured array (and recarrays) will have a dtype with a shape of (N, ) where N is the number of records. You don't reshape a structured array to make it 'look' pretty, because adding that extra dimension will foul up your conversion to a table.

My Bloghas dozens of posts on the use of numpy including some of the basics etc. So what you had was fine until you reshaped it and added the extra dimension turning each row into 3