Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: "extending" BinCounts, need for speed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15994] RE: [mg15871] "extending" BinCounts, need for speed
  • From: "Jean-Marie THOMAS" <jmthomas at agat.net>
  • Date: Fri, 19 Feb 1999 03:27:09 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Is that what you need?
myList=Table[{Random[],Random[]},{50000}];
Timing[bin=Map[Apply[Plus,#]&,myList];]

On my machine bin is defined in less than 10 secs.

Hope this helps,


****************************************
Jean-Marie THOMAS
mailto:jmthomas at agat.net
Conseil et Audit en Ingnierie de Calcul
Strasbourg, France
http://www.agat.net
****************************************

-----Original Message-----
From: Olivier Pelletier [mailto:pelletie at lps.u-psud.fr]
To: mathgroup at smc.vnet.net
Subject: [mg15994] [mg15871] "extending" BinCounts, need for speed


Hi,

I have a huge (i.e. Length[list]>50000) list of points (a point being a
list {ai,bi})
I need to process it using a BinCounts-like function doing the
following:
if ai is in the i-th "bin" then I should add bi to the value of this
bin. (BinCounts  takes a list of numbers and adds unity to the bin
corresponding to the value of the number).
Using Do[bin[[ai]]+= bi, {i,Length[my_list]}] simply takes too much
time.
Any suggestion to improve the speed.
Thanks to everyone in advance

Olivier




  • Prev by Date: 3D data graphing
  • Next by Date: Re: Plot[] problem (plnr) - help !!!
  • Previous by thread: "extending" BinCounts, need for speed
  • Next by thread: Re: "extending" BinCounts, need for speed