[Numpy-discussion] numpy 1.3.0 eggs with python2.6 seem broken on osx, and linux
Hi, the other day I tried installing numpy with easy_install, and did not have much luck with python2.6. To reproduce, try installing with easy_install-2.6, or with buildout. The work around is to just install it in another way (eg, dmg or with setup.py install). cheers, ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] numpy 1.3.0 eggs with python2.6 seem broken on osx, and linux
On Sat, Nov 28, 2009 at 6:34 PM, René Dudfield ren...@gmail.com wrote: Hi, the other day I tried installing numpy with easy_install, and did not have much luck with python2.6. What problem exactly do you have ? Since 1.3.0, the release process for numpy uses virtualenv internally to build the installers, so at least python setupegg.py install works as far as setuptools is concerned. The work around is to just install it in another way (eg, dmg or with setup.py install). That's the recommended way anyway. I am trying to make sure we work under as many cases as possible for packaging, but the underlying python architecture for packaging is so fragile and flawed that things will break from time to time. David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Producing a Histogram When Bins Are Known
On Sat, Nov 28, 2009 at 1:01 AM, josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:44 PM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Joseph, That got it by the fig problem but there is yet another one. value is not defined on the very long line: range = ... Wayne (values is the data array, ... no idea about scientificstat.standardDeviation) Sebastian's example is only part of a larger script that defines many of the variables and functions that are used. If you are not yet familiar with these examples, maybe you look at the self contained examples in the matplotlib docs. At least that's what I do when I only have a rough idea about what graph I want to do but don't know how to do it with matplotlib. I usually just copy a likely looking candidate and change it until it (almost) produces what I want. For example look at histogram examples in http://matplotlib.sourceforge.net/examples/index.html Josef josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:05 PM, Sebastian seb...@gmail.com wrote: ... you need to create a figure, before you can use it fig = pylab.figure() Josef ax = fig.add_subplot(1,1,1) pylab.title(r'\Large BCG NO radio distribution $ \rm{TITLE}$') n, bins, patches = pylab.hist(values, bins=math.sqrt(len(values)), range=(numpy.mean(values)-3*scientificstat.standardDeviation(values),numpy.mean(values)+3*scientificstat.standardDeviation(values)), normed=1, facecolor='y', alpha=0.5) ax.set_xlabel(r'\Large$ \rm{values}$') ax.set_ylabel(r'\Large Delatavalue/Value') gausx=numpy.arange(numpy.mean(Value)-3*scientificstat.standardDeviation(Value),numpy.mean(Value)+3*scientificstat.standardDeviation(bpty_plt),0.1) gaus=normpdf(gausx,numpy.mean(Value),scientificstat.standardDeviation(Value)) pylab.plot(gausx,gaus, color='red', lw=2) ax.set_xlim(-1.5, 1.5) ax.grid(True) Sebastian wrote: Did you try using the parameter range? I do something like this. regards ax = fig.add_subplot(1,1,1) pylab.title(r'\Large BCG NO radio distribution $ \rm{TITLE}$') n, bins, patches = pylab.hist(values, bins=math.sqrt(len(values)), range=(numpy.mean(values)-3*scientificstat.standardDeviation(values),numpy.mean(values)+3*scientificstat.standardDeviation(values)), normed=1, facecolor='y', alpha=0.5) ax.set_xlabel(r'\Large$ \rm{values}$') ax.set_ylabel(r'\Large Delatavalue/Value') gausx=numpy.arange(numpy.mean(Value)-3*scientificstat.standardDeviation(Value),numpy.mean(Value)+3*scientificstat.standardDeviation(bpty_plt),0.1) gaus=normpdf(gausx,numpy.mean(Value),scientificstat.standardDeviation(Value)) pylab.plot(gausx,gaus, color='red', lw=2) ax.set_xlim(-1.5, 1.5) ax.grid(True) On Fri, Nov 27, 2009 at 4:38 PM, Christopher Barker chris.bar...@noaa.gov mailto:chris.bar...@noaa.gov wrote: josef.p...@gmail.com mailto:josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 12:57 PM, Skipper Seabold jsseab...@gmail.com mailto:jsseab...@gmail.com wrote: This kind of info might be useful to other newcomers somewhere... http://www.scipy.org/History_of_SciPy? Thoughts on posting this on the wiki here? I also agree. It will improve with the newly redesigned website for scipy.org http://scipy.org However, I cannot find the link right now for the development version of the new website. Feel free to crib whatever you want from my post for that -- or suggest a place for me to put it, and I'll do it. I'm just not sure where it should go at this point. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov mailto:chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org mailto:NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: www.speckledwithstars.net/
Re: [Numpy-discussion] Producing a Histogram When Bins Are Known
On Sat, Nov 28, 2009 at 6:18 AM, Sebastian seb...@gmail.com wrote: On Sat, Nov 28, 2009 at 1:01 AM, josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:44 PM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: Joseph, That got it by the fig problem but there is yet another one. value is not defined on the very long line: range = ... Wayne (values is the data array, ... no idea about scientificstat.standardDeviation) Sebastian's example is only part of a larger script that defines many of the variables and functions that are used. If you are not yet familiar with these examples, maybe you look at the self contained examples in the matplotlib docs. At least that's what I do when I only have a rough idea about what graph I want to do but don't know how to do it with matplotlib. I usually just copy a likely looking candidate and change it until it (almost) produces what I want. For example look at histogram examples in http://matplotlib.sourceforge.net/examples/index.html Josef josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:05 PM, Sebastian seb...@gmail.com wrote: ... you need to create a figure, before you can use it fig = pylab.figure() Josef ax = fig.add_subplot(1,1,1) pylab.title(r'\Large BCG NO radio distribution $ \rm{TITLE}$') n, bins, patches = pylab.hist(values, bins=math.sqrt(len(values)), range=(numpy.mean(values)-3*scientificstat.standardDeviation(values),numpy.mean(values)+3*scientificstat.standardDeviation(values)), normed=1, facecolor='y', alpha=0.5) ax.set_xlabel(r'\Large$ \rm{values}$') ax.set_ylabel(r'\Large Delatavalue/Value') gausx=numpy.arange(numpy.mean(Value)-3*scientificstat.standardDeviation(Value),numpy.mean(Value)+3*scientificstat.standardDeviation(bpty_plt),0.1) gaus=normpdf(gausx,numpy.mean(Value),scientificstat.standardDeviation(Value)) pylab.plot(gausx,gaus, color='red', lw=2) ax.set_xlim(-1.5, 1.5) ax.grid(True) Sebastian wrote: Did you try using the parameter range? I do something like this. regards ax = fig.add_subplot(1,1,1) pylab.title(r'\Large BCG NO radio distribution $ \rm{TITLE}$') n, bins, patches = pylab.hist(values, bins=math.sqrt(len(values)), range=(numpy.mean(values)-3*scientificstat.standardDeviation(values),numpy.mean(values)+3*scientificstat.standardDeviation(values)), normed=1, facecolor='y', alpha=0.5) ax.set_xlabel(r'\Large$ \rm{values}$') ax.set_ylabel(r'\Large Delatavalue/Value') gausx=numpy.arange(numpy.mean(Value)-3*scientificstat.standardDeviation(Value),numpy.mean(Value)+3*scientificstat.standardDeviation(bpty_plt),0.1) gaus=normpdf(gausx,numpy.mean(Value),scientificstat.standardDeviation(Value)) pylab.plot(gausx,gaus, color='red', lw=2) ax.set_xlim(-1.5, 1.5) ax.grid(True) On Fri, Nov 27, 2009 at 4:38 PM, Christopher Barker chris.bar...@noaa.gov mailto:chris.bar...@noaa.gov wrote: josef.p...@gmail.com mailto:josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 12:57 PM, Skipper Seabold jsseab...@gmail.com mailto:jsseab...@gmail.com wrote: This kind of info might be useful to other newcomers somewhere... http://www.scipy.org/History_of_SciPy? Thoughts on posting this on the wiki here? I also agree. It will improve with the newly redesigned website for scipy.org http://scipy.org However, I cannot find the link right now for the development version of the new website. Feel free to crib whatever you want from my post for that -- or suggest a place for me to put it, and I'll do it. I'm just not sure where it should go at this point. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov mailto:chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org mailto:NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive.
Re: [Numpy-discussion] numpy 1.3.0 eggs with python2.6 seem broken on osx, and linux
On Sat, Nov 28, 2009 at 11:16 AM, David Cournapeau courn...@gmail.comwrote: On Sat, Nov 28, 2009 at 6:34 PM, René Dudfield ren...@gmail.com wrote: Hi, the other day I tried installing numpy with easy_install, and did not have much luck with python2.6. What problem exactly do you have ? Since 1.3.0, the release process for numpy uses virtualenv internally to build the installers, so at least python setupegg.py install works as far as setuptools is concerned. The work around is to just install it in another way (eg, dmg or with setup.py install). That's the recommended way anyway. I am trying to make sure we work under as many cases as possible for packaging, but the underlying python architecture for packaging is so fragile and flawed that things will break from time to time. David Hello David, yeah, I completely understand the unfortunate packaging situation (eg, some of my packages do not work with this install method). Here is a simple package requiring numpy. It uses buildout ( http://www.buildout.org/). To help easily reproduce the problem, here are the commands to reproduce. curl -O http://rene.f0o.com/~rene/numpy_buildout.tar.gz #wget http://rene.f0o.com/~rene/numpy_buildout.tar.gz tar xf numpy_buildout.tar.gz cd numpy_buildout python2.6 bootstrap.py ./bin/buildout It prints out heaps of stuff... then finally fails with: /var/folders/d1/d1p0zeCxF7Kz3G5FZJsh6E+++TM/-Tmp-/easy_install-2WsZVp/numpy-1.3.0/numpy/distutils/misc_util.py:219: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import Error in atexit._run_exitfuncs: Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/atexit.py, line 24, in _run_exitfuncs func(*targs, **kargs) File /var/folders/d1/d1p0zeCxF7Kz3G5FZJsh6E+++TM/-Tmp-/easy_install-2WsZVp/numpy-1.3.0/numpy/distutils/misc_util.py, line 219, in clean_up_temporary_directory ImportError: No module named numpy.distutils Error in sys.exitfunc: Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/atexit.py, line 24, in _run_exitfuncs func(*targs, **kargs) File /var/folders/d1/d1p0zeCxF7Kz3G5FZJsh6E+++TM/-Tmp-/easy_install-2WsZVp/numpy-1.3.0/numpy/distutils/misc_util.py, line 219, in clean_up_temporary_directory I hope that helps if someone wants to reproduce the problem very easily some time. notes: * you should not have numpy installed already to reproduce the problem, otherwise the buildout uses the installed version and works. * use `python bootstrap.py -d` if you want to use distribute instead of setuptools (which has python3.1 support). * numpy with buildout works ok with python2.5 cheers, ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
The current numpy sources from svn trunk (r7772 or newer) and the 1.4.x branch fail to build with Visual Studio 2008 with the following compiler error: numpy\core\src\multiarray\descriptor.h(16) : error C2133: '_datetime_strings' : unknown size A quick fix is to specify the size of the _datetime_strings array, e.g. _datetime_strings[14]. Christoph ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
On Sat, Nov 28, 2009 at 11:27 AM, Christoph Gohlke cgoh...@uci.edu wrote: The current numpy sources from svn trunk (r7772 or newer) and the 1.4.x branch fail to build with Visual Studio 2008 with the following compiler error: numpy\core\src\multiarray\descriptor.h(16) : error C2133: '_datetime_strings' : unknown size A quick fix is to specify the size of the _datetime_strings array, e.g. _datetime_strings[14]. What happens if you just replace: *_datetime_strings[]; by **_datetime_strings; Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
Changing *_datetime_strings[] to **_datetime_strings in descriptor.h results in the following compiler error: numpy\core\src\multiarray\descriptor.c(472) : error C2372: '_datetime_strings' : redefinition; different types of indirection numpy\core\src\multiarray\descriptor.h(16) : see declaration of '_datetime_strings' Christoph ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
On Sat, Nov 28, 2009 at 12:07 PM, Christoph Gohlke cgoh...@uci.edu wrote: Changing *_datetime_strings[] to **_datetime_strings in descriptor.h results in the following compiler error: numpy\core\src\multiarray\descriptor.c(472) : error C2372: '_datetime_strings' : redefinition; different types of indirection numpy\core\src\multiarray\descriptor.h(16) : see declaration of '_datetime_strings' The problem is that the bit in the header looks like a declaration. Try commenting out the line like so: /*NPY_NO_EXPORT char *_datetime_strings[];*/ Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
On Sat, Nov 28, 2009 at 12:21 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sat, Nov 28, 2009 at 12:07 PM, Christoph Gohlke cgoh...@uci.eduwrote: Changing *_datetime_strings[] to **_datetime_strings in descriptor.h results in the following compiler error: numpy\core\src\multiarray\descriptor.c(472) : error C2372: '_datetime_strings' : redefinition; different types of indirection numpy\core\src\multiarray\descriptor.h(16) : see declaration of '_datetime_strings' The problem is that the bit in the header looks like a declaration. Try commenting out the line like so: /*NPY_NO_EXPORT char *_datetime_strings[];*/ In case that wasn't precise enough, it should look like this: #ifdef NPY_ENABLE_SEPARATE_COMPILATION extern NPY_NO_EXPORT char *_datetime_strings[]; #else /*NPY_NO_EXPORT char *_datetime_strings[];*/ #endif Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
Commenting out the declaration in line 16 of decriptor.h works. Christoph ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Numpy trunk and 1.4.x branch fail to build with VS2008
On Sat, Nov 28, 2009 at 12:32 PM, Christoph Gohlke cgoh...@uci.edu wrote: Commenting out the declaration in line 16 of decriptor.h works. OK, I went ahead and committed this change. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Installing numpy under cygwin
Thank you. This time the building of Numpy worked with no error message. However, when I now try to import Numpy in Python, there is a problem with lapack_lite (see below). Thanks again! Olivia $ python Python 2.5.2 (r252:60911, Dec 2 2008, 09:26:14) [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin Type help, copyright, credits or license for more information. import numpy Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.5/site-packages/numpy/__init__.py, line 132, in modul e import add_newdocs File /usr/lib/python2.5/site-packages/numpy/add_newdocs.py, line 9, in modu le from lib import add_newdoc File /usr/lib/python2.5/site-packages/numpy/lib/__init__.py, line 13, in mo dule from polynomial import * File /usr/lib/python2.5/site-packages/numpy/lib/polynomial.py, line 17, in module from numpy.linalg import eigvals, lstsq File /usr/lib/python2.5/site-packages/numpy/linalg/__init__.py, line 47, in module from linalg import * File /usr/lib/python2.5/site-packages/numpy/linalg/linalg.py, line 22, in m odule from numpy.linalg import lapack_lite ImportError: No such file or directory - Original Message From: David Cournapeau courn...@gmail.com Please update to the trunk - I can see the error as well for 1.3.0, and the trunk does build correctly on cygwin. I don't understand where the error is coming from in 1.3.0, it almost look like a cpp bug. cheers, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Import error in builds of 7726
Chris fonnesbeck at gmail.com writes: Nothing looks out of order, but I still get the Symbol not found: _npy_cexp errors. This problem still persists through rev 7803. Is there no solution for this? I have no clue where its coming from. Thanks in advance. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Import error in builds of 7726
On Sun, Nov 29, 2009 at 10:02 AM, Chris fonnesb...@gmail.com wrote: Chris fonnesbeck at gmail.com writes: Nothing looks out of order, but I still get the Symbol not found: _npy_cexp errors. This problem still persists through rev 7803. Is there no solution for this? The problem is that I don't see this issue at all, so I have no idea what may cause it. I again checked with your build script on my macbook, and everything works as expected. David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] A Simple Example of histogram Using Range?
See Subject. I don't seem able to produce a simple example of using (Matplotlib) histogram that uses range. I tried a variety of ranges, range=(5,22), range=(0, 50.2), ... and I see no difference between any of the x values scale on the plot. Can someone provide an example that shows how it works? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: www.speckledwithstars.net/ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Import error in builds of 7726
On Sat, Nov 28, 2009 at 6:44 PM, David Cournapeau courn...@gmail.comwrote: On Sun, Nov 29, 2009 at 10:02 AM, Chris fonnesb...@gmail.com wrote: Chris fonnesbeck at gmail.com writes: Nothing looks out of order, but I still get the Symbol not found: _npy_cexp errors. This problem still persists through rev 7803. Is there no solution for this? The problem is that I don't see this issue at all, so I have no idea what may cause it. I again checked with your build script on my macbook, and everything works as expected. Maybe there is a stray old file floating about somewhere. Chris, is there a locate command for the mac? Could you track down numpy related files and make sure none are sitting in some dusty old corner? Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known
On Fri, Nov 27, 2009 at 9:25 PM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: I actually wrote my own several days ago. When I began getting myself more familiar with numpy, I was hoping there would be an easy to use version in it for this frequency approach. If not, then I'll just stick with what I have. It seems something like this should be common. A simple way to do it with the present capabilities would be to unwind the frequencies, For example, given [2,1,3] for some corresponding set of x, say, [1,2,3], produce[1, 1, 2, 3, 3, 3]. I have no idea if numpy does anything like that, but, if so, the typical mean, std, ... could be used. In my case, it's sort of pointless. It would produce an array of 307,200 items for 256 x (0,1,2,...,255), and just slow down the computations unwinding it in software. The sub-processor hardware already produced the 256 frequencies. Basically, this amounts to having a pdf, and values of x. Mathematically, the statistics are produced directly from it. josef.p...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:47 PM, Wayne Watson sierra_mtnv...@sbcglobal.net wrote: How do I compute avg, std dev, min, max and other simple stats if I only know the frequency distribution? If you are willing to assign to all observations in a bin the value at the bin midpoint, then you could do it with weights in the statistics calculations. However, numpy.average is, I think, the only statistic that takes weights. min max are independent of weight, but std and var need to be calculated indirectly. If you need more stats with weights, then the attachment in http://projects.scipy.org/scipy/ticket/604 is a good start. Josef Wayne: There is no need to unwind: If Y(X) is the (unnormalized) freq. distr. of random variable/data X, start by computing y = Y/(Y.sum()) (if Y is already normalized, skip this step). Then: av(X) = np.dot(X, y), sd(X) = np.sqrt(np.dot((X*X), y) - (av(X))^2), and higher moment statistics can be calculated utilizing similar formulae. DG ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known
David Goldsmith wrote: On Fri, Nov 27, 2009 at 9:25 PM, Wayne Watson sierra_mtnv...@sbcglobal.net mailto:sierra_mtnv...@sbcglobal.net wrote: I actually wrote my own several days ago. When I began getting myself more familiar with numpy, I was hoping there would be an easy to use version in it for this frequency approach. If not, then I'll just stick with what I have. It seems something like this should be common. ... If you need more stats with weights, then the attachment in http://projects.scipy.org/scipy/ticket/604 is a good start. Josef Wayne: There is no need to unwind: If Y(X) is the (unnormalized) freq. distr. of random variable/data X, start by computing y = Y/(Y.sum()) (if Y is already normalized, skip this step). Then: av(X) = np.dot(X, y), sd(X) = np.sqrt(np.dot((X*X), y) - (av(X))^2), and higher moment statistics can be calculated utilizing similar formulae. DG I was only illustrating a way that I would not consider, since the hardware has already created the pdf. I've already coded it pretty much as you have suggested. As I think I mention ed above, I'm a bit surprised numpy doesn't provide the code you suggest as part of some function. CalcSimplefromPDF(xvalues=mydatarray, avg=ture, minmax=true, ...). -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: www.speckledwithstars.net/ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known
2009/11/28 Wayne Watson sierra_mtnv...@sbcglobal.net: I was only illustrating a way that I would not consider, since the hardware has already created the pdf. I've already coded it pretty much as you have suggested. As I think I mention ed above, I'm a bit surprised numpy doesn't provide the code you suggest as part of some function. CalcSimplefromPDF(xvalues=mydatarray, avg=ture, minmax=true, ...). Feel free to submit an implementation to numpy's issue tracker. I suggest modifying mean, std, and var (at least) so that, like average, they take an array of weights. Anne ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known
How would I do that? Anne Archibald wrote: 2009/11/28 Wayne Watson sierra_mtnv...@sbcglobal.net: I was only illustrating a way that I would not consider, since the hardware has already created the pdf. I've already coded it pretty much as you have suggested. As I think I mention ed above, I'm a bit surprised numpy doesn't provide the code you suggest as part of some function. CalcSimplefromPDF(xvalues=mydatarray, avg=ture, minmax=true, ...). Feel free to submit an implementation to numpy's issue tracker. I suggest modifying mean, std, and var (at least) so that, like average, they take an array of weights. Anne ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: www.speckledwithstars.net/ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Producing a Histogram When Bins Are Known
Yes, the book description is here http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooksunfiltered=1field-keywords=field-author=field-title=matplotlib+pythonfield-isbn=field-publisher=node=url=field-feature_browse-bin=field-binding_browse-bin=field-subject=field-language=field-dateop=field-datemod=field-dateyear=sort=relevancerankAdv-Srch-Books-Submit.x=0Adv-Srch-Books-Submit.y=0 Christopher Barker wrote: ... FWIW, a book about MPL has just been published -- I don't know any more about it, but I'm sure google will tell you. Is there a matplotlib or Pylab mailing list? There certainly is: https://lists.sourceforge.net/lists/listinfo/matplotlib-users And yes, that is the place for such questions. HTH, -Chris -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: www.speckledwithstars.net/ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion