Hello, I'm an R user, who just started with numpy. I'm planning on setting up a large nutrient database. Here's my question:
I'm trying to reshape? or manipulate? the following array: array [['Food 1', 'Nutrient 1', 0.9], ['Food 1', 'Nutrient 2', 0.2], ['Food 2', 'Nutrient 1', 0.55], ['Food 2', 'Nutrient 2', 0.11]] into a new array that looks like this: array [['Food 1', 0.9, 0.2], ['Food 2', 0.55, 0.11]] or more simply: array [[0.9, 0.2], [0.55, 0.11]] In other words, the data and shape that I need in the first array is the 3rd column, where the row names are the 1st column and the column names are the 2nd column. I am thinking that I need to use .flat(), maybe with some kind of list comprehension? I really don't know, and would really appreciate some help. Thanks! -NT
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor