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: David G. <Dav...@no...> - 2006-10-12 16:25:27
|
Greg Willden wrote: > May I suggest the following change to generate_umath.py? > > <completely untested string change> > 'sqrt' : > Ufunc(1, 1, None, > 'square-root elementwise. For real x, the domain is > restricted to x>=0.\n\ > For complex results for x<0 see numpy.scimath.sqrt', > TD(inexact, f='sqrt'), > TD(M, f='sqrt'), > ), > ' > > When sqrt throws a ValueError would it be possible/appropriate for the > error message to mention numpy.scimath.sqrt? > > I'm just trying to think of other ways to help make the transition as > smooth as possible for new users. And helpful error messages are one of Python's best features - in general, numpy doesn't have enough of 'em, IMO. DG > > Greg > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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: Stefan v. d. W. <st...@su...> - 2006-10-12 16:15:15
|
On Thu, Oct 12, 2006 at 10:53:12AM -0400, Alan G Isaac wrote: > On Thu, 12 Oct 2006, Stefan van der Walt apparently wrote:=20 > > I tried to explain the argument at=20 > > http://www.scipy.org/NegativeSquareRoot=20 >=20 > Helpful. But you start off by saying: > In mathematics, the above assumption is true -- that=20 > the square root of -1 is 1j. >=20 > Since square root is (here) a function, and part of the=20 > function definition is the domain and codomain, this=20 > statement is not correct. If the codomain is real numbers,=20 > the domain must correspondingly be (a subset of) the=20 > nonnegative reals. The nan output is the result of an=20 > **invalid** input. >=20 > So the question is really: "Why is a negative real number an=20 > invalid input in this implementation", or "Why in this=20 > implementation is the type of the output restricted by the=20 > type of the input?" You get a good start on answering that. You are more than welcome to change the wiki if you can think of a simpler way to explain the problem... In fact, I would encourage that -- I just put it there as a starting point. Cheers St=E9fan |
From: A. M. A. <per...@gm...> - 2006-10-12 16:07:14
|
On 12/10/06, David Goldsmith <Dav...@no...> wrote: > I don't use scipy (and don't want to because of the overhead) but it > sounds like I should because if I'm taking the square root of a variable > whose value at run time happens to be real but less than zero, I *want* > the language I'm using to return an imaginary; in other words, it's not > the scipy behavior which "scares" me, its the numpy (which I do/have > been using) behavior. To which you might say, "Well, if that's what you > want, and you have Matlab (as you've said you do), then just use that." > But that's precisely the point: people who don't want to be bothered > with having to be "a bit more care[ful]" (as Chuck put it) - and who can > afford it - are going to be inclined to choose Matlab over numpy. > Perhaps one doesn't care - in the grand scheme of things, it certainly > doesn't matter - but I think that you all should be aware that this > numpy "feature" will be seen by many as more than just a nuisance. Scipy doesn't do what you want. What you want is to use complex numbers throughout; then numpy and scipy will do exactly what you request. A. M. Archibald |
From: Neal B. <ndb...@gm...> - 2006-10-12 16:06:38
|
I have not been able to build any of the numpy-1.0 series. Finally I bit the bullet and fixed it. Here is the patch: diff -u numpy-1.0rc2/numpy/numarray/setup.py{~,} --- numpy-1.0rc2/numpy/numarray/setup.py~ 2006-07-26 16:04:32.000000000 -0400 +++ numpy-1.0rc2/numpy/numarray/setup.py 2006-10-12 11:58:23.000000000 -0400 @@ -5,7 +5,8 @@ from numpy.distutils.misc_util import Configuration config = Configuration('numarray',parent_package,top_path) - config.add_data_files('numpy/') +# config.add_data_files('numpy/') + config.add_data_dir('numpy/') # Configure fftpack_lite config.add_extension('_capi', |
From: Rob H. <he...@ta...> - 2006-10-12 15:52:34
|
On Oct 11, 2006, at 1:41 PM, Travis Oliphant wrote: > a) an extra multiplication operator to distinguish between > element-by-element and dot One of the things I like about numpy is that element-by-element multiplication is default. Really, most of what I do is element by element, punctuated by a few matrix multiplications (or whatever other matrix operations) at the end. If I had a penny for every '.' I put in front of an operator in MATLAB, I would buy us all new computers -- expensive ones even. I hope that, if there is another multiplication operator like .*, that this will be shorthand for dot(A, B), and not for elem-by-elem multiplication. -Rob ---- Rob Hetland, Associate Professor Dept. of Oceanography, Texas A&M University http://pong.tamu.edu/~rob phone: 979-458-0096, fax: 979-845-6331 |
From: Andrew J. <a.h...@gm...> - 2006-10-12 15:35:27
|
Tim Hochberg wrote: > Travis Oliphant wrote: >> Tim Hochberg wrote: >> >> >>> With python 2.5 out now, perhaps it's time to come up with a with >>> statement context manager. Something like: >>> >>> a = numpy.arange(10) >>> a/a # ignores divide by zero >>> with errstate(divide='raise'): >>> a/a # raise exception on divide by zer >>> # Would ignore divide by zero again if we got here. >>> >>> -tim >>> >> This looks great. I think most people aren't aware of the with >> statement and what it can do (I'm only aware because of your posts, for >> example). >> >> So, what needs to be added to your example in order to just add it to >> numpy? >> > As far as I know, just testing and documentation -- however testing was > so minimal that I may find some other stuff. I'll try to clean it up > tomorrow so that I'm a little more confident that it works correctly and > I'll send another note out then. For this particular application, why not a context manager which just substitutes in the appropriately-optimized version of sqrt? That is, don't change the error state, but actually change the value of the object pointed at by the name sqrt? Andrew |
From: Greg W. <gre...@gm...> - 2006-10-12 15:19:13
|
May I suggest the following change to generate_umath.py? <completely untested string change> 'sqrt' : Ufunc(1, 1, None, 'square-root elementwise. For real x, the domain is restricted to x>=0.\n\ For complex results for x<0 see numpy.scimath.sqrt', TD(inexact, f='sqrt'), TD(M, f='sqrt'), ), ' When sqrt throws a ValueError would it be possible/appropriate for the error message to mention numpy.scimath.sqrt? I'm just trying to think of other ways to help make the transition as smooth as possible for new users. Greg |
From: Greg W. <gre...@gm...> - 2006-10-12 14:54:25
|
I'll try to quit being a pain and just work around it. Those wiki pages are really good to capture this information. I need to read all of them to know what other gotchas are out there. Thanks and Sorry, Greg On 10/12/06, Alan G Isaac <ai...@am...> wrote: > > That's fine, but be sure to treat the explanations you are > receiving with the same seriousness that you treat your > doubts. > > For example, in the speed vs. correctness discussion, be > sure to understand the problems with the word "correct". > Which have been explained. > > correct != expected > when expectations lack context > |
From: Alan G I. <ai...@am...> - 2006-10-12 14:51:50
|
On Thu, 12 Oct 2006, Stefan van der Walt apparently wrote:=20 > I tried to explain the argument at=20 > http://www.scipy.org/NegativeSquareRoot=20 Helpful. But you start off by saying: In mathematics, the above assumption is true -- that=20 the square root of -1 is 1j. Since square root is (here) a function, and part of the=20 function definition is the domain and codomain, this=20 statement is not correct. If the codomain is real numbers,=20 the domain must correspondingly be (a subset of) the=20 nonnegative reals. The nan output is the result of an=20 **invalid** input. So the question is really: "Why is a negative real number an=20 invalid input in this implementation", or "Why in this=20 implementation is the type of the output restricted by the=20 type of the input?" You get a good start on answering that. Cheers, Alan Isaac |
From: Tim H. <tim...@ie...> - 2006-10-12 14:43:32
|
Travis Oliphant wrote: > I made some fixes to the "asbuffer" code which let me feel better about > exposing it in NumPy (where it is now named int_asbuffer). > > This code takes a Python integer and a size and returns a buffer object > that points to that memory. A little test is performed by trying to > read (and possibly write if a writeable buffer is requested) to the > first and last elements of the buffer. Any segfault is trapped and used > to raise a Python error indicating you can't use that area of memory. > > It doesn't guarantee you won't shoot yourself, but it does make it more > difficult to segfault Python. Previously a simple int_asbuffer(3423423, > 5) would have segfaulted (unless by chance you the memory area 3423423 > happens to be owned by Python). > > I have not tested the code on other platforms to make sure it works as > expected, so please try and compiled it. > FWIW, it compiles fine and passes all tests under Visual Studio and Python 2.4.3. I haven't tried to use it though. -tim > -Travis > > > ------------------------------------------------------------------------- > 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: Tim H. <tim...@ie...> - 2006-10-12 14:31:26
|
Travis Oliphant wrote: >> Personally I think that the default error mode should be tightened >> up. >> Then people would only see these sort of things if they really care >> about them. Using Python 2.5 and the errstate class I posted earlier: >> >> # This is what I like for the default error state >> numpy.seterr (invalid='raise', divide='raise', over='raise', >> under='ignore') >> >> >> I like these choices too. Overflow, division by zero, and sqrt(-x) are >> usually errors, indicating bad data or programming bugs. Underflowed >> floats, OTOH, are just really, really small numbers and can be treated >> as zero. An exception might be if the result is used in division and >> no error is raised, resulting in a loss of accuracy. >> >> > > I'm fine with this. I've hesitated because error checking is by default > slower. But, I can agree that it is "less surprising" to new-comers. > People that don't mind no-checking can simply set their defaults back to > 'ignore' > > Great. One thing we may want to do (numarray had this), was add a pseudo argument 'all', that allows you to set all of the values at once. Then if you want the full-bore, ignore-all-errors computation (and your using 2.5 and "from __future__ import with_statement") you can just do: with errstate(all='ignore'): # computation here # back to being picky -tim |
From: Stefan v. d. W. <st...@su...> - 2006-10-12 14:28:47
|
On Thu, Oct 12, 2006 at 08:58:21AM -0500, Greg Willden wrote: > On 10/11/06, Bill Baxter <wb...@gm...> wrote: >=20 > On 10/12/06, Greg Willden <gre...@gm...> wrote: > > Speed should not take precedence over correctness. >=20 > Unless your goal is speed. Then speed should take precedence over > correctness. >=20 >=20 > Huh? > Person 1: "Hey you should use function X." > Person 2: "No, it doesn't give me the correct answer." > Person 1: "Who cares? It's fast!" >=20 > What kind of logic is that? I tried to explain the argument at http://www.scipy.org/NegativeSquareRoot Cheers St=E9fan |
From: Tim H. <tim...@ie...> - 2006-10-12 14:27:21
|
Travis Oliphant wrote: > Travis Oliphant wrote: > >> Now, it would be possible to give ufuncs a dtype keyword argument that >> allowed you to specify which underlying loop was to be used for the >> calculation. That way you wouldn't have to convert inputs to complex >> numbers before calling the ufunc, but could let the ufunc do it in >> chunks during the loop. That is certainly a reasonable enhancement: >> >> sqrt(a, dtype=complex). >> >> This no-doubt has a "library-ish"-feeling, but that is what NumPy is. >> If such a change is desireable, I don't think it would be much to >> implement it. >> >> >> > This could be implemented, but only with a version number increase in > the C-API (we would have to change the c-signature of the ufunc tp_call. > > This would mean that the next release of NumPy would be binary > incompatible with packages built to previous NumPy releases. > > I've really been trying to avoid doing that. So, unless there are > strong requests for this feature that outweigh the negatives of > re-building dependent packages, then this feature will have to wait. > > OTOH: I suppose it could be implemented in a different way (using > indexing or a method call): > > sqrt[complex](a) --- I remember Tim suggesting some use for indexing > on ufuncs earlier though. > It wouldn't surprise me if I did -- it sounds like the kind of thing I'd propose -- but I certainly can't remember what I was proposing. -tim |
From: Tim H. <tim...@ie...> - 2006-10-12 14:26:01
|
Mark Bakker wrote: > My vote is for consistency in numpy. > But it is unclear what consistency is. > > What is truly confusing for newbie Python users (and a source for > error even after 5 years of Python programming) is that > > >>> 2/3 > 0 I recommend that you slap "from __future__ import division" into site.py or the top of your program: from __future__ import division import numpy print 3/2 a = numpy.arange(3) print a / (a+5) print a // a+5 >>>> 1.5 [ 0. 0.16666667 0.28571429] [5 6 6] > > In that respect, I would think > > >>> numpy.sqrt(2) > > should give 1, but it gives 1.4142135623730951 Is there any practical reason to return 1? If not, isn't this argument sort of silly? > So numpy does typechecking anyway (it gets an integer and makes it a > float). > > If that is the consistent behavior, then by all means > > >>> sqrt(-1) > > should return 1j. Well, it could also return: -1j or as someone mentioned one of six (I think) different quaternion values. It all depends on what the domain/range of the problem is. > Wouldn't that be the consistent thing to do???? No, there's a difference. In order to do the former, all that is required is that sqrt switches on the *type* of it argument. sqrt return a float for integer and floating point args and a complex for complex args. In order to the latter, sqrt needs to switch on the *value* of its argument, which is an entirely different beast both in theory and in practice. In particular: sqrt(some_big_array) would have to scan all the values in the array to determine if any were negative to decide whether to return a float or an imaginary number. It also means that the memory usage is unpredictable -- the returned array is double in size if any values are negative. In addition to the significant slowdown this introduces, the former approach (keeping the input and output domains the same) is somewhat more robust against error, particularly if one tightens up the error mode. I would guess that people are working the complex plane at most half the time, in the former case a negative square root signals a problem and promoting to complex is at best a nuisance and may result in a painful to track down error. In the latter case, it's easy enough for me to toss in a astype in situations where I'm mixing domains and need complex outputs. Ideally numpy and scipy would have chosen different names for forgiving and strict powers and square roots, square_root and power versus sqrt and pow for example, but it's probably too late to do anything about that now. Since it sounds like Travis is going to tighten up the default error mode, I think that this is a non issue. No ones going to run into NANs unexpectedly and the error when doing sqrt([1,2,3,-1]) should be confusing and most once. -tim |
From: James G. <jg...@ca...> - 2006-10-12 14:14:42
|
Greg Willden wrote: > On 10/11/06, *Bill Baxter* <wb...@gm... > <mailto:wb...@gm...>> wrote: > > On 10/12/06, Greg Willden <gre...@gm... > <mailto:gre...@gm...>> wrote: > > Speed should not take precedence over correctness. > > Unless your goal is speed. Then speed should take precedence over > correctness. > > > Huh? > Person 1: "Hey you should use function X." > Person 2: "No, it doesn't give me the correct answer." > Person 1: "Who cares? It's fast!" > > What kind of logic is that? > > I'm having serious doubts about my conversion to Numpy. It's more like Person 1: Function x is designed to be fast, have predictable memory usage and so be suitable for a wide variety of applications. Alternatively there is function y which is slower but handles a larger numerical domain. y Might be more sutiable for your needs; you should use it. Person 2: Numpy is broken! Function x should just do what I want! Really, given that both options are available, I don't see a big issue here. Claims that returning j for sqrt(-1) is "more correct" seem highly dubious as a) NumPy is a numerical library, not an algebraic one, hence the fact that it behaves in a type-dependent way is not so surprising, and b) no one complains that functions like sqrt return only positive floats, despite the fact that, mathematically, this function is multivalued. -- "Eternity's a terrible thought. I mean, where's it all going to end?" -- Tom Stoppard, Rosencrantz and Guildenstern are Dead |
From: Alan G I. <ai...@am...> - 2006-10-12 14:12:21
|
On Thu, 12 Oct 2006, Greg Willden apparently wrote:=20 > I'm having serious doubts about my conversion to Numpy.=20 That's fine, but be sure to treat the explanations you are=20 receiving with the same seriousness that you treat your=20 doubts. For example, in the speed vs. correctness discussion, be=20 sure to understand the problems with the word "correct". Which have been explained. correct !=3D expected when expectations lack context Cheers, Alan Isaac (just a happy user) |
From: Greg W. <gre...@gm...> - 2006-10-12 13:58:24
|
On 10/11/06, Bill Baxter <wb...@gm...> wrote: > > On 10/12/06, Greg Willden <gre...@gm...> wrote: > > Speed should not take precedence over correctness. > > Unless your goal is speed. Then speed should take precedence over > correctness. Huh? Person 1: "Hey you should use function X." Person 2: "No, it doesn't give me the correct answer." Person 1: "Who cares? It's fast!" What kind of logic is that? I'm having serious doubts about my conversion to Numpy. Greg |
From: Charles H. <c....@se...> - 2006-10-12 11:51:07
|
Hello, =20 I've a program using Numpy and I would like to compile it with Py2exe but I've some problems. When I try to compile my program, some modules generated by numpy are not loaded. I've already asked to the py2exe community if they have a solution for that and the answer was that it was possible to compile numpy modules with py2exe but I should ask to the Numpy community :-) =20 So my question is, is there something special to do in order to compile a program using numpy module? =20 This is the setup.py file that I use =20 =20 from distutils.core import setup import py2exe, sys =20 sys.path.append("tools") sys.path.append("report") sys.path.append("spirent") sys.path.append("numpydir") =20 setup( console =3D ['checkfile.py'], ) =20 =20 If I use this setup.py, lots of numpy file cannot be loaded. I get the following message =20 =20 copying c:\python24\lib\site-packages\py2exe\run.exe -> Y:\svn\copy\dist\checkfile.exe The following modules appear to be missing ['DateTime', 'FFT', 'Ft.Lib', 'Ft.Lib.DumpBgTuple', 'Ft.__init__', 'LinearAlgebra', 'MA', 'MLab', 'Matrix', 'Numeric', 'Pyrex', 'Pyrex.Compiler', 'XPathParserc' , '_curses', 'backends.draw_if_interactive', 'backends.new_figure_manager', 'backends.pylab_setup', 'backends.show', 'core.abs', 'core.max', 'core.min', 'core.r ound', 'ctypes', 'ext.IsDOMString', 'ext.SplitQName', 'fcompiler.FCompiler', 'fcompiler.show_fcompilers', 'lib.add_newdoc', 'mlab.amax', 'mlab.amin', 'numarray' , 'numarray.convolve', 'numarray.fft', 'numarray.ieeespecial', 'numarray.linear_algebra', 'numarray.linear_algebra.mlab', 'numarray.ma', 'numarray.numeric', 'nu merix.ArrayType', 'numerix.Complex', 'numerix.Complex32', 'numerix.Complex64', 'numerix.Float', 'numerix.Float32', 'numerix.Float64', 'numerix.Int', 'numerix.In t16', 'numerix.Int32', 'numerix.Int8', 'numerix.NewAxis', 'numerix.UInt16', 'numerix.UInt32', 'numerix.UInt8', 'numerix.absolute', 'numerix.add', 'numerix.all', 'numerix.allclose', 'numerix.alltrue', 'numerix.any', 'numerix.arange', 'numerix.arccos', 'numerix.arccosh', 'numerix.arcsin', 'numerix.arcsinh', 'numerix.arct an', 'numerix.arctan2', 'numerix.arctanh', 'numerix.argmax', 'numerix.argmin', 'numerix.argsort', 'numerix.around', 'numerix.array', 'numerix.arrayrange', 'nume rix.asarray', 'numerix.asum', 'numerix.bitwise_and', 'numerix.bitwise_or', 'numerix.bitwise_xor', 'numerix.ceil', 'numerix.choose', 'numerix.clip', 'numerix.com press', 'numerix.concatenate', 'numerix.conjugate', 'numerix.convolve', 'numerix.cos', 'numerix.cosh', 'numerix.cross_correlate', 'numerix.cumproduct', 'numerix =2Ecumsum', 'numerix.diagonal', 'numerix.divide', 'numerix.dot', 'numerix.equal', 'numerix.exp', 'numerix.fabs', 'numerix.fft.fft', 'numerix.fft.inverse_fft', 'nu merix.floor', 'numerix.fmod', 'numerix.fromfunction', 'numerix.fromstring', 'numerix.greater', 'numerix.greater_equal', 'numerix.hypot', 'numerix.identity', 'nu merix.indices', 'numerix.innerproduct', 'numerix.iscontiguous', 'numerix.isnan', 'numerix.less', 'numerix.less_equal', 'numerix.log', 'numerix.log10', 'numerix. logical_and', 'numerix.logical_not', 'numerix.logical_or', 'numerix.logical_xor', 'numerix.matrixmultiply', 'numerix.maximum', 'numerix.minimum', 'numerix.mlab. amax', 'numerix.mlab.amin', 'numerix.mlab.cov', 'numerix.mlab.diff', 'numerix.mlab.hanning', 'numerix.mlab.rand', 'numerix.mlab.std', 'numerix.mlab.svd', 'numer ix.multiply', 'numerix.negative', 'numerix.newaxis', 'numerix.nonzero', 'numerix.not_equal', 'numerix.nx', 'numerix.ones', 'numerix.outerproduct', 'numerix.pi', 'numerix.power', 'numerix.product', 'numerix.put', 'numerix.putmask', 'numerix.rank', 'numerix.ravel', 'numerix.repeat', 'numerix.reshape', 'numerix.resize', ' numerix.searchsorted', 'numerix.shape', 'numerix.sin', 'numerix.sinh', 'numerix.size', 'numerix.sometrue', 'numerix.sort', 'numerix.sqrt', 'numerix.subtract', ' numerix.swapaxes', 'numerix.take', 'numerix.tan', 'numerix.tanh', 'numerix.trace', 'numerix.transpose', 'numerix.typecode', 'numerix.typecodes', 'numerix.where' , 'numerix.which', 'numerix.zeros', 'pre', 'serial', 'setuptools', 'setuptools.command', 'setuptools.command.egg_info', 'setuptools.command.install', 'testing.S cipyTest', 'win32api', 'win32con', 'win32pdh', 'xml.xslt', 'xml.xslt.ParsedPattern', 'numpy.Complex', 'numpy.Complex32', 'numpy.Complex64', 'numpy.Float', 'nump y.Float32', 'numpy.Float64', 'numpy.Int', 'numpy.Int16', 'numpy.Int32', 'numpy.Int8', 'numpy.UInt16', 'numpy.UInt32', 'numpy.UInt8', 'numpy.arccos', 'numpy.arcc osh', 'numpy.arcsin', 'numpy.arcsinh', 'numpy.arctan', 'numpy.arctanh', 'numpy.bitwise_and', 'numpy.bitwise_or', 'numpy.bitwise_xor', 'numpy.ceil', 'numpy.conju gate', 'numpy.core.add', 'numpy.core.bitwise_and', 'numpy.core.bitwise_or', 'numpy.core.bitwise_xor', 'numpy.core.cdouble', 'numpy.core.complexfloating', 'numpy =2Ecore.conjugate', 'numpy.core.csingle', 'numpy.core.divide', 'numpy.core.double', 'numpy.core.equal', 'numpy.core.float64', 'numpy.core.greater', 'numpy.core.gr eater_equal', 'numpy.core.inexact', 'numpy.core.intc', 'numpy.core.invert', 'numpy.core.left_shift', 'numpy.core.less', 'numpy.core.less_equal', 'numpy.core.max imum', 'numpy.core.not_equal', 'numpy.core.power', 'numpy.core.remainder', 'numpy.core.right_shift', 'numpy.core.sin', 'numpy.core.single', 'numpy.core.sqrt', ' numpy.core.subtract', 'numpy.cosh', 'numpy.dft.old', 'numpy.divide', 'numpy.e', 'numpy.fabs', 'numpy.floor', 'numpy.floor_divide', 'numpy.fmod', 'numpy.greater' , 'numpy.hypot', 'numpy.invert', 'numpy.left_shift', 'numpy.less', 'numpy.log', 'numpy.log10', 'numpy.logical_and', 'numpy.logical_not', 'numpy.logical_or', 'nu mpy.logical_xor', 'numpy.maximum', 'numpy.minimum', 'numpy.negative', 'numpy.not_equal', 'numpy.power', 'numpy.random.rand', 'numpy.random.randn', 'numpy.remain der', 'numpy.right_shift', 'numpy.sinh', 'numpy.tan', 'numpy.tanh', 'numpy.true_divide'] =20 Do you know what to do to solve this problem? =20 Thank you very much for your answers. =20 =20 This e-mail communication contains information that is confidential and m= ay also be privileged. It is intended for the exclusive use of the addres= sees. If you are not the person or organization to whom it is addressed, = you must not copy, distribute or take any action in reliance upon it. If = you received this communication in error, please notify Septentrio nv imm= ediately [ telephone +32 [0] 16 300800 ]. Septentrio nv will not accept l= iability for contractual commitments made by individuals employed by this= company outside the scope of our business. |
From: Robert C. <cim...@nt...> - 2006-10-12 11:25:16
|
I have just added 'See also' to all docstrings in arraysetops functions, replaced old numpy idioms with new ones (aka modernizing) and improved speed of numpy.unique1d, which now reflects numpy.unique. hoping no bugs were introduced, regards, r. |
From: Stefan v. d. W. <st...@su...> - 2006-10-12 10:22:06
|
On Thu, Oct 12, 2006 at 12:38:51AM -0600, Travis Oliphant wrote: >=20 > I made some fixes to the "asbuffer" code which let me feel better about= =20 > exposing it in NumPy (where it is now named int_asbuffer). >=20 > This code takes a Python integer and a size and returns a buffer object= =20 > that points to that memory. A little test is performed by trying to=20 > read (and possibly write if a writeable buffer is requested) to the=20 > first and last elements of the buffer. Any segfault is trapped and use= d=20 > to raise a Python error indicating you can't use that area of memory.=20 >=20 > It doesn't guarantee you won't shoot yourself, but it does make it more= =20 > difficult to segfault Python. Previously a simple int_asbuffer(3423423= ,=20 > 5) would have segfaulted (unless by chance you the memory area 3423423=20 > happens to be owned by Python). Some argument checking and a docstring would be helpful. I guessed wrong the first time: In [1]: x =3D N.array([1,2,3]) In [4]: y =3D N.int_asbuffer(x.size,x.__array_interface__['data'][0]) In [5]: y[0] Segmentation fault Out of curiosity, why does the following outputs differ: In [39]: y =3D N.int_asbuffer(0L,x.size) -------------------------------------------------------------------------= -- exceptions.SystemError Traceback (most rece= nt call last) /home/stefan/<ipython console>=20 SystemError: error return without exception set In [40]: y =3D N.int_asbuffer(1L,x.size) -------------------------------------------------------------------------= -- exceptions.ValueError Traceback (most rece= nt call last) /home/stefan/<ipython console>=20 ValueError: cannot use memory location as a buffer. Thanks for your work on this. Cheers St=E9fan |
From: <ma...@ph...> - 2006-10-12 10:13:15
|
PEhUTUw+PEhFQUQ+DQo8TUVUQSBodHRwLWVxdWl2PUNvbnRlbnQtVHlwZSBjb250ZW50PSJ0ZXh0 L2h0bWw7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PElNRyBoZWlnaHQ9NCBh bHQ9IiIgc3JjPSJodHRwOi8vaG90c2hvdC5ob3RsaXphcmQubmV0L2ltYWdlcy9zdGFuZGFyZHRl bXBsYXRlcy9ob3RsaXphcmQyMDA1L3NwYWNlci5naWYiIHdpZHRoPTEgYm9yZGVyPTAgTk9TRU5E PSIxIj48L1REPjwvVFI+DQo8VFI+DQo8VEQgYmFja2dyb3VuZD1odHRwOi8vaG90c2hvdC5ob3Rs aXphcmQubmV0L2ltYWdlcy9zdGFuZGFyZHRlbXBsYXRlcy9ob3RsaXphcmQyMDA1L2JvdHRvbWJh ci5naWY+PElNRyBoZWlnaHQ9OCBhbHQ9IiIgc3JjPSJodHRwOi8vaG90c2hvdC5ob3RsaXphcmQu bmV0L2ltYWdlcy9zdGFuZGFyZHRlbXBsYXRlcy9ob3RsaXphcmQyMDA1L3NwYWNlci5naWYiIHdp ZHRoPTEgYm9yZGVyPTAgTk9TRU5EPSIxIj48L1REPjwvVFI+DQo8VFI+DQo8VEQ+DQo8VEFCTEUg Y2VsbFNwYWNpbmc9NCBjZWxsUGFkZGluZz0wIHdpZHRoPTYwMCBib3JkZXI9MD4NCjxUQk9EWT4N CjxUUj4NCjxURD4mbmJzcDs8L1REPjwvVFI+PC9UQk9EWT48L1RBQkxFPjwvVEQ+PC9UUj4NCjxU Uj4NCjxURD48SU1HIGhlaWdodD00IGFsdD0iIiBzcmM9Imh0dHA6Ly9ob3RzaG90LmhvdGxpemFy ZC5uZXQvaW1hZ2VzL3N0YW5kYXJkdGVtcGxhdGVzL2hvdGxpemFyZDIwMDUvc3BhY2VyLmdpZiIg d2lkdGg9MSBib3JkZXI9MCBOT1NFTkQ9IjEiPjwvVEQ+PC9UUj48L1RCT0RZPjwvVEFCTEU+PC9C T0RZPjwvSFRNTD4= |
From: Stefan v. d. W. <st...@su...> - 2006-10-12 09:32:16
|
I've summarised this thread at http://www.scipy.org/NegativeSquareRoot Feel free to make adjustments, in case I missed something. Regards Stefan |
From: Cristian C. <cri...@gm...> - 2006-10-12 09:13:39
|
Hello list, I got some old code that uses Scientific and Numeric. Recently, these two packages were updated to the latest versions together with python and my code started failing. The first major problem I have is when downcasting. Code that used to work now fails because the array cannot be safely cast anymore to the required type. If anyone could help me please and direct me to some documentation about when this change happened (version), why it happened, is there any other solution but using astype, can numpy help me in anyway in this situation, because I got really lost ... Thank you in advance, Cristian |
From: Mark B. <ma...@gm...> - 2006-10-12 07:58:47
|
My vote is for consistency in numpy. But it is unclear what consistency is. What is truly confusing for newbie Python users (and a source for error even after 5 years of Python programming) is that >>> 2/3 0 In that respect, I would think >>> numpy.sqrt(2) should give 1, but it gives 1.4142135623730951 So numpy does typechecking anyway (it gets an integer and makes it a float). If that is the consistent behavior, then by all means >>> sqrt(-1) should return 1j. Wouldn't that be the consistent thing to do???? Mark |
From: David G. <Dav...@no...> - 2006-10-12 07:54:40
|
Travis Oliphant wrote: > David Goldsmith wrote: > >>> >>> >>> >> I don't use scipy (and don't want to because of the overhead) but it >> sounds like I should because if I'm taking the square root of a variable >> whose value at run time happens to be real but less than zero, I *want* >> the language I'm using to return an imaginary; in other words, it's not >> the scipy behavior which "scares" me, its the numpy (which I do/have >> been using) behavior. >> > > O.K. Well the functions you want are in numpy.lib.scimath. I should > have directed you there. You actually don't need scipy installed at > all. Just import sqrt from numpy.lib.scimath. I'm sorry I > misunderstood the issue. > Got it. And if I understand correctly, the import order you specify in the little mynumpy example you included in your latest response to Fernando will result in any "overlap" between numpy and numpy.lib.scimath to call the latter's version of things rather than the former's, yes? DG > -Travis > > > ------------------------------------------------------------------------- > 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 > |