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-06 08:20:52
|
Albert Strasheim wrote: > Hello all > > I noticed that arrays with dtypes with field names don't compare correctly > when using the equality operator. > > Example: > > In [17]: dt = N.dtype({'names' : ['f1', 'f2'], > 'formats' : [N.intc, N.intc]}) > > In [18]: x = N.array([(0,0)], dtype=dt) > > In [19]: y = N.array([(0,0)], dtype=dt) > > In [20]: x['f1']==y['f1'] > Out[20]: array([True], dtype=bool) > > In [21]: x['f2']==y['f2'] > Out[21]: array([True], dtype=bool) > > In [22]: x==y > Out[22]: False > > The question arises as to what should be returned when comparing these > arrays. One option would be an array with dtype=bool which would indicate > that each item in the array is equal in f1 and f2. Currently, in SVN, record-arrays now can be compared (== or != only). The comparison returns a single bool array: For equality the comparison is basically: res = True for name in x.dtype.fields[-1]: res = logical_and(res, x[name] == y[name]) while for not-equal comparisons it is: res = False for name in x.dtype.fields[-1]: res = logical_or(res, x[name] != y[name]) > Another option would be > an array with dtype > > N.dtype({'names' : ['f1', 'f2'], 'formats' : [bool,bool]}) > > I think this second option could be very useful for some applications, where > you might want to know something like: is the (i,j)th element of this array > the same in f1 and f2 but different in f3? > This is a bit too sophisticated and does not work very well for nested arrays. The implemented comparison works for nested arrays just fine. You can just test for what you want directly (x['f1'] == y['f2']) & (x['f1'] != y['f3']) to handle the fewer particular cases where the other approach might be useful. -Travis |
From: Albert S. <fu...@gm...> - 2006-07-06 08:08:30
|
Hello all I noticed that arrays with dtypes with field names don't compare correctly when using the equality operator. Example: In [17]: dt = N.dtype({'names' : ['f1', 'f2'], 'formats' : [N.intc, N.intc]}) In [18]: x = N.array([(0,0)], dtype=dt) In [19]: y = N.array([(0,0)], dtype=dt) In [20]: x['f1']==y['f1'] Out[20]: array([True], dtype=bool) In [21]: x['f2']==y['f2'] Out[21]: array([True], dtype=bool) In [22]: x==y Out[22]: False The question arises as to what should be returned when comparing these arrays. One option would be an array with dtype=bool which would indicate that each item in the array is equal in f1 and f2. Another option would be an array with dtype N.dtype({'names' : ['f1', 'f2'], 'formats' : [bool,bool]}) I think this second option could be very useful for some applications, where you might want to know something like: is the (i,j)th element of this array the same in f1 and f2 but different in f3? Any thoughts? Regards, Albert |
From: Stefan v. d. W. <st...@su...> - 2006-07-06 07:21:29
|
On Thu, Jul 06, 2006 at 11:39:19AM +0900, Bill Baxter wrote: > Often when I'm doing interactive prototyping I find myself wanting to c= heck > whether two arrays are sharing a copy of the same data. >=20 > It seems like there ought to be a concise way to do that, but right now= seems > like the only way is with a little function like this: >=20 > def same_base(a,b): > ab =3D a.base > if ab is None: ab =3D a > bb =3D b.base > if bb is None: bb =3D b > return ab is bb =20 >=20 > is there some easier built-in way? Does the above function even cover = all the > bases? (so to speak...) Say you have x =3D N.array([1,2,3,4]) and y =3D x.reshape((2,2)) then x and y share the same data. You can see this when you do x.__array_interface__['data'][0] =3D=3D y.__array_interface__['data'][0] Still, this only holds for full data views. If you had z =3D y[1:,1:] then the data memory position would differ. Cheers St=E9fan |
From: Satellite D. R. G. <sat...@po...> - 2006-07-06 05:02:49
|
Hi, I have a problem when importing numpy into python 2.4.1. I did a successful (I think) build and install of Numpy 0.9.8 on a mac osx (10.4) intel, but when i try to import numpy into python i get this error: >>> from numpy import* import core -> failed: Inappropriate file type for dynamic loading import lib -> failed: Inappropriate file type for dynamic loading import linalg -> failed: Inappropriate file type for dynamic loading import dft -> failed: Inappropriate file type for dynamic loading import random -> failed: Inappropriate file type for dynamic loading Traceback (most recent call last): File "<pyshell#0>", line 1, in -toplevel- from numpy import* File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/__init__.py", line 49, in -toplevel- import add_newdocs File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/add_newdocs.py", line 2, in -toplevel- from lib import add_newdoc File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/lib/__init__.py", line 5, in -toplevel- from type_check import * File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/lib/type_check.py", line 8, in -toplevel- import numpy.core.numeric as _nx File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/core/__init__.py", line 5, in -toplevel- import multiarray ImportError: Inappropriate file type for dynamic loading Any help anyone could offer as to the cause of this would be most welcome, Cheers, Joe Corbett ps. installing numpy through python 2.3 worked and I was able to import numpy into 2.3 fine. ----------------------------------------------------------------------- This mail sent through University of Auckland http://www.auckland.ac.nz |
From: Steve L. <lis...@ar...> - 2006-07-06 04:31:46
|
Hi folks, I'm able to build and install numpy on my intel mac OS 10.4.7 but I'm getting 3 unit test failures. I'm using gcc 4.0.1 and GNU Fortran 95 (GCC) 4.2.0 20060401 (if that's helpful to know). The relevant output from my ipython session is below. Doing some of the stuff I've found in random tutorials doesn't seem to be a problem .. though I do get seg faults when trying to do some scipy tutorial plotting stuff .. which I may post to the scipy list a bit later ... I just want to make sure I'm installing everything correctly first. Thanks for any insight, -steve In [3]: numpy.__version__ Out[3]: '0.9.9.2735' In [4]: numpy.test(1) .... ... cut some stuff out until first error .. ... ====================================================================== ERROR: check_basic (numpy.core.tests.test_defmatrix.test_algebra) ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/local/lib/python2.4/site-packages/numpy/core/tests/ test_defmatrix.py", line 125, in check_basic Ainv = linalg.inv(A) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 122, in inv return wrap(solve(a, identity(a.shape[0]))) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 109, in solve results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0) LapackError: Parameter ipiv is not of type PyArray_INT in lapack_lite.dgesv ====================================================================== ERROR: check_instance_methods (numpy.core.tests.test_defmatrix.test_matrix_return) ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/local/lib/python2.4/site-packages/numpy/core/tests/ test_defmatrix.py", line 157, in check_instance_methods f = eval('a.%s' % attrib) File "<string>", line 0, in ? File "/opt/local/lib/python2.4/site-packages/numpy/core/ defmatrix.py", line 293, in getI return matrix(inv(self)) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 122, in inv return wrap(solve(a, identity(a.shape[0]))) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 109, in solve results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0) LapackError: Parameter ipiv is not of type PyArray_INT in lapack_lite.dgesv ====================================================================== ERROR: check_basic (numpy.core.tests.test_defmatrix.test_properties) ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/local/lib/python2.4/site-packages/numpy/core/tests/ test_defmatrix.py", line 48, in check_basic assert allclose(linalg.inv(A), mA.I) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 122, in inv return wrap(solve(a, identity(a.shape[0]))) File "/opt/local/lib/python2.4/site-packages/numpy/linalg/ linalg.py", line 109, in solve results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0) LapackError: Parameter ipiv is not of type PyArray_INT in lapack_lite.dgesv ---------------------------------------------------------------------- |
From: Steve L. <lis...@ar...> - 2006-07-06 03:56:53
|
> I am trying to get numpy working with MacOSX 10.4 on an intel > processor. I had it working for Python2.3.5, but after installing > Python 2.4 it didn't work on either python version. Hi Stephen, I've been able to get numpy/scipy installed on my MacBook Pro (although I do get three unit test failures when I run nump.test(1) -- which I'll post next) One thing I'm noticing in what you printed out is that for some reason your doing something (linking?) to the version of Python that comes with your mac (2.3). Look at this output that you posted: > -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ > python2.3 Maybe you should do a: "python setups.py clean" and also remove your numpy build directory and start over. I guess you also have to make sure that all of your python 2.4 binaries come first (in terms of environment var/PATH) before the 2.3 binaries. Also .. one more thing, I also noticed that you didn't have any fortran compilers in your path, you can get gfortran like so: $curl -O http://easynews.dl.sourceforge.net/sourceforge/hpc/gfortran- intel-bin.tar.gz $ sudo tar -C / -xzf gfortran-intel-bin.tar.gz and it'll put gfortran in your /usr/local/bin (I got that info from http://bmistudents.blogspot.com/2006/04/on-installation-of-proper- python.html) -steve |
From: Travis O. <oli...@ie...> - 2006-07-06 03:48:27
|
Satellite Data Research Group wrote: > Dear all > > I am trying to get numpy working with MacOSX 10.4 on an intel > processor. I had it working for Python2.3.5, but after installing > Python 2.4 it didn't work on either python version. > > After inputing: > sudo python setup.py build > and then > sudo python setup.py install > > and also trying to load up a basic array, I get the following errors. > The errors that I get repeatedly during the installation process seem > to mainly be (without showing you the entire massive output, unless you > need to see it): > > > building extension "numpy.core.umath" sources > adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/config.h' to sources. > adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__ufunc_api.h' to sources. > adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/src' to include_dirs. > numpy.core - nothing done with h_files= > ['build/src.darwin-8.7.1-i386-2.3/numpy/core/config.h', > 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__multiarray_api.h', > 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__ufunc_api.h'] > > building extension "numpy.core._dotblas" sources > adding 'numpy/core/blasdot/_dotblas.c' to sources. > building extension "numpy.lib._compiled_base" sources > building extension "numpy.dft.fftpack_lite" sources > building extension "numpy.linalg.lapack_lite" sources > adding 'numpy/linalg/lapack_litemodule.c' to sources. > building extension "numpy.random.mtrand" sources > customize NAGFCompiler > customize AbsoftFCompiler > customize IbmFCompiler > Could not locate executable g77 > Could not locate executable f77 > Could not locate executable gfortran > Could not locate executable f95 > > customize GnuFCompiler > customize Gnu95FCompiler > customize G95FCompiler > customize GnuFCompiler > customize Gnu95FCompiler > customize NAGFCompiler > customize NAGFCompiler using config > gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp > -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes' > compile options: '-Inumpy/core/src -Inumpy/core/include > -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 > -c' > gcc: _configtest.c > > _configtest.c:7:2: error: #error No _WIN32 > _configtest.c:7:2: error: #error No _WIN32 > > The above lines of output are repeated a few times. If it makes any > difference, which I am sure that it does, I am running on an intel chip. > > This is not a problem. These are "configuration" "error" that the system uses to incorporate platform-specific code. > In Python, when typing > >>>> from numpy import * >>>> > I get: > Running from numpy source directory. > > This is the problem. The error is telling you that you can't import numpy from the directory where numpy was built (the import mechanism gets confused between the system-installed numpy and the directory structure underneath). Just exit Python and cd to another directory. Then numpy should work fine. -Travis |
From: Satellite D. R. G. <sat...@po...> - 2006-07-06 03:23:58
|
Dear all I am trying to get numpy working with MacOSX 10.4 on an intel processor. I had it working for Python2.3.5, but after installing Python 2.4 it didn't work on either python version. After inputing: sudo python setup.py build and then sudo python setup.py install and also trying to load up a basic array, I get the following errors. The errors that I get repeatedly during the installation process seem to mainly be (without showing you the entire massive output, unless you need to see it): building extension "numpy.core.umath" sources adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/config.h' to sources. adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__ufunc_api.h' to sources. adding 'build/src.darwin-8.7.1-i386-2.3/numpy/core/src' to include_dirs. numpy.core - nothing done with h_files= ['build/src.darwin-8.7.1-i386-2.3/numpy/core/config.h', 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__multiarray_api.h', 'build/src.darwin-8.7.1-i386-2.3/numpy/core/__ufunc_api.h'] building extension "numpy.core._dotblas" sources adding 'numpy/core/blasdot/_dotblas.c' to sources. building extension "numpy.lib._compiled_base" sources building extension "numpy.dft.fftpack_lite" sources building extension "numpy.linalg.lapack_lite" sources adding 'numpy/linalg/lapack_litemodule.c' to sources. building extension "numpy.random.mtrand" sources customize NAGFCompiler customize AbsoftFCompiler customize IbmFCompiler Could not locate executable g77 Could not locate executable f77 Could not locate executable gfortran Could not locate executable f95 customize GnuFCompiler customize Gnu95FCompiler customize G95FCompiler customize GnuFCompiler customize Gnu95FCompiler customize NAGFCompiler customize NAGFCompiler using config gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-Inumpy/core/src -Inumpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c' gcc: _configtest.c _configtest.c:7:2: error: #error No _WIN32 _configtest.c:7:2: error: #error No _WIN32 The above lines of output are repeated a few times. If it makes any difference, which I am sure that it does, I am running on an intel chip. In Python, when typing >>> from numpy import * I get: Running from numpy source directory. Then trying to make an array, I get: >>> vector = array((2,3,4,5,6)) Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'array' is not defined This is in Python2.3.5. However, my collegue had numpy working on Python2.3.5, with the exact same machine just now. Just for background information, we are needing numpy to use pyhdf, to load and analyse hdf files. Thank you so much for your help. Sincerely Stephen Johnston p.s my apologies for the multiple requests, this one just a revised version of my previous attempt at asking for help ----------------------------------------------------------------------- This mail sent through University of Auckland http://www.auckland.ac.nz |
From: Travis O. <oli...@ie...> - 2006-07-06 03:17:05
|
Tom Denniston wrote: > It seems from my cursory look that numpy doesn't support the pickling > or the tofile of PyObject arrays. Yes, you can pickle PyObject arrays, that is supposed to work. What is not working? You can't use tofile on PyObject arrays, because I didn't have clear idea what to do. Use Pickle for PyObject arrays. -Travis |
From: Tim L. <tim...@gm...> - 2006-07-06 03:00:10
|
On 7/6/06, Satellite Data Research Group <sat...@po...> wrote: > Dear Sir/Madam > > I am trying to install numpy0.9.8 onto Mac version 10.4 and Python2.4 > and am having trouble doing so. I had successfully installed > inumpy0.9.8 on Python2.3, so am very confused as to why it is not > working on Python2.4 > > After typing 'python setup.py build' and then 'python setup.py install' > from the terminal I get a host of errors, whereas with Python2.3 it > worked perfectly. Then in python typing 'from numpy import *' then > trying something like 'array((range(10))' I get an error saying array > cannot be found, whereas on Python2.3 this worked. > Hi Stephen, Could you please post the exact error messages you get. Without these it's not possible to diagnose your problem. Cheers, Tim. > I was wondering if anyone else had trouble installing numpy on > Python2.4 using Mac 10.4, and if anyone could help me rectify the > problem. Help would be greatly appreciated. > > Sincerely > > Stephen Johnston > > ----------------------------------------------------------------------- > This mail sent through University of Auckland http://www.auckland.ac.nz > > > 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: Satellite D. R. G. <sat...@po...> - 2006-07-06 02:55:16
|
Dear Sir/Madam I am trying to install numpy0.9.8 onto Mac version 10.4 and Python2.4 and am having trouble doing so. I had successfully installed inumpy0.9.8 on Python2.3, so am very confused as to why it is not working on Python2.4 After typing 'python setup.py build' and then 'python setup.py install' from the terminal I get a host of errors, whereas with Python2.3 it worked perfectly. Then in python typing 'from numpy import *' then trying something like 'array((range(10))' I get an error saying array cannot be found, whereas on Python2.3 this worked. I was wondering if anyone else had trouble installing numpy on Python2.4 using Mac 10.4, and if anyone could help me rectify the problem. Help would be greatly appreciated. Sincerely Stephen Johnston ----------------------------------------------------------------------- This mail sent through University of Auckland http://www.auckland.ac.nz |
From: Bill B. <wb...@gm...> - 2006-07-06 02:39:25
|
Often when I'm doing interactive prototyping I find myself wanting to check whether two arrays are sharing a copy of the same data. It seems like there ought to be a concise way to do that, but right now seems like the only way is with a little function like this: def same_base(a,b): ab = a.base if ab is None: ab = a bb = b.base if bb is None: bb = b return ab is bb is there some easier built-in way? Does the above function even cover all the bases? (so to speak...) It would be easier if a non-copy array pointed to itself as base rather than 'None'. Then you could just check a.base == b.base. --bb |
From: Bill B. <wb...@gm...> - 2006-07-06 01:03:21
|
That's the kind of thing that should maybe be on the NumpyExample list: http://www.scipy.org/Numpy_Example_List But currently little syntactical tricks like that aren't listed there. I'm not sure how you'd list that even. There is an example like that ( a[a<0.5]=0 ) on the Numpy for Matlab Users page, though. http://www.scipy.org/NumPy_for_Matlab_Users It's supposed to be for matlab users, but if you just ignore the Matlab column, the main table there is still a pretty good list of examples of numpy syntax and basic functions. --bb On 7/6/06, Mathew Yeates <my...@jp...> wrote: > > ohhhh. I was looking at using "where" > > > > Keith Goodman wrote: > > On 7/5/06, Mathew Yeates <my...@jp...> wrote: > >> What is the typical way of doing the following > >> starting with a 0 matrix, set all values to 1 when a certain condition > >> is met, set to -1 when another condition is met, left alone if neither > >> condition is met. > > > > This works on recent versions of numpy: > > > >>> x = asmatrix(zeros((2,2))) > > > >>> x > > > > matrix([[0, 0], > > [0, 0]]) > > > >>> y = asmatrix(rand(2,2)) > > > >>> y > > > > matrix([[ 0.85219404, 0.48311427], > > [ 0.41026966, 0.2184193 ]]) > > > >>> x[y > 0.5] = 1 > > > >>> x[y < 0.5] = -1 > > > >>> x > > > > matrix([[ 1, -1], > > [-1, -1]]) > > > > > 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 > -- William V. Baxter III OLM Digital Kono Dens Building Rm 302 1-8-8 Wakabayashi Setagaya-ku Tokyo, Japan 154-0023 +81 (3) 3422-3380 |
From: Tom D. <tom...@al...> - 2006-07-06 00:58:40
|
It seems from my cursory look that numpy doesn't support the pickling or the tofile of PyObject arrays. I was wondering whether such functionlity is in the pipeline or if there is little interest. Personally, I would really like to see the feature in numpy but don't know if I am up to implementing it myself. --Tom |
From: Philip A. <pa...@eo...> - 2006-07-06 00:51:13
|
Travis Oliphant writes: > b) byte-the bullet and use Boost python (which other's who have > integrated C++ code with Python seem to really like). I've never > wrapped my mind around Boost python, though, so I'm not much help there. I've updated my set of boost helper functions to work with numpy -- there's a Readme at: http://www.eos.ubc.ca/research/clouds/software/pythonlibs/num_util/num_util_release2 (http://tinyurl.com/eo6fe) A simple example which shows some of the boost python features (reference counting, C++ versions of python types, docstrings, exceptions) is appended below. When called with python script http://tinyurl.com/zy57a it produces the output http://tinyurl.com/fr7xo Regards, Phil Austin |
From: Mathew Y. <my...@jp...> - 2006-07-06 00:47:08
|
ohhhh. I was looking at using "where" Keith Goodman wrote: > On 7/5/06, Mathew Yeates <my...@jp...> wrote: >> What is the typical way of doing the following >> starting with a 0 matrix, set all values to 1 when a certain condition >> is met, set to -1 when another condition is met, left alone if neither >> condition is met. > > This works on recent versions of numpy: > >>> x = asmatrix(zeros((2,2))) > >>> x > > matrix([[0, 0], > [0, 0]]) > >>> y = asmatrix(rand(2,2)) > >>> y > > matrix([[ 0.85219404, 0.48311427], > [ 0.41026966, 0.2184193 ]]) > >>> x[y > 0.5] = 1 > >>> x[y < 0.5] = -1 > >>> x > > matrix([[ 1, -1], > [-1, -1]]) > |
From: Steve L. <lis...@ar...> - 2006-07-06 00:45:45
|
>> motivated by the lack of free documentation for NumPy, with some >> friends, we started writing a tutorial, that we would like to see in >> scipy.org. After some time, the project have started to loose its >> initial impetus. Now, we put the current unfinished version in >> >> http://www.scipy.org/Tentative_NumPy_Tutorial >> >> with the hope that, with the help of other users, it will be possible >> to build a useful document for beginners. > > I think it looks great. Agreed .. thanks for whipping that together! -steve |
From: Keith G. <kwg...@gm...> - 2006-07-06 00:45:13
|
On 7/5/06, Mathew Yeates <my...@jp...> wrote: > What is the typical way of doing the following > starting with a 0 matrix, set all values to 1 when a certain condition > is met, set to -1 when another condition is met, left alone if neither > condition is met. This works on recent versions of numpy: >> x = asmatrix(zeros((2,2))) >> x matrix([[0, 0], [0, 0]]) >> y = asmatrix(rand(2,2)) >> y matrix([[ 0.85219404, 0.48311427], [ 0.41026966, 0.2184193 ]]) >> x[y > 0.5] = 1 >> x[y < 0.5] = -1 >> x matrix([[ 1, -1], [-1, -1]]) |
From: Mathew Y. <my...@jp...> - 2006-07-06 00:37:40
|
What is the typical way of doing the following starting with a 0 matrix, set all values to 1 when a certain condition is met, set to -1 when another condition is met, left alone if neither condition is met. Mathew |
From: Keith G. <kwg...@gm...> - 2006-07-06 00:13:29
|
On 7/4/06, Pau Gargallo <pau...@gm...> wrote: > motivated by the lack of free documentation for NumPy, with some > friends, we started writing a tutorial, that we would like to see in > scipy.org. After some time, the project have started to loose its > initial impetus. Now, we put the current unfinished version in > > http://www.scipy.org/Tentative_NumPy_Tutorial > > with the hope that, with the help of other users, it will be possible > to build a useful document for beginners. I think it looks great. |
From: Bryce H. <bhe...@en...> - 2006-07-05 23:56:53
|
Enthought is pleased to announce the release of Python Enthought Edition Version 1.0.0.beta3 (http://code.enthought.com/enthon/) -- a python distribution for Windows. 1.0.0.beta3 Release Notes: -------------------- Version 1.0.0.beta3 of Python Enthought Edition is the first version based on Python 2.4.3 and includes updates to nearly every package. This is the third and (hopefully) last beta release. This release includes version 1.0.8 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.8.html About Python Enthought Edition: ------------------------------- Python 2.4.3, 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: Tim H. <tim...@co...> - 2006-07-05 22:15:04
|
Bart Vandereycken wrote: > Hi all, > > reading the thread "Ransom proposals" I was wondering why there isn't a > ndarray.dot() method? There is already a scipy.sparse.dot() so this > would fit nicely in the whole idea of polymorphism. > Are you sure about that? The problem with a dot method (aside from a over proliferation of methods in general) is that to be done correctly you want to choose a particular implementation of dot based *both* of its arguments. A method does a good job dispatching on a single argument, but falls down when dispatching on two types. Let's look at this specific case. Imagine that in addition ndarray.dot and sparse.dot, we also stick a dot method on ma.masked, etc. Now in order to fully exploit polymorphism and get maximum efficiency, we want asparsearray.dot(amaskedarray) to correctly treat the masked values (ma.dot treats them as zeros) and to not instantiate a dense version of the sparsearray. But in order to do that all three classes need to know about the other two. That's possible, if messy since all three of these are known in advance, but this approach becomes untenable if you classes outside core numpy or scipy to participate as full citizens. What does appear fit well here is generic functions / multimethods / protocols as discussed in some detail on pydev-3000 a couple of months ago. This would allow classes defined outside of core numpy and scipy to work correctly and efficiently with dot as long as they register appropriate versions of dot. If I wasn't swamped right at the moment I'd prototype this up and see how it works in practice. -tim |
From: Robert K. <rob...@gm...> - 2006-07-05 15:54:10
|
Fer...@eu... wrote: > > Hi, > > how could i get the name of an array in a string ? > (info command ?!) You can't. http://mail.python.org/pipermail/python-list/2005-June/286574.html -- 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: Alexandre F. <ale...@lo...> - 2006-07-05 15:49:35
|
On Wed, Jul 05, 2006 at 02:51:36PM +0200, ferenc pintye wrote: > Hi, >=20 > how could i get the name of an array in a string ? if by this you mean "the name of an identifier refering to [whatever]", this is a FAQ, and the answer is 1. you don't want to do that 2. your problem is not well behaved (there can be many answers to the questions) 3. you can use something along the lines of for name, item in locals().iteritems(): if item is my_array: break else: name =3D "anonymous object" --=20 Alexandre Fayolle LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations D=E9veloppement logiciel sur mesure: http://www.logilab.fr/services Informatique scientifique: http://www.logilab.fr/science |
From: ferenc p. <fer...@st...> - 2006-07-05 15:11:12
|
Hi, how could i get the name of an array in a string ? thanks f. |