Since collection.Counter is so slow, I am pursuing a faster method of summing displayed values in Python 2.7. This seems like a simple concept, and I'm a little disappointed with the built-in Counter method.
Basically, I need to have arrays like this:
array([[ 0., 2.],
[ 2., 2.],
[ 3., 1.]])
array([[ 0., 3.],
[ 1., 1.],
[ 2., 5.]])
And then add them so that they look like this:
array([[ 0., 5.],
[ 1., 1.],
[ 2., 7.],
[ 3., 1.]])
Unless you have a good way to do this quickly and efficiently, I am open to any other ideas that will allow me to do something similar to this, and I am open to modules other than Numpy.
Thank!
Edit: Ready for some speed indicators? Intel won a 64-bit machine. All of the following values are in seconds; 20,000 cycles.
collections.Counter results: 2.131000, 2.125000, 2.125000
Divakar union1d + : 1.641000, 1.633000, 1.625000
Divakar union1d + : 0,625000, 0,625000, 0,641000
: 1,844000, 1,938000, 1,858000
Pandas : 16.659000, 16.686000, 16.885000
: union1d +, Pandas, , , , . , , . , . !
: , Counter1.update(Counter2.elements()) , , (65.671000 ).
Edit: , , Numpy , , , , . , Pandas , Numpy, 0-, (, Numpy , GAE, ). , , , , , - , , - , .