I have this table in mysql, where I have the occurrences (CNT column) of each ITEM for each distinct ID:
ID ITEM CNT
---------------------
01 093 4
01 129F 2
01 AB56 0
01 BB44 0
01 XH7 0
01 TYE2 1
02 093 0
02 129F 3
02 AB56 1
02 BB44 0
02 XH7 2
02 TYE2 2
03 093 9
03 129F 2
03 AB56 0
03 BB44 1
03 XH7 4
03 TYE2 0
......
I would like to find an efficient way of importing this data from MySQL to Python so I can use them as item count vectors for a clustering procedure, in the form of a list of lists:
[[4,2,0,0,0,1],[0,3,1,0,2,2],[9,2,0,1,4,0]]
where each list represents an ID... I'm dealing with a lot of data (millions of rows) so performance is an issue.. Any help will be appreciated