You can subscribe to this list here.
2000 |
Jan
(8) |
Feb
(49) |
Mar
(48) |
Apr
(28) |
May
(37) |
Jun
(28) |
Jul
(16) |
Aug
(16) |
Sep
(44) |
Oct
(61) |
Nov
(31) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(56) |
Feb
(54) |
Mar
(41) |
Apr
(71) |
May
(48) |
Jun
(32) |
Jul
(53) |
Aug
(91) |
Sep
(56) |
Oct
(33) |
Nov
(81) |
Dec
(54) |
2002 |
Jan
(72) |
Feb
(37) |
Mar
(126) |
Apr
(62) |
May
(34) |
Jun
(124) |
Jul
(36) |
Aug
(34) |
Sep
(60) |
Oct
(37) |
Nov
(23) |
Dec
(104) |
2003 |
Jan
(110) |
Feb
(73) |
Mar
(42) |
Apr
(8) |
May
(76) |
Jun
(14) |
Jul
(52) |
Aug
(26) |
Sep
(108) |
Oct
(82) |
Nov
(89) |
Dec
(94) |
2004 |
Jan
(117) |
Feb
(86) |
Mar
(75) |
Apr
(55) |
May
(75) |
Jun
(160) |
Jul
(152) |
Aug
(86) |
Sep
(75) |
Oct
(134) |
Nov
(62) |
Dec
(60) |
2005 |
Jan
(187) |
Feb
(318) |
Mar
(296) |
Apr
(205) |
May
(84) |
Jun
(63) |
Jul
(122) |
Aug
(59) |
Sep
(66) |
Oct
(148) |
Nov
(120) |
Dec
(70) |
2006 |
Jan
(460) |
Feb
(683) |
Mar
(589) |
Apr
(559) |
May
(445) |
Jun
(712) |
Jul
(815) |
Aug
(663) |
Sep
(559) |
Oct
(930) |
Nov
(373) |
Dec
|
From: Charles R H. <cha...@gm...> - 2006-06-08 00:24:46
|
You could use the C approach and use modular arithmetic where the product simply wraps around. The Python approach would be nice if feasible, but what are you going to do for integers larger than the largest numpy data type? So I vote for modular arithetic because numpy is sorta C. On 6/5/06, David M. Cooke <co...@ph...> wrote: > > I just ran into the fact that the power function for integer types > isn't handled in scalarmath yet. I'm going to add it, but I'm wondering > what people want when power overflows the integer type? > > Taking the concrete example of a = uint8(3), b = uint8(10), then should > a ** b return > > 1) the maximum integer for the type (255 here) > 2) 0 > 3) upcast to the largest type that will hold it (but what if it's > larger than our largest type? Return a Python long?) > 4) do the power using "long" like Python does, then downcast it to the > type (that would return 169 for the above example) > 5) something else? > > I'm leaning towards #3; if you do a ** 10, you get the right > answer (59049 as an int64scalar), because 'a' is upcasted to > int64scalar, since '10', a Python int, is converted to that type. > Otherwise, I would choose #1. > > -- > |>|\/|< > /----------------------------------------------------------------------\ > |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ > |co...@ph... > > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Andrew S. <str...@as...> - 2006-06-07 23:04:47
|
Christopher Barker wrote: > Joe Harrington wrote: > >> My >> suggestion is that all the other pages be automatic redirects to the >> scipy.org page or subpages thereof. >> +1 > > if that means something like: > > www.numpy.scipy.org (or www.scipy.org/numpy ) > > Then I'm all for it. > I just made www.scipy.org/numpy redirect to the already-existing www.scipy.org/NumPy So, hopefully you're on-board now. BTW, this is the reason why we have a wiki -- if you don't like something it says, how the site is organized, or whatever, please just jump in and edit it. |
From: Fernando P. <fpe...@gm...> - 2006-06-07 22:22:30
|
On 6/7/06, Sven Schreiber <sve...@gm...> wrote: > The next matplotlib release compatible with numpy 0.9.8 is hopefully > coming soon! (but that's just a wish, not an informed opinion). Actually it was released yesterday, it's 0.87.3: http://sourceforge.net/project/showfiles.php?group_id=80706 I just built it against fresh numpy from SVN In [2]: numpy.__version__ Out[2]: '0.9.9.2587' and it works just fine so far. Cheers, f |
From: Charles R H. <cha...@gm...> - 2006-06-07 22:11:33
|
JJ, I had that problem, started to put the paths in explicitly, noticed that the code should work anyway, deleted my changes, ran again, and it worked fine. I can't tell you what the problem was or what the solution was, I can only say I've seen the same thing on fc5. When you do install, it is also a good idea to delete the numpy directory in site-packages beforehand. Chuck On 6/7/06, JJ <jos...@ya...> wrote: > > Hello. I am having some trouble getting numpy > installed on an AMD 64 bit Fedora 5 machine. I have > loaded atlas, blas, and lapack using yum. I can see > their library files in /usr/lib64/atlas/ (files such > as libblas.so.3.0). But the setup program will not > run. I have obtained the latest version of numpy > using svn co http://svn.scipy.org/svn/numpy/trunk > numpy. I have created a site.cfg file containing: > > [atlas] > library_dirs = /usr/lib64 > atlas_libs = lapack, blas, cblas, atlas > > But when I try to run python setup.py install it > appears that none of the libraries are seeen. I get > the following error messages and output. Can anyone > offer help? Thanks. > > > [root@fedora-newamd numpy]# python setup.py install > Running from numpy source directory. > No module named __svn_version__ > F2PY Version 2_2587 > blas_opt_info: > blas_mkl_info: > looking libraries mkl,vml,guide in /usr/local/lib > but found None > looking libraries mkl,vml,guide in /usr/lib but > found None > NOT AVAILABLE > > atlas_blas_threads_info: > Setting PTATLAS=ATLAS > looking libraries lapack,blas,cblas,atlas in > /usr/lib64/atlas but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib64/atlas but found None > looking libraries lapack,blas,cblas,atlas in > /usr/local/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/local/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib but found None > NOT AVAILABLE > > atlas_blas_info: > looking libraries lapack,blas,cblas,atlas in > /usr/lib64/atlas but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib64/atlas but found None > looking libraries lapack,blas,cblas,atlas in > /usr/local/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/local/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib but found None > looking libraries lapack,blas,cblas,atlas in > /usr/lib but found None > NOT AVAILABLE > > /usr/local/numpy/numpy/distutils/system_info.py:1281: > UserWarning: > Atlas (http://math-atlas.sourceforge.net/) > libraries not found. > Directories to search for the libraries can be > specified in the > numpy/distutils/site.cfg file (section [atlas]) or > by setting > the ATLAS environment variable. > warnings.warn(AtlasNotFoundError.__doc__) > blas_info: > looking libraries blas in /usr/local/lib but found > None > looking libraries blas in /usr/local/lib but found > None > looking libraries blas in /usr/lib but found None > looking libraries blas in /usr/lib but found None > NOT AVAILABLE > > /usr/local/numpy/numpy/distutils/system_info.py:1290: > UserWarning: > Blas (http://www.netlib.org/blas/) libraries not > found. > Directories to search for the libraries can be > specified in the > numpy/distutils/site.cfg file (section [blas]) or > by setting > the BLAS environment variable. > warnings.warn(BlasNotFoundError.__doc__) > blas_src_info: > NOT AVAILABLE > > <snip> > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Christopher B. <Chr...@no...> - 2006-06-07 22:00:40
|
Joe Harrington wrote: > My > suggestion is that all the other pages be automatic redirects to the > scipy.org page or subpages thereof. if that means something like: www.numpy.scipy.org (or www.scipy.org/numpy ) Then I'm all for it. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Sven S. <sve...@gm...> - 2006-06-07 21:56:35
|
Nicholas schrieb: > Hi, > > I installed numpy 0.9.8 and when I try to import pylab I get a crash in > multiarray.pyd. I then tried numpy 0.9.6, this cured the pylab import > but now I cannot import scipy without crashing (again multiarray.pyd). I > have tried complete reinstalls on 2 machines now with same behaviour so > I dont believe it is some system dependent gremlin. Any suggestions? > > XP, Python 2.4.3, Matplotlib 87.2, Scipy 0.4.9 > scipy 0.4.8 should be compatible with numpy 0.9.6, see new.scipy.org. The next matplotlib release compatible with numpy 0.9.8 is hopefully coming soon! (but that's just a wish, not an informed opinion). -sven |
From: Nicholas <nic...@gm...> - 2006-06-07 21:43:50
|
Hi, I installed numpy 0.9.8 and when I try to import pylab I get a crash in multiarray.pyd. I then tried numpy 0.9.6, this cured the pylab import but now I cannot import scipy without crashing (again multiarray.pyd). I have tried complete reinstalls on 2 machines now with same behaviour so I dont believe it is some system dependent gremlin. Any suggestions? XP, Python 2.4.3, Matplotlib 87.2, Scipy 0.4.9 Nicholas |
From: <edi...@gm...> - 2006-06-07 20:52:58
|
Also see this links, if you haven't already done so http://mail.python.org/pipermail/python-list/2006-April/336758.html http://starship.python.net/crew/theller/moin.cgi/Py2Exe On 6/6/06, Neven Gorsic <N.G...@vi...> wrote: > > |
From: Joe H. <jh...@oo...> - 2006-06-07 20:52:41
|
> Date: Fri, 2 Jun 2006 18:04:32 -0400 > From: "Jonathan Taylor" <jon...@ut...> > Subject: Re: [Numpy-discussion] Suggestions for NumPy > To: num...@li... > Message-ID: > <463...@ma...> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > My suggestion would be to have both numpy.org and scipy.org be the > exact same page, but make it extremely clear that there are two > different projects on the front page. > Cheers. > Jon. The goal of the web is to make information easy to find. The easiest and most successful way of doing that is to answer many needs in one place, hence the existence of "portal" pages, which scipy.org bills itself as. The relationship between scipy and numpy is laid out in its front page text. With two (actually many more) packages distributed separately, there will always be confused people, but having one main site that tells the whole story and provides comprehensive information will be the quickest way to deconfuse them. Conversely, a plethora of pages is a poor marketing strategy, as we have been learning with the zoo that's out there already. My suggestion is that all the other pages be automatic redirects to the scipy.org page or subpages thereof. I know that will probably make some people feel their toes have been stepped on. We could consider a website name change to avoid that, but I hope we don't have to. Unite and conquer... --jh-- |
From: JJ <jos...@ya...> - 2006-06-07 18:18:20
|
Hello. I am having some trouble getting numpy installed on an AMD 64 bit Fedora 5 machine. I have loaded atlas, blas, and lapack using yum. I can see their library files in /usr/lib64/atlas/ (files such as libblas.so.3.0). But the setup program will not run. I have obtained the latest version of numpy using svn co http://svn.scipy.org/svn/numpy/trunk numpy. I have created a site.cfg file containing: [atlas] library_dirs = /usr/lib64 atlas_libs = lapack, blas, cblas, atlas But when I try to run python setup.py install it appears that none of the libraries are seeen. I get the following error messages and output. Can anyone offer help? Thanks. [root@fedora-newamd numpy]# python setup.py install Running from numpy source directory. No module named __svn_version__ F2PY Version 2_2587 blas_opt_info: blas_mkl_info: looking libraries mkl,vml,guide in /usr/local/lib but found None looking libraries mkl,vml,guide in /usr/lib but found None NOT AVAILABLE atlas_blas_threads_info: Setting PTATLAS=ATLAS looking libraries lapack,blas,cblas,atlas in /usr/lib64/atlas but found None looking libraries lapack,blas,cblas,atlas in /usr/lib64/atlas but found None looking libraries lapack,blas,cblas,atlas in /usr/local/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/local/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/lib but found None NOT AVAILABLE atlas_blas_info: looking libraries lapack,blas,cblas,atlas in /usr/lib64/atlas but found None looking libraries lapack,blas,cblas,atlas in /usr/lib64/atlas but found None looking libraries lapack,blas,cblas,atlas in /usr/local/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/local/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/lib but found None looking libraries lapack,blas,cblas,atlas in /usr/lib but found None NOT AVAILABLE /usr/local/numpy/numpy/distutils/system_info.py:1281: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.__doc__) blas_info: looking libraries blas in /usr/local/lib but found None looking libraries blas in /usr/local/lib but found None looking libraries blas in /usr/lib but found None looking libraries blas in /usr/lib but found None NOT AVAILABLE /usr/local/numpy/numpy/distutils/system_info.py:1290: UserWarning: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. warnings.warn(BlasNotFoundError.__doc__) blas_src_info: NOT AVAILABLE <snip> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Christopher H. <ch...@st...> - 2006-06-07 16:50:59
|
Robert Kern wrote: > > Depends. Do you want the actual bytes to swap, or are you content with getting a > view that pretends the bytes are swapped? If the latter: I want the actual bytes to swap. Thanks, Chris |
From: Bryce H. <bhe...@en...> - 2006-06-07 13:30:55
|
Enthought is pleased to announce the release of Python Enthought Edition Version 0.9.7 (http://code.enthought.com/enthon/) -- a python distribution for Windows. 0.9.7 Release Notes: -------------------- Version 0.9.7 of Python Enthought Edition includes an update to version 1.0.7 of the Enthought Tool Suite (ETS) Package and bug fixes-- you can look at the release notes for this ETS version here: http://svn.enthought.com/downloads/enthought/changelog-release.1.0.7.html About Python Enthought Edition: ------------------------------- Python 2.3.5, Enthought Edition is a kitchen-sink-included Python distribution for Windows including the following packages out of the box: Numeric SciPy IPython Enthought Tool Suite wxPython PIL mingw f2py MayaVi Scientific Python VTK and many more... More information is available about all Open Source code written and released by Enthought, Inc. at http://code.enthought.com |
From: Dorian M. <sdi...@mj...> - 2006-06-06 22:36:15
|
Most stock brokers give out their new issues only to their largest commission paying clients. We Told you to WATCH A B S Y and now its up again today. We assume many of you like to "trade the promotion" and may have made some big, fast money doing so. Breaking news alert issue - big news coming. Trade Date : Monday, June 7th, 2006 Company : ABSOLUTESKY INC Ticker : A B S Y Yes, it looks like the momentum has started up again. Current Price : $0.95 2 weeks high : $1 Recommendation : S T R O N G B U Y A B S Y is a high growth issue and should be purchased by stock traders and those that can afford to make quick money on these fast moving issues. This stock could reach record highs in the near future. This company is doing incredible things. The stocks we profile show a significant increase in stock price and sometimes in days, not months or years. Remember this is a S T R O N G B U Y RECOMMENDATION... |
From: David M. C. <co...@ph...> - 2006-06-06 22:02:45
|
On Tue, 06 Jun 2006 14:15:14 -0700 Christopher Barker <Chr...@no...> wrote: > David M. Cooke wrote: > > If you want the dtype > > used, it's spelled with an appended _. > > > > So in this case you'd want dtype=N.object_. N.object0 works too. > > That will work, thanks. But what does object0 mean? I think it's "type object, default size". It's a holdover from Numeric. int0, for instance, is the same as int_ (= int64 on my 64-bit box, for instance). -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |
From: Robert K. <rob...@gm...> - 2006-06-06 21:40:18
|
Christopher Barker wrote: > Stefan van der Walt wrote: > >>In [19]: z = N.empty(len(x),dtype='O') > > Which brings up: > > What is the "preferred" way to refer to types? String typecode or object? Object! The string typecodes are for backwards compatibility only. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: Christopher B. <Chr...@no...> - 2006-06-06 21:35:34
|
Stefan van der Walt wrote: > In [19]: z = N.empty(len(x),dtype='O') Which brings up: What is the "preferred" way to refer to types? String typecode or object? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Robert K. <rob...@gm...> - 2006-06-06 21:34:05
|
Christopher Hanley wrote: > Hi, > > Is there a way to byte swap a ndarray in place? The "byteswap" method I > have found on an ndarray object currently returns a new array. Depends. Do you want the actual bytes to swap, or are you content with getting a view that pretends the bytes are swapped? If the latter: >>> a = arange(5) >>> a.dtype dtype('>i4') >>> a.dtype = dtype('<i4') >>> a array([ 0, 16777216, 33554432, 50331648, 67108864]) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: Christopher B. <Chr...@no...> - 2006-06-06 21:15:29
|
David M. Cooke wrote: > If you want the dtype > used, it's spelled with an appended _. > > So in this case you'd want dtype=N.object_. N.object0 works too. That will work, thanks. But what does object0 mean? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: David M. C. <co...@ph...> - 2006-06-06 21:07:16
|
On Tue, 06 Jun 2006 13:21:56 -0700 Christopher Barker <Chr...@no...> wrote: > > > Travis N. Vaught wrote: > > I'd like to construct an array of tuples and I'm not sure how (without > > looping). > > Is this what you want? > > >>> import numpy as N > >>> a = N.empty((2,),dtype=object) > >>> a[:] = [(1,2,3),(4,5,6)] > >>> a > array([(1, 2, 3), (4, 5, 6)], dtype=object) > >>> a.shape > (2,) > > By the way, I notice that the object dtype is not in the numpy > namespace. While this mikes sense, as it's part of python, I keep > getting confused because I do need to use numpy-specific dtypes for > other things. I never use import *, so it might be a good idea to put > the standard objects dtypes in the numpy namespace too. Or maybe not, > just thinking out loud. None of the Python types are (int, float, etc.). For one reason, various Python checkers complain about overwriting a builtin type, and plus, I think it's messy and a potential for bugs. numpy takes those as convenience types, and converts them to the appropriate dtype. If you want the dtype used, it's spelled with an appended _. So in this case you'd want dtype=N.object_. N.object0 works too. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |
From: Christopher H. <ch...@st...> - 2006-06-06 21:03:35
|
Hi, Is there a way to byte swap a ndarray in place? The "byteswap" method I have found on an ndarray object currently returns a new array. Example: In [16]: a = n.array([1,2,3,4,5]) In [17]: a Out[17]: array([1, 2, 3, 4, 5]) In [18]: b = a.byteswap() In [19]: b Out[19]: array([16777216, 33554432, 50331648, 67108864, 83886080]) In [20]: b[0] = 0 In [21]: b Out[21]: array([ 0, 33554432, 50331648, 67108864, 83886080]) In [22]: a.dtype Out[22]: dtype('<i4') In [23]: b.dtype Out[23]: dtype('<i4') Thank you for your time and help, Chris |
From: Stefan v. d. W. <st...@su...> - 2006-06-06 21:02:30
|
On Tue, Jun 06, 2006 at 01:05:43PM -0500, Travis N. Vaught wrote: > looping). Is there a quick way to do this with dtype? >=20 > I've tried: >=20 > >>> import numpy > >>> x =3D [(1,2,3),(4,5,6)] > >>> numpy.array(x) > array([[1, 2, 3], > [4, 5, 6]]) > >>> numpy.array(x, dtype=3D'p') > array([[1, 2, 3], > [4, 5, 6]]) > >>> numpy.array(x, dtype=3D'O') > array([[1, 2, 3], > [4, 5, 6]], dtype=3Dobject) It works if you pre-allocate the array: In [18]: x =3D [(1,2),(3,4)] In [19]: z =3D N.empty(len(x),dtype=3D'O') In [20]: z[:] =3D x In [21]: z Out[21]: array([(1, 2), (3, 4)], dtype=3Dobject) Regards St=E9fan |
From: Christopher B. <Chr...@no...> - 2006-06-06 20:22:17
|
Travis N. Vaught wrote: > I'd like to construct an array of tuples and I'm not sure how (without > looping). Is this what you want? >>> import numpy as N >>> a = N.empty((2,),dtype=object) >>> a[:] = [(1,2,3),(4,5,6)] >>> a array([(1, 2, 3), (4, 5, 6)], dtype=object) >>> a.shape (2,) By the way, I notice that the object dtype is not in the numpy namespace. While this mikes sense, as it's part of python, I keep getting confused because I do need to use numpy-specific dtypes for other things. I never use import *, so it might be a good idea to put the standard objects dtypes in the numpy namespace too. Or maybe not, just thinking out loud. Note: PyObject is there, but isn't that a deprecated Numeric name? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: David M. C. <co...@ph...> - 2006-06-06 20:02:52
|
On Tue, 6 Jun 2006 10:44:20 +0200 David Douard <dav...@lo...> wrote: > On Mon, Jun 05, 2006 at 05:10:23PM -0400, David M. Cooke wrote: > > I just ran into the fact that the power function for integer types > > isn't handled in scalarmath yet. I'm going to add it, but I'm > > wondering what people want when power overflows the integer type? > > > > Taking the concrete example of a = uint8(3), b = uint8(10), then > > should a ** b return > > > > 1) the maximum integer for the type (255 here) > > 2) 0 > > 3) upcast to the largest type that will hold it (but what if it's > > larger than our largest type? Return a Python long?) > > 4) do the power using "long" like Python does, then downcast it to > > the type (that would return 169 for the above example) > > 5) something else? > > > > I'm leaning towards #3; if you do a ** 10, you get the right > > answer (59049 as an int64scalar), because 'a' is upcasted to > > int64scalar, since '10', a Python int, is converted to that type. > > Otherwise, I would choose #1. > > I agree, #1 seems the better solution for me. > > BTW, I'm quite new on this list, and I don't know is this has already > been discussed (I guess I has): why does uint_n arithmetics are done > in the Z/(2**n)Z field (not sure about the maths correctness here)? > I mean: > >>> a = numpy.uint8(10) > >>> a*a > 100 > >>> a*a*a # I'd like to have 255 here > 232 > >>> 1000%256 > 232 > History, and efficiency. Detecting integer overflow in C portably requires doing a division afterwards, or splitting the multiplication up into parts that won't overflow, so you can see if the sum would. Both of those options are pretty slow compared with multiplication. Now, mind you, our scalar types *do* check for overflow: they use a larger integer type for the result (or by splitting it up for the largest type). So you can check for overflow by setting the overflow handler: >>> seterr(over='raise') {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} >>> int16(32000) * int16(3) Traceback (most recent call last): File "<stdin>", line 1, in ? FloatingPointError: overflow encountered in short_scalars Note that the integer array types don't check, though (huh, maybe they should). It's easy enough to use the multiply routine for the power, so you'll get overflow checking for free. > It would be really a nice feature to be able (by the mean of a numpy > flag or so) to have bound limited uint operations (especially when > doing image processing...). If you want to supply a patch ... :-) -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |
From: Travis N. V. <tr...@en...> - 2006-06-06 18:55:56
|
I'd like to construct an array of tuples and I'm not sure how (without looping). Is there a quick way to do this with dtype? I've tried: >>> import numpy >>> x = [(1,2,3),(4,5,6)] >>> numpy.array(x) array([[1, 2, 3], [4, 5, 6]]) >>> numpy.array(x, dtype='p') array([[1, 2, 3], [4, 5, 6]]) >>> numpy.array(x, dtype='O') array([[1, 2, 3], [4, 5, 6]], dtype=object) Thanks, Travis |
From: Bryce H. <bhe...@en...> - 2006-06-06 18:42:46
|
Enthought is pleased to announce the release of Python Enthought Edition Version 0.9.7 (http://code.enthought.com/enthon/) -- a python distribution for Windows. 0.9.7 Release Notes: -------------------- Version 0.9.7 of Python Enthought Edition includes an update to version 1.0.7 of the Enthought Tool Suite (ETS) Package and bug fixes-- you can look at the release notes for this ETS version here: http://svn.enthought.com/downloads/enthought/changelog-release.1.0.7.html About Python Enthought Edition: ------------------------------- Python 2.3.5, Enthought Edition is a kitchen-sink-included Python distribution for Windows including the following packages out of the box: Numeric SciPy IPython Enthought Tool Suite wxPython PIL mingw f2py MayaVi Scientific Python VTK and many more... More information is available about all Open Source code written and released by Enthought, Inc. at http://code.enthought.com |