From: Xavier G. <gn...@ob...> - 2006-10-24 16:31:40
|
Hi, I have a set of 3 1D large arrays. The first 2 one stand for the coordinates of particules and the last one for their masses. I would like to be able to plot this data ie to compute a 2D histogram summing the masses in each bin. I cannot find a way to do that without any loop on the indices resulting too a very slow function. I'm looking for an elegant way to do that with numpy (or scipy??) function. For instance, scipy.histogram2d cannot do the job because it only counts the number of samples in each bin. There is no way to deal with weights. Xavier. -- ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gn...@ob... ############################################ |
From: David H. <dav...@gm...> - 2006-10-24 17:02:36
|
Hi Xavier, You could tweak histogram2d to do what you want, or you could give me a couple of days and I'll do it and let you know. If you want to help, you could write a test using your particular application and data. David 2006/10/24, Xavier Gnata <gn...@ob...>: > > Hi, > > I have a set of 3 1D large arrays. > The first 2 one stand for the coordinates of particules and the last one > for their masses. > I would like to be able to plot this data ie to compute a 2D histogram > summing the masses in each bin. > I cannot find a way to do that without any loop on the indices resulting > too a very slow function. > > I'm looking for an elegant way to do that with numpy (or scipy??) > function. > > For instance, scipy.histogram2d cannot do the job because it only counts > the number of samples in each bin. > There is no way to deal with weights. > > Xavier. > > > -- > ############################################ > Xavier Gnata > CRAL - Observatoire de Lyon > 9, avenue Charles Andr=E9 > 69561 Saint Genis Laval cedex > Phone: +33 4 78 86 85 28 > Fax: +33 4 78 86 83 86 > E-mail: gn...@ob... > ############################################ > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: David H. <dav...@gm...> - 2006-10-24 20:40:32
Attachments:
weighted_histograms.patch
|
Xavier, Here is the patch against svn. Please report any bug. I haven't had the time to test it extensively, something that should be done before commiting the patch to the repo. I'd appreciate your feedback. David 2006/10/24, David Huard <dav...@gm...>: > > Hi Xavier, > > You could tweak histogram2d to do what you want, or you could give me a > couple of days and I'll do it and let you know. If you want to help, you > could write a test using your particular application and data. > > David > > > > > > > > > > > > 2006/10/24, Xavier Gnata <gn...@ob...>: > > > > Hi, > > > > I have a set of 3 1D large arrays. > > The first 2 one stand for the coordinates of particules and the last one > > for their masses. > > I would like to be able to plot this data ie to compute a 2D histogram > > summing the masses in each bin. > > I cannot find a way to do that without any loop on the indices resulting > > too a very slow function. > > > > I'm looking for an elegant way to do that with numpy (or scipy??) > > function. > > > > For instance, scipy.histogram2d cannot do the job because it only counts > > the number of samples in each bin. > > There is no way to deal with weights. > > > > Xavier. > > > > > > -- > > ############################################ > > Xavier Gnata > > CRAL - Observatoire de Lyon > > 9, avenue Charles André > > 69561 Saint Genis Laval cedex > > Phone: +33 4 78 86 85 28 > > Fax: +33 4 78 86 83 86 > > E-mail: gn...@ob... > > ############################################ > > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, > > security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > > _______________________________________________ > > Numpy-discussion mailing list > > Num...@li... > > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > > |
From: Nicolas C. <nic...@ob...> - 2006-10-25 11:56:04
|
Hi, there is a problem when using this patch of numpy.histogram2d. I've tried: a=3Dpylab.rand(10) numpy.histogram2d(a,a) and there is an exception (exceptions.AttributeError) in=20 numpy.histogramdd function called by numpy.histogram2d. But numpy.histogram2d(a,a,bins=3D[10,10]) works. So I've tried to use directly numpy.histogramdd function: numpy.histogramdd([a,a]) and it works. I've looked at the histogram2d code: try: N =3D len(bins) except TypeError: N =3D 1 bins =3D [bins] I think the last line (bins =3D [bins]) have to be deleted because if yo= u=20 do so, numpy.histogram2d(a,a) works. Or maybe the good think to do is: try: N =3D len(bins) except TypeError: N =3D 1 bins =3D 2*[bins] Nicolas David Huard a =E9crit : > Xavier, > Here is the patch against svn. Please report any bug. I haven't had=20 > the time to test it extensively, something that should be done before=20 > commiting the patch to the repo. I'd appreciate your feedback. > > David > > 2006/10/24, David Huard <dav...@gm...=20 > <mailto:dav...@gm...>>: > > Hi Xavier, > > You could tweak histogram2d to do what you want, or you could give > me a couple of days and I'll do it and let you know. If you want > to help, you could write a test using your particular application > and data. > > David > > > > > =20 > > > > > > > 2006/10/24, Xavier Gnata < gn...@ob... > <mailto:gn...@ob...>>: > > Hi, > > I have a set of 3 1D large arrays. > The first 2 one stand for the coordinates of particules and > the last one > for their masses. > I would like to be able to plot this data ie to compute a 2D > histogram > summing the masses in each bin. > I cannot find a way to do that without any loop on the indices > resulting > too a very slow function. > > I'm looking for an elegant way to do that with numpy (or > scipy??) function. > > For instance, scipy.histogram2d cannot do the job because it > only counts > the number of samples in each bin. > There is no way to deal with weights. > > Xavier. > > > -- > ############################################ > Xavier Gnata > CRAL - Observatoire de Lyon > 9, avenue Charles Andr=E9 > 69561 Saint Genis Laval cedex > Phone: +33 4 78 86 85 28 > Fax: +33 4 78 86 83 86 > E-mail: gn...@ob... <mailto:gn...@ob...= > > ############################################ > > > ---------------------------------------------------------------= ---------- > Using Tomcat but need to do more? Need to support web > services, security? > Get stuff done quickly with pre-integrated technology to make > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D26= 3057&dat=3D121642 > <http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D2= 63057&dat=3D121642> > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > <mailto:Num...@li...> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > > -----------------------------------------------------------------------= - > > =20 |
From: Nicolas C. <nic...@ob...> - 2006-10-25 12:25:42
|
Hi, it would be great if you could add the weight option in the 1D=20 histogram too. Nicolas David Huard a =E9crit : > Xavier, > Here is the patch against svn. Please report any bug. I haven't had=20 > the time to test it extensively, something that should be done before=20 > commiting the patch to the repo. I'd appreciate your feedback. > > David > > 2006/10/24, David Huard <dav...@gm...=20 > <mailto:dav...@gm...>>: > > Hi Xavier, > > You could tweak histogram2d to do what you want, or you could give > me a couple of days and I'll do it and let you know. If you want > to help, you could write a test using your particular application > and data. > > David > > > 2006/10/24, Xavier Gnata < gn...@ob... > <mailto:gn...@ob...>>: > > Hi, > > I have a set of 3 1D large arrays. > The first 2 one stand for the coordinates of particules and > the last one > for their masses. > I would like to be able to plot this data ie to compute a 2D > histogram > summing the masses in each bin. > I cannot find a way to do that without any loop on the indices > resulting > too a very slow function. > > I'm looking for an elegant way to do that with numpy (or > scipy??) function. > > For instance, scipy.histogram2d cannot do the job because it > only counts > the number of samples in each bin. > There is no way to deal with weights. > > Xavier. > > > -- > ############################################ > Xavier Gnata > CRAL - Observatoire de Lyon > 9, avenue Charles Andr=E9 > 69561 Saint Genis Laval cedex > Phone: +33 4 78 86 85 28 > Fax: +33 4 78 86 83 86 > E-mail: gn...@ob... <mailto:gn...@ob...= > > ############################################ > > > ---------------------------------------------------------------= ---------- > Using Tomcat but need to do more? Need to support web > services, security? > Get stuff done quickly with pre-integrated technology to make > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on > Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D26= 3057&dat=3D121642 > <http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D2= 63057&dat=3D121642> > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > <mailto:Num...@li...> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > > |
From: David H. <dav...@gm...> - 2006-10-25 13:13:47
|
Nicolas, thanks for the bug report, I fooled around with argument passing and should have checked every case. You'll find the histogram function that deals with weights on the numpy tra= c ticket 189, <http://projects.scipy.org/scipy/numpy/ticket/189> I'm waiting for some hints as to where the histogram function should reside (numpy.histogram, numpy.stats.histogram, ...) before submitting a patch . Salut, David 2006/10/25, Nicolas Champavert <nic...@ob...>: > > Hi, > > it would be great if you could add the weight option in the 1D > histogram too. > > Nicolas > > David Huard a =E9crit : > > Xavier, > > Here is the patch against svn. Please report any bug. I haven't had > > the time to test it extensively, something that should be done before > > commiting the patch to the repo. I'd appreciate your feedback. > > > > David > > > > 2006/10/24, David Huard <dav...@gm... > > <mailto:dav...@gm...>>: > > > > Hi Xavier, > > > > You could tweak histogram2d to do what you want, or you could give > > me a couple of days and I'll do it and let you know. If you want > > to help, you could write a test using your particular application > > and data. > > > > David > > > > > > 2006/10/24, Xavier Gnata < gn...@ob... > > <mailto:gn...@ob...>>: > > > > Hi, > > > > I have a set of 3 1D large arrays. > > The first 2 one stand for the coordinates of particules and > > the last one > > for their masses. > > I would like to be able to plot this data ie to compute a 2D > > histogram > > summing the masses in each bin. > > I cannot find a way to do that without any loop on the indices > > resulting > > too a very slow function. > > > > I'm looking for an elegant way to do that with numpy (or > > scipy??) function. > > > > For instance, scipy.histogram2d cannot do the job because it > > only counts > > the number of samples in each bin. > > There is no way to deal with weights. > > > > Xavier. > > > > > > -- > > ############################################ > > Xavier Gnata > > CRAL - Observatoire de Lyon > > 9, avenue Charles Andr=E9 > > 69561 Saint Genis Laval cedex > > Phone: +33 4 78 86 85 28 > > Fax: +33 4 78 86 83 86 > > E-mail: gn...@ob... <mailto:gn...@ob...= > > > ############################################ > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web > > services, security? > > Get stuff done quickly with pre-integrated technology to make > > your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on > > Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > < > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642> > > _______________________________________________ > > Numpy-discussion mailing list > > Num...@li... > > <mailto:Num...@li...> > > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > > > > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Xavier G. <gn...@ob...> - 2006-10-31 11:05:00
|
Hi, Your histograms functions look fine for me :) As it is a quite usual operation on an array, I would suggest to put it in numpy as numpy.histogram. IMHO, there is no point to create an numpy.stats only for histograms (or do you have plans to move other stats related function to numpy.stats?) Xavier. > Nicolas, thanks for the bug report, I fooled around with argument > passing and should have checked every case. > > You'll find the histogram function that deals with weights on the > numpy trac ticket 189, <http://projects.scipy.org/scipy/numpy/ticket/189> > I'm waiting for some hints as to where the histogram function should > reside (numpy.histogram, numpy.stats.histogram, ...) before submitting > a patch . > > Salut, > David > > > 2006/10/25, Nicolas Champavert <nic...@ob... > <mailto:nic...@ob...>>: > > Hi, > > it would be great if you could add the weight option in the 1D > histogram too. > > Nicolas > > David Huard a écrit : > > Xavier, > > Here is the patch against svn. Please report any bug. I haven't had > > the time to test it extensively, something that should be done > before > > commiting the patch to the repo. I'd appreciate your feedback. > > > > David > > > > 2006/10/24, David Huard < dav...@gm... > <mailto:dav...@gm...> > > <mailto:dav...@gm... <mailto:dav...@gm...>>>: > > > > Hi Xavier, > > > > You could tweak histogram2d to do what you want, or you > could give > > me a couple of days and I'll do it and let you know. If you want > > to help, you could write a test using your particular > application > > and data. > > > > David > > > > > > 2006/10/24, Xavier Gnata < gn...@ob... > <mailto:gn...@ob...> > > <mailto:gn...@ob... > <mailto:gn...@ob...>>>: > > > > Hi, > > > > I have a set of 3 1D large arrays. > > The first 2 one stand for the coordinates of particules and > > the last one > > for their masses. > > I would like to be able to plot this data ie to compute > a 2D > > histogram > > summing the masses in each bin. > > I cannot find a way to do that without any loop on the > indices > > resulting > > too a very slow function. > > > > I'm looking for an elegant way to do that with numpy (or > > scipy??) function. > > > > For instance, scipy.histogram2d cannot do the job because it > > only counts > > the number of samples in each bin. > > There is no way to deal with weights. > > > > Xavier. > > > > > > -- > > ############################################ > > Xavier Gnata > > CRAL - Observatoire de Lyon > > 9, avenue Charles André > > 69561 Saint Genis Laval cedex > > Phone: +33 4 78 86 85 28 > > Fax: +33 4 78 86 83 86 > > E-mail: gn...@ob... > <mailto:gn...@ob...> <mailto:gn...@ob... > <mailto:gn...@ob...>> > > ############################################ > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web > > services, security? > > Get stuff done quickly with pre-integrated technology to > make > > your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on > > Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> > > > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>> > > _______________________________________________ > > Numpy-discussion mailing list > > Num...@li... > <mailto:Num...@li...> > > <mailto:Num...@li... > <mailto:Num...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > > > > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > <mailto:Num...@li...> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ------------------------------------------------------------------------ > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > -- ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gn...@ob... ############################################ |
From: Xavier G. <gn...@ob...> - 2006-11-14 11:31:59
|
Hi, IFAICS these new histograms versions have not yet been merged to svn. Are they problems to be solve before to be able to merge them? How could we help? Xavier > Hi, > > Your histograms functions look fine for me :) > As it is a quite usual operation on an array, I would suggest to put > it in numpy as numpy.histogram. IMHO, there is no point to create an > numpy.stats only for histograms (or do you have plans to move other > stats related function to numpy.stats?) > > Xavier. > > >> Nicolas, thanks for the bug report, I fooled around with argument >> passing and should have checked every case. >> >> You'll find the histogram function that deals with weights on the >> numpy trac ticket 189, <http://projects.scipy.org/scipy/numpy/ticket/189> >> I'm waiting for some hints as to where the histogram function should >> reside (numpy.histogram, numpy.stats.histogram, ...) before submitting >> a patch . >> >> Salut, >> David >> >> >> 2006/10/25, Nicolas Champavert <nic...@ob... >> <mailto:nic...@ob...>>: >> >> Hi, >> >> it would be great if you could add the weight option in the 1D >> histogram too. >> >> Nicolas >> >> David Huard a écrit : >> > Xavier, >> > Here is the patch against svn. Please report any bug. I haven't had >> > the time to test it extensively, something that should be done >> before >> > commiting the patch to the repo. I'd appreciate your feedback. >> > >> > David >> > >> > 2006/10/24, David Huard < dav...@gm... >> <mailto:dav...@gm...> >> > <mailto:dav...@gm... <mailto:dav...@gm...>>>: >> > >> > Hi Xavier, >> > >> > You could tweak histogram2d to do what you want, or you >> could give >> > me a couple of days and I'll do it and let you know. If you want >> > to help, you could write a test using your particular >> application >> > and data. >> > >> > David >> > >> > >> > 2006/10/24, Xavier Gnata < gn...@ob... >> <mailto:gn...@ob...> >> > <mailto:gn...@ob... >> <mailto:gn...@ob...>>>: >> > >> > Hi, >> > >> > I have a set of 3 1D large arrays. >> > The first 2 one stand for the coordinates of particules and >> > the last one >> > for their masses. >> > I would like to be able to plot this data ie to compute >> a 2D >> > histogram >> > summing the masses in each bin. >> > I cannot find a way to do that without any loop on the >> indices >> > resulting >> > too a very slow function. >> > >> > I'm looking for an elegant way to do that with numpy (or >> > scipy??) function. >> > >> > For instance, scipy.histogram2d cannot do the job because it >> > only counts >> > the number of samples in each bin. >> > There is no way to deal with weights. >> > >> > Xavier. >> > >> > >> > -- >> > ############################################ >> > Xavier Gnata >> > CRAL - Observatoire de Lyon >> > 9, avenue Charles André >> > 69561 Saint Genis Laval cedex >> > Phone: +33 4 78 86 85 28 >> > Fax: +33 4 78 86 83 86 >> > E-mail: gn...@ob... >> <mailto:gn...@ob...> <mailto:gn...@ob... >> <mailto:gn...@ob...>> >> > ############################################ >> > >> > >> > >> ------------------------------------------------------------------------- >> > Using Tomcat but need to do more? Need to support web >> > services, security? >> > Get stuff done quickly with pre-integrated technology to >> make >> > your job easier >> > Download IBM WebSphere Application Server v.1.0.1 based on >> > Apache Geronimo >> > >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> >> > >> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>> >> > _______________________________________________ >> > Numpy-discussion mailing list >> > Num...@li... >> <mailto:Num...@li...> >> > <mailto:Num...@li... >> <mailto:Num...@li...>> >> > >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion >> > >> > >> > >> > >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> >> _______________________________________________ >> Numpy-discussion mailing list >> Num...@li... >> <mailto:Num...@li...> >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Numpy-discussion mailing list >> Num...@li... >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion >> >> > > > -- ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gn...@ob... ############################################ |
From: David H. <dav...@gm...> - 2006-11-14 14:53:42
|
2006/11/14, Xavier Gnata <gn...@ob...>: > > Hi, > > IFAICS these new histograms versions have not yet been merged to svn. > Are they problems to be solve before to be able to merge them? > How could we help? No, I'm just overloaded with other stuff, I'll submit a patch on Trac today or tomorrow. Up to now, Travis did the merges, but since he looks pretty busy right now, I don't know when it'll show up on svn. David Xavier > > > Hi, > > > > Your histograms functions look fine for me :) > > As it is a quite usual operation on an array, I would suggest to put > > it in numpy as numpy.histogram. IMHO, there is no point to create an > > numpy.stats only for histograms (or do you have plans to move other > > stats related function to numpy.stats?) > > > > Xavier. > > > > > >> Nicolas, thanks for the bug report, I fooled around with argument > >> passing and should have checked every case. > >> > >> You'll find the histogram function that deals with weights on the > >> numpy trac ticket 189, < > http://projects.scipy.org/scipy/numpy/ticket/189> > >> I'm waiting for some hints as to where the histogram function should > >> reside (numpy.histogram, numpy.stats.histogram, ...) before submitting > >> a patch . > >> > >> Salut, > >> David > >> > >> > >> 2006/10/25, Nicolas Champavert <nic...@ob... > >> <mailto:nic...@ob...>>: > >> > >> Hi, > >> > >> it would be great if you could add the weight option in the 1D > >> histogram too. > >> > >> Nicolas > >> > >> David Huard a =E9crit : > >> > Xavier, > >> > Here is the patch against svn. Please report any bug. I haven't > had > >> > the time to test it extensively, something that should be done > >> before > >> > commiting the patch to the repo. I'd appreciate your feedback. > >> > > >> > David > >> > > >> > 2006/10/24, David Huard < dav...@gm... > >> <mailto:dav...@gm...> > >> > <mailto:dav...@gm... <mailto:dav...@gm...>>>: > >> > > >> > Hi Xavier, > >> > > >> > You could tweak histogram2d to do what you want, or you > >> could give > >> > me a couple of days and I'll do it and let you know. If you > want > >> > to help, you could write a test using your particular > >> application > >> > and data. > >> > > >> > David > >> > > >> > > >> > 2006/10/24, Xavier Gnata < gn...@ob... > >> <mailto:gn...@ob...> > >> > <mailto:gn...@ob... > >> <mailto:gn...@ob...>>>: > >> > > >> > Hi, > >> > > >> > I have a set of 3 1D large arrays. > >> > The first 2 one stand for the coordinates of particules > and > >> > the last one > >> > for their masses. > >> > I would like to be able to plot this data ie to compute > >> a 2D > >> > histogram > >> > summing the masses in each bin. > >> > I cannot find a way to do that without any loop on the > >> indices > >> > resulting > >> > too a very slow function. > >> > > >> > I'm looking for an elegant way to do that with numpy (or > >> > scipy??) function. > >> > > >> > For instance, scipy.histogram2d cannot do the job becaus= e > it > >> > only counts > >> > the number of samples in each bin. > >> > There is no way to deal with weights. > >> > > >> > Xavier. > >> > > >> > > >> > -- > >> > ############################################ > >> > Xavier Gnata > >> > CRAL - Observatoire de Lyon > >> > 9, avenue Charles Andr=E9 > >> > 69561 Saint Genis Laval cedex > >> > Phone: +33 4 78 86 85 28 > >> > Fax: +33 4 78 86 83 86 > >> > E-mail: gn...@ob... > >> <mailto:gn...@ob...> <mailto:gn...@ob... > >> <mailto:gn...@ob...>> > >> > ############################################ > >> > > >> > > >> > > >> > ------------------------------------------------------------------------- > >> > Using Tomcat but need to do more? Need to support web > >> > services, security? > >> > Get stuff done quickly with pre-integrated technology to > >> make > >> > your job easier > >> > Download IBM WebSphere Application Server v.1.0.1 based > on > >> > Apache Geronimo > >> > > >> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > >> < > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642> > >> > > >> < > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > >> < > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642>> > >> > _______________________________________________ > >> > Numpy-discussion mailing list > >> > Num...@li... > >> <mailto:Num...@li...> > >> > <mailto:Num...@li... > >> <mailto:Num...@li...>> > >> > > >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion > >> > > >> > > >> > > >> > > >> > >> > ------------------------------------------------------------------------- > >> Using Tomcat but need to do more? Need to support web services, > >> security? > >> Get stuff done quickly with pre-integrated technology to make your > >> job easier > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache > >> Geronimo > >> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > >> < > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642> > >> _______________________________________________ > >> Numpy-discussion mailing list > >> Num...@li... > >> <mailto:Num...@li...> > >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion > >> > >> > >> > ------------------------------------------------------------------------ > >> > >> > ------------------------------------------------------------------------- > >> Using Tomcat but need to do more? Need to support web services, > security? > >> Get stuff done quickly with pre-integrated technology to make your job > easier > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > >> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > >> > ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> Numpy-discussion mailing list > >> Num...@li... > >> https://lists.sourceforge.net/lists/listinfo/numpy-discussion > >> > >> > > > > > > > > > -- > ############################################ > Xavier Gnata > CRAL - Observatoire de Lyon > 9, avenue Charles Andr=E9 > 69561 Saint Genis Laval cedex > Phone: +33 4 78 86 85 28 > Fax: +33 4 78 86 83 86 > E-mail: gn...@ob... > ############################################ > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: David H. <dav...@gm...> - 2006-11-14 18:50:20
|
I put the patch on Trac. Ticket 189. 2006/11/14, Xavier Gnata <gn...@ob...>: > > Hi, > > > > IFAICS these new histograms versions have not yet been merged to svn. > > Are they problems to be solve before to be able to merge them? > > How could we help? > > Voice you support on Trac to replace histogram with the upgraded version. Thanks. David |