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: Travis O. <oli...@ie...> - 2006-07-12 19:23:24
|
Mark Heslep wrote: > I don't see a clean way to create a numpy array from a ctypes pointer object. Is the __array_interface_ in ctypes the thing thats missing needed to make this happen? I've followed Albert's Scipy cookbook on ctypes here > > http://www.scipy.org/Cookbook/Ctypes <-- getting dated now for numpy SVN but the idea is clear > > This shows clean ways to > 1) Create a ctype array object from a numpy array: > npptr= nparray.__array_interface__['data'][0] > ctarray = (c_double * nparray.size).from_address(npptr) > > 2) Create a numpy array from a ctypes array (not a pointer): > ctarray = (c_double * 2)() > nparray = N.array( ctarray ) > > But if I'm starting with say, a POINTER(c_int) and a separate size argument that's returned from a ctypes foreign function or provided by _fields_ element in a ctypes structure, then I'm unclear how to provide the pointer in Python to numpy. The numpy methods or creating an array in Python as I see it are basically two: > > N.array, N.asarray <-- require a sequence object > N.fromstring, N.frombuffer <-- not available unless given c_char_p and even thats wrong if I don't want zero termination. > The problem here is that from Python NumPy has no way to create an ndarray from a pointer. Doing this creates a situtation where it is unclear who owns the memory. It is probably best to wrap the pointer into some kind of object exposing the buffer protocol and then pass that to frombuffer (or ndarray.__new__). When an ndarray is using memory that is not its own, it expects another object to be "in charge" of that memory and the ndarray will point its base attribute to it and increment its reference count. What should the object that is "in charge" of the memory be? Perhaps a suitable utility function could be created that can work with ctypes to create ndarrays from ctypes memory locations and either own or disown the data. This needs to be thought through a bit, however. -Travis > The attributes in nparray.__array_interface_ are not writable, so no joy there. > > On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data ptr) C API does the job nicely. Is there a ctypes paradigm for SimpleNew...? > > Mark > > > > ------------------------------------------------------------------------- > 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: Thomas H. <th...@py...> - 2006-07-12 19:15:59
|
Mark Heslep schrieb: > Travis Oliphant wrote: >> Mark Heslep wrote: >>> I don't see a clean way to create a numpy array from a ctypes pointer >>> object. Is the __array_interface_ in ctypes the thing thats missing >>> needed to make this happen? I've followed Albert's Scipy cookbook >>> on ctypes here >>> >>> On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data >>> ptr) C API does the job nicely. Is there a ctypes paradigm for >>> SimpleNew...? >>> >> Can you somehow call this function using ctypes? >> >> -Travis > That might work, though indirectly. As I think I understand from ctypes > docs: Ctypes uses functions exposed in a shared library, macros > existing only a header are not available. If its PyArray... is a macro > then I a) need to compile and make a little library directly from > arrayobject.h or b) need to use the root function upon which the macro > is based, PyArrayNew? Sure, macros will not work. > ctypes has built-in access to the functions in the core python library, > but Im not sure which library contains all the PyArray API calls, since > its all typically hidden by distutils and setup.py On Linux it doesn't matter, since you don't need to know which library exports a function (If I understand shared libs in Linux correctly). At least dlsym can be called with a NULL handle. On windows, functions can only be retrieved from exactly the library that exposes them. Plus, the function must explicitly marked exported either by compiler directives in the source code of by listing them in a .def file. Thomas |
From: Mark H. <ma...@mi...> - 2006-07-12 19:06:20
|
Travis Oliphant wrote: > Mark Heslep wrote: >> I don't see a clean way to create a numpy array from a ctypes pointer >> object. Is the __array_interface_ in ctypes the thing thats missing >> needed to make this happen? I've followed Albert's Scipy cookbook >> on ctypes here >> >> On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data >> ptr) C API does the job nicely. Is there a ctypes paradigm for >> SimpleNew...? >> > Can you somehow call this function using ctypes? > > -Travis That might work, though indirectly. As I think I understand from ctypes docs: Ctypes uses functions exposed in a shared library, macros existing only a header are not available. If its PyArray... is a macro then I a) need to compile and make a little library directly from arrayobject.h or b) need to use the root function upon which the macro is based, PyArrayNew? ctypes has built-in access to the functions in the core python library, but Im not sure which library contains all the PyArray API calls, since its all typically hidden by distutils and setup.py Mark |
From: Sasha <nd...@ma...> - 2006-07-12 18:33:42
|
Let me repeat my suggestion that was lost in this long thread: Add rands(shape, dtype=float, min=default_min(dtype), max=default_max(dtype)) to the top level. Suitable defaults can be discussed. A more flexible variation could be rands(shape, dtype=float, algorithm=default_algorithm(dtype)), but that would probably be an overkill. I think this will help teaching: rands is similar to zeros and ones, but with few bells and whistles to be covered in the graduate course. On 7/12/06, Alan G Isaac <ai...@am...> wrote: > Robert makes his case clearly and persuasively. > Without pretending to challenge his argument in any way, > I would just like to clarify what is at issue > for some of the teaching crowd (or for me in any case). > > - Get up and running very quickly even with students who > lack a programming background. This means having rand() > and randn() in the top-level namespace is nice, since > I use them early and often. > - Avoid confusion and frustration. This is the basis for > having a "consistent" calling convention for array > constructors (pace Robert's arguments about consistency). > > > On Tue, 11 Jul 2006, Robert Kern apparently wrote: > > And mark my words, if we make rand() polymorphic, we will > > get just as many newbies coming to the list asking why > > ones(3, 4) doesn't work. > > That is plausible. > If polymorphism is chosen for rand() and randn(), I suppose > I would address this by documenting the current API as > present for backwards compatability only. That allows > a quick answer, but perhaps does not preclude the questions. > > Cheers, > Alan Isaac > > > > > > > ------------------------------------------------------------------------- > 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: Travis O. <oli...@ie...> - 2006-07-12 17:48:10
|
Mark Heslep wrote: > I don't see a clean way to create a numpy array from a ctypes pointer object. Is the __array_interface_ in ctypes the thing thats missing needed to make this happen? I've followed Albert's Scipy cookbook on ctypes here > > On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data ptr) C API does the job nicely. Is there a ctypes paradigm for SimpleNew...? > Can you somehow call this function using ctypes? -Travis |
From: Mark H. <ma...@mi...> - 2006-07-12 17:42:47
|
I don't see a clean way to create a numpy array from a ctypes pointer object. Is the __array_interface_ in ctypes the thing thats missing needed to make this happen? I've followed Albert's Scipy cookbook on ctypes here http://www.scipy.org/Cookbook/Ctypes <-- getting dated now for numpy SVN but the idea is clear This shows clean ways to 1) Create a ctype array object from a numpy array: npptr= nparray.__array_interface__['data'][0] ctarray = (c_double * nparray.size).from_address(npptr) 2) Create a numpy array from a ctypes array (not a pointer): ctarray = (c_double * 2)() nparray = N.array( ctarray ) But if I'm starting with say, a POINTER(c_int) and a separate size argument that's returned from a ctypes foreign function or provided by _fields_ element in a ctypes structure, then I'm unclear how to provide the pointer in Python to numpy. The numpy methods or creating an array in Python as I see it are basically two: N.array, N.asarray <-- require a sequence object N.fromstring, N.frombuffer <-- not available unless given c_char_p and even thats wrong if I don't want zero termination. The attributes in nparray.__array_interface_ are not writable, so no joy there. On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data ptr) C API does the job nicely. Is there a ctypes paradigm for SimpleNew...? Mark |
From: John C. <jn...@ec...> - 2006-07-12 16:38:10
|
I had problems building SciPy and NumPy under Windows. They went away when I stopped using the stable version of gcc and used 3.4.5 I think the problem was related to differences in cygwin and mingw32. SciPy built and everything I've needed works but the self test fails. John Dr. John N. Carter jn...@ec... ISIS http://www.ecs.soton.ac.uk/~jnc/ |
From: Karol L. <kar...@kn...> - 2006-07-12 14:16:04
|
On Wednesday 12 July 2006 16:00, Thomas Heller wrote: > Karol Langner schrieb: > > On Wednesday 12 July 2006 13:29, Thomas Heller wrote: > >> Sasha schrieb: > >> > I had similar hopes when I submited the array interface patch > >> > <https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D14529= 06&gro > >> >up_ id=3D5470&atid=3D305470> and announced it on python-dev > >> > <http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3068813>. > >> > > >> > I am still waiting for anyone to comment on it :-( > >> > >> The *relevant* comment is here: > >> > >> http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3078372 > >> > >> Thomas > > > > A related PEP _is_ being prepared - it can be found at > > http://svn.scipy.org/svn/PEP/ (created by Travis). > > I know. But, hiding it somewhere on the internet doesn't lead anywhere. > You (the authors) should follow the official PEP process, instead: > submit an official PEP, post it for feedback, and so on. I haven't actually thought about this, but I guess that is will happen soon= er=20 or later. I started working on the code in the scipt svn repository, and I'= m=20 not to well oriented how the dev procedure works. Maybe Travis can tell us= =20 about long-term strategy for the PEP, if there already is some? There was a PEP back in 2001 concerning MD-arrays=20 (http://www.python.org/dev/peps/pep-0209/), which is was even featured in t= he=20 "PEP parade" (http://www.python.org/doc/essays/pepparade.html), but got=20 deferred, abandoned, withdrawn, or something else. Karol =2D-=20 written by Karol Langner =B6ro lip 12 16:04:22 CEST 2006 |
From: Thomas H. <th...@py...> - 2006-07-12 14:01:40
|
Karol Langner schrieb: > On Wednesday 12 July 2006 13:29, Thomas Heller wrote: >> Sasha schrieb: >> > I had similar hopes when I submited the array interface patch >> > <https://sourceforge.net/tracker/index.php?func=detail&aid=1452906&group_ >> >id=5470&atid=305470> and announced it on python-dev >> > <http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3068813>. >> > >> > I am still waiting for anyone to comment on it :-( >> >> The *relevant* comment is here: >> >> http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3078372 >> >> Thomas > > A related PEP _is_ being prepared - it can be found at > http://svn.scipy.org/svn/PEP/ (created by Travis). I know. But, hiding it somewhere on the internet doesn't lead anywhere. You (the authors) should follow the official PEP process, instead: submit an official PEP, post it for feedback, and so on. Thomas |
From: Karol L. <kar...@kn...> - 2006-07-12 13:41:18
|
On Wednesday 12 July 2006 13:29, Thomas Heller wrote: > Sasha schrieb: > > I had similar hopes when I submited the array interface patch > > <https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1452906&= group_ > >id=3D5470&atid=3D305470> and announced it on python-dev > > <http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3068813>. > > > > I am still waiting for anyone to comment on it :-( > > The *relevant* comment is here: > > http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3078372 > > Thomas A related PEP _is_ being prepared - it can be found at=20 http://svn.scipy.org/svn/PEP/ (created by Travis). In fact, I am working on= =20 it for Google Summer of Code, as I wrote in a different thread. I think tha= t=20 if everyone interested in getting some kind of array interface into Python= =20 core focused on a common effort, it would be more effecient and probably ma= ke=20 a stronger impression. I created a page about it at http://scipy.org/BaseArray, and will be adding= =20 more information very soon. Contribution and comments from annyone interest= ed=20 are very welcome. I really hope we can get this moving allong, and do it right. Karol =2D-=20 written by Karol Langner =B6ro lip 12 15:31:09 CEST 2006 |
From: Alan G I. <ai...@am...> - 2006-07-12 13:34:21
|
Robert makes his case clearly and persuasively. Without pretending to challenge his argument in any way, I would just like to clarify what is at issue for some of the teaching crowd (or for me in any case). - Get up and running very quickly even with students who lack a programming background. This means having rand() and randn() in the top-level namespace is nice, since I use them early and often. - Avoid confusion and frustration. This is the basis for having a "consistent" calling convention for array constructors (pace Robert's arguments about consistency). On Tue, 11 Jul 2006, Robert Kern apparently wrote: > And mark my words, if we make rand() polymorphic, we will > get just as many newbies coming to the list asking why > ones(3, 4) doesn't work. That is plausible. If polymorphism is chosen for rand() and randn(), I suppose I would address this by documenting the current API as present for backwards compatability only. That allows a quick answer, but perhaps does not preclude the questions. Cheers, Alan Isaac |
From: Thomas H. <th...@py...> - 2006-07-12 11:30:14
|
Sasha schrieb: > I had similar hopes when I submited the array interface patch > <https://sourceforge.net/tracker/index.php?func=detail&aid=1452906&group_id=5470&atid=305470> > and announced it on python-dev > <http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3068813>. > > I am still waiting for anyone to comment on it :-( > The *relevant* comment is here: http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3078372 Thomas |
From: Stefan v. d. W. <st...@su...> - 2006-07-12 11:04:05
|
Hi Tamaryn On Wed, Jul 12, 2006 at 11:57:48AM +0100, Tamaryn Menneer wrote: > Hi=20 >=20 > I'm running Python 2.4 on Windows XP. I've installed NumPy, and run the > simple test of "import numeric" but I get the error "ImportError: No mo= dule > named numeric" in return. The module numeric is located in > C:\Python24\Lib\site-packages\numpy\core, but even when I set PYTHONPAT= H to > this it returns the same error. Imports of modules in the Lib directory= work > fine, but everything I've tried within site-packages results the no mod= ule > error. Set your PYTHONPATH to c:\Python24\Lib\site-packages and then try from numpy import oldnumeric as numeric > Any guidance would be very much appreciated. I'm virtually a complete n= ewbie > to all this, but I'll try my best to understand any responses!=20 If you are just starting out with numpy, you shouldn't need to import the numeric module at all. Take a look at the documentation on http://www.scipy.org/Documentation Good luck! St=E9fan |
From: Sven S. <sve...@gm...> - 2006-07-12 11:02:32
|
Tamaryn Menneer schrieb: > Hi > > I'm running Python 2.4 on Windows XP. I've installed NumPy, and run the > simple test of "import numeric" but I get the error "ImportError: No module > named numeric" in return. The module numeric is located in > C:\Python24\Lib\site-packages\numpy\core, but even when I set PYTHONPATH to > this it returns the same error. Imports of modules in the Lib directory work > fine, but everything I've tried within site-packages results the no module > error. > > numpy is not numeric, so just do "import numpy" to test the install. Just ignore all the dir structure under ...\numpy\, as a user you don't usually need to look at it. -sven |
From: Tamaryn M. <T.M...@so...> - 2006-07-12 10:58:14
|
Hi I'm running Python 2.4 on Windows XP. I've installed NumPy, and run the simple test of "import numeric" but I get the error "ImportError: No module named numeric" in return. The module numeric is located in C:\Python24\Lib\site-packages\numpy\core, but even when I set PYTHONPATH to this it returns the same error. Imports of modules in the Lib directory work fine, but everything I've tried within site-packages results the no module error. I originally installed Python24 in Program Files, and thought this might be causing the problem with a hardwired pathname somewhere, but having uninstalled and reinstalled directly on the C drive, I still get the same problem. Any guidance would be very much appreciated. I'm virtually a complete newbie to all this, but I'll try my best to understand any responses! Thank you :-) Tam. |
From: Sven S. <sve...@gm...> - 2006-07-12 10:21:30
|
Travis Oliphant schrieb: > > Because of this. I've removed the global_namespace functions (fft, > ifft, rand, and randn) from numpy. They are *no longer* in the > top-level name-space. If you want them, setup a startup-file > appropriately. > Ok I'm glad that's settled; however, do I understand correctly (after looking at the new numpy.matlib for the first time), that numpy.matlib.rand() still doesn't accept tuples, and that the tuple-accepting "full" version is not exposed in numpy.matlib? If so, it would be perfect if numpy.matlib could be augmented by a matrix analogue pointing to numpy.random.random() or whatever its full name is. Then the situation for matrix users is actually quite nice, just have to import everything from numpy.matlib. Thanks, Sven |
From: Sven S. <sve...@gm...> - 2006-07-12 09:45:06
|
JJ schrieb: > Travis Oliphant <oliphant <at> ee.byu.edu> writes: > >> Svd returns matrices now. Except for the list of singular values >> which is still an array. Do you want a 1xn matrix instead of an >> array? Although I'm a matrix supporter, I'm not sure here. Afaics the pro argument is to have *everything* a matrix when you're in that camp. Fair enough. But then it's already not clear if you want a row or a column, and you carry an extra dimension around, which is sometimes annoying e.g. for cumulation of the values, which I do a lot (for eigenvalues, that is). So for my personal use I came to the conclusion that the status quo of numpy (array for the value list, matrix for the decomp) is just fine. So maybe the people in favor of values-in-1xn-matrices can tell why they need to matrix-multiply the value array afterwards, because that's the only benefit I can see here. > > I had just tried this with my new version of numpy, but I had used svd > as follows: > import scipy.linalg as la > res = la.svd(M) > That returned arrays, but I see that using: > res = linalg.svd(M) > returns matrices. Apparently, both numpy and scipy have linalg > packages, which differ. I did not know that. Whoops. > I'm trying to get by with numpy (good that kron was brought over!), but eventually I will need scipy -- I was hoping that all the matrix discussion in the numpy list implicitly applied to scipy as well. Is that not true? Cheers, Sven |
From: Stefan v. d. W. <st...@su...> - 2006-07-12 09:01:11
|
On Wed, Jul 12, 2006 at 05:47:15PM +0900, Bill Baxter wrote: > On 7/12/06, Travis Oliphant <oli...@ie...> wrote: >=20 >=20 > Because of this. I've removed the global_namespace functions (fft, > ifft, rand, and randn) from numpy. They are *no longer* in the > top-level name-space. If you want them, setup a startup-file > appropriately. >=20 >=20 >=20 > Any hints as to where we can find them now? > (more generally -- how is one supposed to find stuff in big python pack= ages to > begin with? Like -- "show me anything with 'rand' in the name".) It is in numpy.random.rand. If you are using ipython, you can do import numpy numpy.*rand*? which will print out a list of all members that contain "rand". In this case numpy.random. To do a deeper search, use pydoc. You can start it with pydoc -g which should pop up a graphical interface, where you can type in a search term. Click on the results to open the appropriate documentation web page. > Also, numpy.matlib.rand() needs to be updated to point to the new locat= ion as > well. Already fixed in SVN. Cheers St=E9fan |
From: Bill B. <wb...@gm...> - 2006-07-12 08:47:21
|
On 7/12/06, Travis Oliphant <oli...@ie...> wrote: > > > Because of this. I've removed the global_namespace functions (fft, > ifft, rand, and randn) from numpy. They are *no longer* in the > top-level name-space. If you want them, setup a startup-file > appropriately. > Any hints as to where we can find them now? (more generally -- how is one supposed to find stuff in big python packages to begin with? Like -- "show me anything with 'rand' in the name".) Also, numpy.matlib.rand() needs to be updated to point to the new location as well. --bb |
From: Bill B. <wb...@gm...> - 2006-07-12 08:24:57
|
On 7/10/06, Bryce Hendrix <bhe...@en...> wrote: > > Keith Goodman wrote: > > Doesn't --prefix=/install/numpy/here/ work on windows? > > For our Windows Enthon project, the build command is > > setup.py config --compiler=mingw32 build --compiler=mingw32 install -- > prefix=path_to_where_numpy_goes. > Thanks for the info. I added it to the "building numpy/scipy on windows" wiki. Still looking for help on how to get SciPy to build on Windows if anyone knows anything about that. I posted my symptoms to the SciPy list, but got no response. --bb |
From: Johannes L. <a.u...@gm...> - 2006-07-12 07:10:51
|
On Wednesday 12 July 2006 02:07, Michael Sorich wrote: > On 7/12/06, JJ <jos...@ya...> wrote: > > 2) It would be very convienient to have some simple way to delete > > selected columns of a matrix. For example, in matlab the command is > > X[:,[3,5,7]]=[] to delete the three selected columns. It would be nice > > if such a command would also work with selections, as in X[:,A[0,:]<4] = > > [], where X and A are matrices. > (...) > I like the current use of negative indices in numpy, but I do find > myself missing the ability to easily make a copy of the array without > certain indices. Maybe use complex numbers? draft: >>> a = arange(10) >>> print a[ 3j ] [ 0 1 2 4 5 6 7 8 9 ] Johannes |
From: Travis O. <oli...@ie...> - 2006-07-12 06:53:00
|
Bill Baxter wrote: > > And mark my words, if we make rand() polymorphic, > > we will get just as many newbies coming to the list asking why > ones(3, 4) > > doesn't work. > > > I think you're probably right there, at least for Matlab converts. > Matlab allows either way of calling for all of rand, ones, zeros, eye, > and in general tries to make *every* function accept *any* possible > combination of arguments that might make sense. So having rand() > accept both, but not the others, will undoubtedly be unexpected to > Matlab users. And the argument against funky overloading will be > weaker since they'll be able to say "well rand() does it? why can't > ones()?" > > Fortunately it's pretty easy to define one's own custom versions of > these little helper functions to make them just the way you like > them. Or for rand(), just "from numpy.random import uniform_sample > as rand" if that's the version you like. Because of this. I've removed the global_namespace functions (fft, ifft, rand, and randn) from numpy. They are *no longer* in the top-level name-space. If you want them, setup a startup-file appropriately. -Travis |
From: Bill B. <wb...@gm...> - 2006-07-12 06:09:57
|
> > And mark my words, if we make rand() polymorphic, > we will get just as many newbies coming to the list asking why ones(3, 4) > doesn't work. > I think you're probably right there, at least for Matlab converts. Matlab allows either way of calling for all of rand, ones, zeros, eye, and in general tries to make *every* function accept *any* possible combination of arguments that might make sense. So having rand() accept both, but not the others, will undoubtedly be unexpected to Matlab users. And the argument against funky overloading will be weaker since they'll be able to say "well rand() does it? why can't ones()?" Fortunately it's pretty easy to define one's own custom versions of these little helper functions to make them just the way you like them. Or for rand(), just "from numpy.random import uniform_sample as rand" if that's the version you like. This isn't a panacea, but you can then collect all these into a little customization module, say "mynum.py" which is somewhere on your PYTHONPATH, and then set up all your customizations with a "from mynum import *" You can even go further if you wish and define the PYTHONSTARTUP environment variable to point to a file that does "from mynum import *" so that every time you start up the interactive interpreter you have your definitions there already. I'm sure this is all well known to you long-time Python'ers out there, but I thought I'd mention it since there are probably other numpy users out there who, like me, are pretty new to Python. --bb |
From: Fernando P. <fpe...@gm...> - 2006-07-12 06:02:29
|
On 7/11/06, Travis Oliphant <oli...@ie...> wrote: > Make sure you get rid of the MANIFEST file in the source directory > before trying to run sdist or bdist_rpm. The MANIFEST file is not being > deleted when it is dated... Since both numpy/scipy have a MANIFEST.in, this bit of code (from ipython's setup.py) is probably a good idea to put in: # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly # update it when the contents of directories change. if os.path.exists('MANIFEST'): os.remove('MANIFEST') I committed this as I don't see any problem with it (ipython has used it for years). Feel free to revert if you object. I also added #!/usr/bin/env python to both of them. They were set as executable scripts but without a proper shebang line, causing the interesting mis-behavior of being treated like shell scripts. Which means the first import os line would simply give you a weird-looking cross-hairs cursor, and a gigantic file called 'os' sitting on your directory once you clicked. Why? That's the ImageMagick 'import' command, which takes a screenshot in X bitmap format :) This one bit me a few times, so I decided to also fix it, but feel free to revert if you see a good reason for the existing behavior. Cheers, f |
From: JJ <jos...@ya...> - 2006-07-12 05:01:21
|
> ...unless it returned the unique rows instead of the > unique elements > in each row. So if the matrix is > > 1 2 2 > 3 4 5 > 1 2 2 > > then the unique rows would be > > 1 2 2 > 3 4 5 > Hello Keith. Yes, that is what I mean also. JJ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |