Wednesday 15 August 2012

python - pythonic way to aggregate arrays (numpy or not) -


I would like to do good work to collect data between an array (this is a bad record array, but this does not change

You have an array of data that you want to add to an axis: for example dtype = [(name, (np.str_, 8), (job , (Np.str_, 8), (income, np.uit 32)] and you want to keep the average income per job

I did this function, and in the example it would be called Should data (data, (Data, Key, Fan): data_key_to {{} (data, 'job', 'income', mean)


 [Value]): if data is not in_in.x (): data_per_k [at] [k] = [] data_ on [k] .endend (v) returns [(k, data_per_key [k])) data_per_key.keys ( )]  

I do not like this for Kashmir that I want to put it in line: do you have any ideas?

Thanks for taking your answer Uis

PS: I would like to keep it fun in the call so that you can also ask for the average, minimum ...

No comments:

Post a Comment