I am running a function developed by Esri to get list of values in a integer column of a spatial table (however, the same behaviour is observed even when running the function on a non-spatial table). According to the help, I should get NumPy structured array. After running the function, I have a numpy array. I run print in this format:
in_table = r"C:\geodb101@server.sde\DataTable" #
data = arcpy.da.TableToNumPyArray(in_table, "Field3")
print data
Which gives me back this in IDE (copy/pasted from IDE interpreter):
[(20130825,) (20130827,) (20130102,)]
I am running:
allvalues = data.tolist()
and getting:
[(20130825,), (20130827,), (20130102,)]
Same result when running data.reshape(len(data)).tolist()
as suggested in comments.
Running type()
lets me know that in the first case it is <type 'numpy.ndarray'>
and in the second case <type 'list'>
. I am expecting to get my output list in another format [20130825, 20130827, 20130102]
. What am I doing wrong or what else should I do to get the output list in the specified format?