I am trying to make an array from list of tuples. It should be 2D array with 28193 rows and 28 columns. The last 3 columns are float other are int.
This is my code:
results = cur.execute('SELECT * from matches').fetchall()
array_type = np.dtype('int64, int64, int64, int64, int64, int64, int64, int64, int64, int64,'
' int64, int64, int64, int64, int64, int64, int64, int64, int64, int64,'
' int64, int64, int64, int64, int64, float64, float64, float'
)
arr = np.array(results, dtype=array_type)
What I receive is (28193, ) shape.
The strange part is that if I remove the dtype parameter in the array definition it gets created properly. I've compared and counted the columns multiple times...
Here is a sample row:
1 735083 1 1 1 24 0 4 2 0 1 2 6 22 15 0 9 10 8 5 8 1 1 1 0 3 3.4 2.5
And datatypes in the DB are the same: int*25, float*3
Thanks!