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: Nadav H. <na...@vi...> - 2006-11-08 14:44:14
|
Make A,B,... matrices instead of arrays, so instead A =3D array((.....)) Write A =3D matrix((....)) =20 Assuming you had >From numpy import * =20 Nadav =20 _____ =20 From: num...@li... [mailto:num...@li...] On Behalf Of izak marais Sent: Wednesday, November 08, 2006 15:54 To: num...@li... Subject: [Numpy-discussion] matrix multiplication (newbie question) =20 Hi Sorry if this is an obvious question, but what is the easiest way to multiply matrices in numpy? Suppose I want to do A=3DB*C*D. The ' * ' operator apparently does element wise multiplication, as does the 'multiply' ufunc. All I could find was the numeric function 'matrix_multiply, but this only takes two arguments. Thanks in advance! Izak =20 _____ =20 Sponsored Link Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate - Click now to apply <http://online.degrees.info/forms/form.jsp?ADEL=3DD3sPPz6WYLD7%2FD1DxMxP%= 2 BbXooR4YcdmONmTWaUizNjh6q2wGRcnxuw%3D%3D&PI=3Dy_mail_textlink>=20 |
From: Stefan v. d. W. <st...@su...> - 2006-11-08 14:41:12
|
On Wed, Nov 08, 2006 at 05:54:17AM -0800, izak marais wrote: > Hi >=20 > Sorry if this is an obvious question, but what is the easiest way to mu= ltiply > matrices in numpy? Suppose I want to do A=3DB*C*D. The ' * ' operator a= pparently > does element wise multiplication, as does the 'multiply' ufunc. All I c= ould > find was the numeric function 'matrix_multiply, but this only takes two > arguments. You can also do N.dot(B, N.dot(C,D)). Cheers St=E9fan |
From: Keith G. <kwg...@gm...> - 2006-11-08 14:33:15
|
On 11/8/06, izak marais <iza...@ya...> wrote: > Sorry if this is an obvious question, but what is the easiest way to > multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator > apparently does element wise multiplication, as does the 'multiply' ufunc. > All I could find was the numeric function 'matrix_multiply, but this only > takes two arguments. If B and C and D are matrices, then '*' is matrix multiplication. |
From: izak m. <iza...@ya...> - 2006-11-08 13:54:33
|
Hi Sorry if this is an obvious question, but what is the easiest way to multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator apparently does element wise multiplication, as does the 'multiply' ufunc. All I could find was the numeric function 'matrix_multiply, but this only takes two arguments. Thanks in advance! Izak --------------------------------- Sponsored Link Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate - Click now to apply |
From: amit s. <ami...@ya...> - 2006-11-08 12:42:58
|
Hi, i have a file with following format: 1 2 3 9 2 3 4 4 I want to read it and then store the values into two matrices, s.t. A=[1 2;3 9] B=[2 3;4 4] Can anyone tell me how to do this in python? thanks Amit --------------------------------- Check out the all-new Yahoo! Mail - Fire up a more powerful email and get things done faster. |
From: Pierre GM <pgm...@gm...> - 2006-11-08 10:10:21
|
Michael, First of all, thanks for your interest in the exercise of style the new implementation of MaskedArray is basically nothing but. On Tuesday 07 November 2006 20:11, Michael Sorich wrote: > 1. It would be nice if the masked_singleton could be passed into a > ndarray, as this would allow it to be passed into the MaskedArray e.g. > > import numpy as N > import ma.maskedarray as MA > test = N.array([1,2,MA.masked]) > > >> ValueError: setting an array element with a sequence I like your idea, but not its implementation. If MA.masked_singleton is defined as an object, as you suggest, then the dtype of the ndarray it is passed to becomes 'object', as you pointed out, and that is not something one would naturally expec, as basic numerical functions don't work well with the 'object' dtype (just try N.sqrt(N.array([1],dtype=N.object)) to see what I mean). Even if we can construct a mask rather easily at the creation of the masked array, following your 'a==masked' suggestion, we still need to get the dtype of the non-masked section, and that doesn't seem trivial... I guess that a simple solution is to use MA.masked_values. Make sure to use a numerical value for the masked data, else you'll end up with yet another object array. > 2. What happens if a masked array is passed into a ndarray or passed > into a MaskedArray with another mask? >>> test_ma1 = MA.array([1,2,3], mask=[False, False, True]) >>> print test_ma1, N.array(test_ma1), [1 2 --] [1 2 3] >>> MA.array(test_ma1, mask=[True, False, False]) [-- 2 3] Let me precise that my objective was to get an implementation as close to the original numpy.core.ma as possible, for 'backward compatibility'. I'm not sure it'd be wise to change it at this point, but that could be discussed. As you've noticed, when creating a new masked array from an existing one, the 'mask' argument supersedes the initial mask. That's ideal when you want to focus on a fraction of the initial data: you just mask what you don't need, and are still able to retrieve it when you need it. I agree that this default behavior is a bit strange when you have missing data: in that case, one would expect the new mask to be a combination of the 'mask' argument and the old mask. A possibility would then be to add a 'keep_mask' flag: a default of False would give the current behavior, a value of True would force the new mask to be a combination. I think that feelings are mixed on that list about extra flags, but the users of maskedarray are only a minority anyway (hopefully, only for the moment). About the conversion to ndarray: By default, the result should have the same dtype as the _data section. For this reason, I disagree with your idea of "(returning) an object ndarray with the missing value containing the masked singleton". If you really want an object ndarray, you can use the filled method or the filled function, with your own definition of the filling value (such as your MaskedScalar). |
From: Fernando P. <fpe...@gm...> - 2006-11-08 08:32:46
|
Hi all, in the past, Arnd Baecker has made a number of very useful posts on this matter, and provided some nice utilities to do it. I now needed to profile some fairly complex codes prior to a big optimization push, so I went over his material and wrote a little tool to make the whole process as painless as possible. Here it is, hoping others may find it useful: http://amath.colorado.edu/faculty/fperez/python/profiling/ Cheers, f |
From: David C. <da...@ar...> - 2006-11-08 03:08:11
|
Josh Marshall wrote: > Hi David, > > Did you have a look at mlabwrap? It's quite hard to find on the net, > which is a shame, since it is a much more up to date version, > enhancing pymat with the things that you are trying to do. It allows > passing arrays and getting arrays back. > > http://mlabwrap.sourceforge.net/ > I didn't know that, thanks. Unfortunately, it is not really what I am trying to do: mlabwrap is just a python interface a bit more high level than pymat, with many fancy tricks, but still do copies. What I would like is to avoid completely the copying by using proxy classes around data from numpy so that I can pass "automatically" numpy arrays to matlab C api, and a proxy class around data from matlab so that they look like numpy arrays. I don't care that much about the actual api from python point of view, because I intend to use this mainly to compare matlab vs numpy implementation, not as a way to use matlab inside python regularly. And once the copy problem is solved, adding syntactic sugar using python is easy anyway, I think (it should be easy to do something similar to mlabwrap at that point), cheers, David |
From: David C. <da...@ar...> - 2006-11-08 02:44:29
|
Pauli Virtanen wrote: > Hi all, > > ti, 2006-11-07 kello 11:23 +0900, David Cournapeau kirjoitti: > >> I am trying to find a nice way to communicate between matlab and >> python. I am aware of pymat, which does that, but the code is >> deprecated, and I thing basing the code on ctypes would lead to much >> more robust code. >> >> http://claymore.engineer.gvsu.edu/%7Esteriana/Software/pymat.html >> >> I have a really simple prototype which can send and get back data from >> matlab, but I was wondering if it would be possible to use a scheme >> similar to ctypes instead of having to convert it by hand. >> > > A while ago I wrote a mex extension to embed the Python interpreter > inside Matlab: > > http://www.iki.fi/pav/pythoncall > > I guess it's something like an inverse of pymat :) > > Yes, but at the end, I think they enable similar things. Thanks for the link ! > But I guess this is not really what you are looking for, since at > present it just does a memory copy when passing arrays between Matlab > and Python. Though, shared arrays might be just possible to implement if > memory management is done carefully. > In my case, it is much worse: 1 first, you have numpy data that you have to copy to mxArray, the structure representing arrays in matlab C api. 2 then when you "send" data to the matlab engine, this is done automatically through pipe by the matlab engine API (maybe pipe does not imply copying; I don't know much about pipe from a programming point of view, actually) 3 The arrays you get back from matlab are in matlab mxArray structures: right now, I copy their data to new numpy arrays. At first, I just developed a prototype without thinking too much, and the result was much slower than I thought: sending a numpy with 2e5x10 double takes around 100 ms on my quite powerful machine (around 14 cycles per item for the best case). I suspect it is because I copy memory in a non contiguous manner (matlab arrays have a internal F storage for real arrays, but complex arrays are really two different arrays, which is different than Fortran convention I think, making the copy cost really expensive for complex arrays). To see if I was doing something wrong, I compared with numpy.require(ar, requirements = 'F_CONTIGUOUS'), which is even much slower There is not much I can do about 2, it looks like there is a way to avoid copying for 1, and my question was more specific to 3 (but reusable in 1, maybe, if I am smart enough). Basically: * how to create an object which has the same interface than numpy arrays, but owns the data from a foreign structure, which data are availble when building the object (The idea was to create a class which implements the array interface from python, kind of proxy class, which owns the data from mxArray; owns here is from a memory management point of view). David |
From: Travis O. <oli...@ee...> - 2006-11-08 02:01:37
|
Christopher Barker wrote: >Hi all, > >I'm using a recarray to read a bunch of binary data out of a file. It's >working great, but it seems there should be a more efficient way to >"slice" the data. Here's what I've got: > >The binary data is essentially a dump of a 2-d array of structs. So I >read it like this: > >DataType = N.dtype([("long","i4"), ("lat", "i4"), ("flag","b1")]) > >data = N.fromfile(file, DataType) > >data.shape = (M, N) > >So I now have a MxN array of the structs. What I would like to do is >extract a MxNx2 array of just the two 4-byte integers. It seems that I >should be able to do that without copying -- by using a view into the >original data. I can't figure out how, however. What I am doing is: > >LEs = N.empty((M, N, 2), dtype=N.int32) >LEs[:,:,0] = data['long'] >LEs[:,:,1] = data['lat'] > >This works, but these are BIG files, so it would be nice not to be doing >that extra copying. Is that possible? > > How about newdtype = N.dtype([('both','2i4'),('','b1')]) res = data.view(newdtype)['both'] -Travis |
From: Michael S. <mic...@gm...> - 2006-11-08 01:11:31
|
On 10/25/06, Pierre GM <pgm...@gm...> wrote: > On Tuesday 24 October 2006 02:50, Michael Sorich wrote: > > I am currently running numpy rc2 (I haven't tried your > > reimplementation yet as I am still using python 2.3). I am wondering > > whether the new maskedarray is able to handle construction of arrays > > from masked scalar values (not sure if this is the correct term). > > The answer is no, unfortunately: both the new and old implementations fail at > the same point, raising a TypeError: lists are processed through > numpy.core.numeric.array, which doesn't handle that. I have finally gotten around to upgrading to python 2.4 and have had a chance to play with your new version of the MaskedArray. It is great to see that someone is working on this. I have a few thoughts on masked arrays that may or may no warrant discusion 1. It would be nice if the masked_singleton could be passed into a ndarray, as this would allow it to be passed into the MaskedArray e.g. import numpy as N import ma.maskedarray as MA test = N.array([1,2,MA.masked]) >> ValueError: setting an array element with a sequence If the masked_singleton was implemented as an object that is not a MakedArray (which is a sequence that numpy.array chokes on), then a valid numpy array with an object dtype could be produced. e.g. class MaskedScalar: def __str__(self): return 'masked' masked = MaskedScalar() test = N.array([1,2,masked]) print test.dtype, test >>object [1 2 masked] print test == masked >>[False False True] print test[2] == masked >>True print test[2] is masked >>True Then it would be possible to alternatively define a masked array as MA.array([1,2,masked]) or MA.array(N.array([1,2,masked])). In the __init__ of the MaskedArray if the ndarray has an object dtype simply calculate the mask from a==masked. 2. What happens if a masked array is passed into a ndarray or passed into a MaskedArray with another mask? test_ma1 = MA.array([1,2,3], mask=[False, False, True]) print test_ma1 >>[1 2 --] print N.array(test_ma1) >>[1 2 3] test_ma2 = MA.array(test_ma1, mask=[True, False, False]) print test_ma2 >>[-- 2 3] I suppose it depends on whether you are masking useful data, or the masks represent missing data. In the former it may make sense to change or remove the mask. However in the latter case the original data entered is a bogus value which should never be unmasked. In this case, when converting to a ndarray I think it make more sense to make an object ndarray with the missing value containing the masked singleton. Additionally, if the MaskedArray is holding missing data, it does not make much sense to be able to pass in to the MA constructor both an existing ma and a mask. |
From: Christopher B. <Chr...@no...> - 2006-11-08 00:54:02
|
Hi all, I'm using a recarray to read a bunch of binary data out of a file. It's working great, but it seems there should be a more efficient way to "slice" the data. Here's what I've got: The binary data is essentially a dump of a 2-d array of structs. So I read it like this: DataType = N.dtype([("long","i4"), ("lat", "i4"), ("flag","b1")]) data = N.fromfile(file, DataType) data.shape = (M, N) So I now have a MxN array of the structs. What I would like to do is extract a MxNx2 array of just the two 4-byte integers. It seems that I should be able to do that without copying -- by using a view into the original data. I can't figure out how, however. What I am doing is: LEs = N.empty((M, N, 2), dtype=N.int32) LEs[:,:,0] = data['long'] LEs[:,:,1] = data['lat'] This works, but these are BIG files, so it would be nice not to be doing that extra copying. Is that possible? Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Bill B. <wb...@gm...> - 2006-11-07 23:41:44
|
dstack maybe? or does that add a dim on the other end? --bb On 11/8/06, Christopher Barker <Chr...@no...> wrote: > > HI all, > > I'm trying to get the hang of this new r_ and c_ stuff. > > I need to take two MxN arrays, and stack them together into one MxNx2 > arrays. I found this works: > > >>> a = N.ones((3,4)) > >>> b = N.ones((3,4)) * 2 > >>> a > array([[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]]) > >>> b > array([[ 2., 2., 2., 2.], > [ 2., 2., 2., 2.], > [ 2., 2., 2., 2.]]) > >>> a.shape = (3,4,1) > >>> b.shape = (3,4,1) > >>> c = N.c_[a,b] > >>> c.shape > (3, 4, 2) > >>> c[0,0] > array([ 1., 2.]) > > > What I'm wondering is if there is a way to do that without explicitly > adding the extra dimension to a and b before calling c_ ? > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > > ------------------------------------------------------------------------- > 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: Pau G. <pau...@gm...> - 2006-11-07 22:15:11
|
On 11/7/06, Christopher Barker <Chr...@no...> wrote: > HI all, > > I'm trying to get the hang of this new r_ and c_ stuff. > > I need to take two MxN arrays, and stack them together into one MxNx2 > arrays. I found this works: > > >>> a = N.ones((3,4)) > >>> b = N.ones((3,4)) * 2 > >>> a > array([[ 1., 1., 1., 1.], > [ 1., 1., 1., 1.], > [ 1., 1., 1., 1.]]) > >>> b > array([[ 2., 2., 2., 2.], > [ 2., 2., 2., 2.], > [ 2., 2., 2., 2.]]) > >>> a.shape = (3,4,1) > >>> b.shape = (3,4,1) > >>> c = N.c_[a,b] > >>> c.shape > (3, 4, 2) > >>> c[0,0] > array([ 1., 2.]) > > > What I'm wondering is if there is a way to do that without explicitly > adding the extra dimension to a and b before calling c_ ? > c=N.dstack([a,b]) seems to do the trick. pau > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > > ------------------------------------------------------------------------- > 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-11-07 20:39:12
|
Ivan Vilata i Balaguer wrote: [SNIP] > > Though I admit it may be strange for this error to be triggered. > > (I had a little mess with using ``expressions.ExpressionNode`` instead > of ``expr.ExpressionNode``... I still don't see why the private copy of > the module is necessary.) > > It's an attempt to make things thread safe. Since we are mucking around with the internals of the expression module, if there were multiple threads one might thread might change get_context out from under the other one. Giving each call to stringToExpression its own copy of the expression module prevents this. It is, admittedly, a kind of stupid way to do this. A more sane thing to do would probably to have some sort of expression object that we instantiate for each call to stringToExpression instead of mucking around with modules, which really aren't meant to be (ab)used this way. However, this would require a major rewrite of the expression module and I was feeling lazy at the time (and still am), so I resorted to questionable hackery. -tim |
From: Pauli V. <pau...@ik...> - 2006-11-07 19:00:49
|
Hi all, ti, 2006-11-07 kello 11:23 +0900, David Cournapeau kirjoitti: > I am trying to find a nice way to communicate between matlab and=20 > python. I am aware of pymat, which does that, but the code is=20 > deprecated, and I thing basing the code on ctypes would lead to much=20 > more robust code. >=20 > http://claymore.engineer.gvsu.edu/%7Esteriana/Software/pymat.html >=20 > I have a really simple prototype which can send and get back data from=20 > matlab, but I was wondering if it would be possible to use a scheme=20 > similar to ctypes instead of having to convert it by hand. A while ago I wrote a mex extension to embed the Python interpreter inside Matlab: http://www.iki.fi/pav/pythoncall I guess it's something like an inverse of pymat :) But I guess this is not really what you are looking for, since at present it just does a memory copy when passing arrays between Matlab and Python. Though, shared arrays might be just possible to implement if memory management is done carefully. BR, Pauli Virtanen |
From: Matthew B. <mat...@gm...> - 2006-11-07 18:57:26
|
Hi, > Thank you very much, I think this added documentation is pretty recent; > I have never seen it before, and I did a lot a mex programming at some > point... This whole mxarray nonsense reminds me why I gave up on matlab :), I would be very happy to help with this. It would be great if we could get a standard well-maintained library of some sort towards scipy - we (http://neuroimaging.scipy.org/) have a great deal of matlab integration to do. Best, Matthew |
From: Christopher B. <Chr...@no...> - 2006-11-07 18:57:12
|
HI all, I'm trying to get the hang of this new r_ and c_ stuff. I need to take two MxN arrays, and stack them together into one MxNx2 arrays. I found this works: >>> a = N.ones((3,4)) >>> b = N.ones((3,4)) * 2 >>> a array([[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]]) >>> b array([[ 2., 2., 2., 2.], [ 2., 2., 2., 2.], [ 2., 2., 2., 2.]]) >>> a.shape = (3,4,1) >>> b.shape = (3,4,1) >>> c = N.c_[a,b] >>> c.shape (3, 4, 2) >>> c[0,0] array([ 1., 2.]) What I'm wondering is if there is a way to do that without explicitly adding the extra dimension to a and b before calling c_ ? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Ivan V. i B. <iv...@ca...> - 2006-11-07 17:20:19
|
This is somehow related with this previous thread about raising ``TypeError`` on unsupported objects in Numexpr: http://www.mail-archive.com/num...@li.../msg03146.html There is still a case where unsupported objects can get into expressions without Numexpr noticing. For instance: >>> import numexpr >>> numexpr.evaluate('[]') Traceback (most recent call last): File "<stdin>", line 1, in ? File "numexpr/compiler.py", line 594, in evaluate _names_cache[expr_key] = getExprNames(ex, context) File "numexpr/compiler.py", line 570, in getExprNames ast = expressionToAST(ex) File "numexpr/compiler.py", line 84, in expressionToAST this_ast = ASTNode(ex.astType, ex.astKind, ex.value, AttributeError: 'list' object has no attribute 'astType' The attached patch makes the error clearer and more consistent with the error added in the aforementioned thread: >>> import numpy >>> import numexpr >>> numexpr.evaluate('[]') Traceback (most recent call last): File "<stdin>", line 1, in ? File "numexpr/compiler.py", line 596, in evaluate _names_cache[expr_key] = getExprNames(ex, context) File "numexpr/compiler.py", line 571, in getExprNames ex = stringToExpression(text, {}, context) File "numexpr/compiler.py", line 229, in stringToExpression raise TypeError("unsupported expression type: %s" % type(ex)) TypeError: unsupported expression type: <type 'list'> Though I admit it may be strange for this error to be triggered. (I had a little mess with using ``expressions.ExpressionNode`` instead of ``expr.ExpressionNode``... I still don't see why the private copy of the module is necessary.) :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ Cárabos Coop. V. V V Enjoy Data "" |
From: IV <iva...@gm...> - 2006-11-07 15:37:38
|
Dear All, has anyone successfully install numpy-1.0 on irix 6.5? The GCC is 3.3 and is the latest from freeware.sgi.com. Building gcc 4.1.1 from source did not work for me, and I am afraid to force it. Latest Python 2.5 installed fine from source. Numpy gives this error(s): $ python setup.py install Running from numpy source directory. F2PY Version 2_3396 blas_opt_info: blas_mkl_info: libraries mkl,vml,guide not found in /usr/local/lib NOT AVAILABLE atlas_blas_threads_info: Setting PTATLAS=ATLAS libraries lapack,blas not found in /usr/local/lib NOT AVAILABLE atlas_blas_info: libraries lapack,blas not found in /usr/local/lib NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1301: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.__doc__) blas_info: libraries blas not found in /usr/local/lib NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1310: UserWarning: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. warnings.warn(BlasNotFoundError.__doc__) blas_src_info: NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1313: UserWarning: Blas (http://www.netlib.org/blas/) sources not found. Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [blas_src]) or by setting the BLAS_SRC environment variable. warnings.warn(BlasSrcNotFoundError.__doc__) NOT AVAILABLE lapack_opt_info: lapack_mkl_info: mkl_info: libraries mkl,vml,guide not found in /usr/local/lib NOT AVAILABLE NOT AVAILABLE atlas_threads_info: Setting PTATLAS=ATLAS libraries lapack,blas not found in /usr/local/lib libraries lapack_atlas not found in /usr/local/lib numpy.distutils.system_info.atlas_threads_info NOT AVAILABLE atlas_info: libraries lapack,blas not found in /usr/local/lib libraries lapack_atlas not found in /usr/local/lib numpy.distutils.system_info.atlas_info NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1210: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.__doc__) lapack_info: libraries lapack not found in /usr/local/lib NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1221: UserWarning: Lapack (http://www.netlib.org/lapack/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [lapack]) or by setting the LAPACK environment variable. warnings.warn(LapackNotFoundError.__doc__) lapack_src_info: NOT AVAILABLE /usr/people/ivan/numpy-1.0/numpy/distutils/system_info.py:1224: UserWarning: Lapack (http://www.netlib.org/lapack/) sources not found. Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [lapack_src]) or by setting the LAPACK_SRC environment variable. warnings.warn(LapackSrcNotFoundError.__doc__) NOT AVAILABLE running install running build running config_fc running build_src building py_modules sources building extension "numpy.core.multiarray" sources Generating build/src.irix64-6.5-2.5/numpy/core/config.h customize MipsFCompiler customize MipsFCompiler customize MipsFCompiler using config C compiler: gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -shared compile options: '-I/usr/local/include/python2.5 -Inumpy/core/src -Inumpy/core/include -I/usr/local/include/python2.5 -c' gcc: _configtest.c gcc _configtest.o -L/usr/local/lib -L/usr/lib -o _configtest ld32: FATAL 12 : Expecting n32 objects: /usr/lib/libc.so is o32. collect2: ld returned 4 exit status ld32: FATAL 12 : Expecting n32 objects: /usr/lib/libc.so is o32. collect2: ld returned 4 exit status failure. removing: _configtest.c _configtest.o numpy/core/setup.py:50: DeprecationWarning: raising a string exception is deprecated raise "ERROR: Failed to test configuration" Traceback (most recent call last): File "setup.py", line 89, in <module> setup_package() File "setup.py", line 82, in setup_package configuration=configuration ) File "/usr/people/ivan/numpy-1.0/numpy/distutils/core.py", line 174, in setup return old_setup(**new_attr) File "/usr/local/lib/python2.5/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/local/lib/python2.5/distutils/dist.py", line 974, in run_commands self.run_command(cmd) File "/usr/local/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/usr/people/ivan/numpy-1.0/numpy/distutils/command/install.py", line 16, in run r = old_install.run(self) File "/usr/local/lib/python2.5/distutils/command/install.py", line 506, in run self.run_command('build') File "/usr/local/lib/python2.5/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/local/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/usr/local/lib/python2.5/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/local/lib/python2.5/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/local/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/usr/people/ivan/numpy-1.0/numpy/distutils/command/build_src.py", line 87, in run self.build_sources() File "/usr/people/ivan/numpy-1.0/numpy/distutils/command/build_src.py", line 106, in build_sources self.build_extension_sources(ext) File "/usr/people/ivan/numpy-1.0/numpy/distutils/command/build_src.py", line 212, in build_extension_sources sources = self.generate_sources(sources, ext) File "/usr/people/ivan/numpy-1.0/numpy/distutils/command/build_src.py", line 270, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 50, in generate_config_h raise "ERROR: Failed to test configuration" ERROR: Failed to test configuration Please advise :) |
From: Emanuele O. <oli...@it...> - 2006-11-07 13:29:21
|
Hi all, do you know if numpy/Numeric is available on WinCE ? I'm thinking about the use of a numpy/Numeric app on a palmtop and I'm not sure it will be deployed on linux only devices. Thanks in advance, Emanuele P.S.: I know that Python is available on many many platforms, but I not so confident about many external libraries. |
From: David C. <da...@ar...> - 2006-11-07 05:53:58
|
Andrew Straw wrote: > David Cournapeau wrote: > >> Andrew Straw wrote: >> >> >>> David Cournapeau wrote: >>> >>> >>> >>>> - To send data from the calling process to matlab, you first have to >>>> create a mxArray, which is the basic matlab handler of a matlab array, >>>> and populating it. Using mxArray is very ackward : you cannot create >>>> mxArray from existing data, you have to copy data to them, etc... >>>> >>>> >>>> >>> My understanding, never having done it, but from reading the docs, is >>> that you can create a "hybrid array" where you manage the memory. Thus, >>> you can create an mxArray from existing data. However, the docs >>> basically say that this is too hard for most mortals (and they may well >>> be right -- too painful for me, anyway)! >>> >>> >>> >> Would you mind telling me where you found that information ? Because >> right now, I am wasting a lot of cycles because of memory copy in both >> directions, and it is sometimes slow enough so that it is annoying, >> >> > I found it reading through the in-program help (the C-API section, > whatever it's called) on a Matlab installation at my university. I guess > this was Matlab 2006A. A quick Google search turns this up: > > http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/index.html?/access/helpdesk/help/techdoc/matlab_external/f25255.html > > They give the following example, which seems to create a Matlab array > "pArray" with data owned by the C variable "data": > > mxArray *pArray = mxCreateDoubleMatrix(0, 0, mxREAL); > double data[10]; > > mxSetPr(pArray, data); > mxSetM(pArray, 1); > mxSetN(pArray, 10); > Thank you very much, I think this added documentation is pretty recent; I have never seen it before, and I did a lot a mex programming at some point... This whole mxarray nonsense reminds me why I gave up on matlab :), cheers, David |
From: Andrew S. <str...@as...> - 2006-11-07 05:43:15
|
David Cournapeau wrote: > Andrew Straw wrote: > >> David Cournapeau wrote: >> >> >>> - To send data from the calling process to matlab, you first have to >>> create a mxArray, which is the basic matlab handler of a matlab array, >>> and populating it. Using mxArray is very ackward : you cannot create >>> mxArray from existing data, you have to copy data to them, etc... >>> >>> >> My understanding, never having done it, but from reading the docs, is >> that you can create a "hybrid array" where you manage the memory. Thus, >> you can create an mxArray from existing data. However, the docs >> basically say that this is too hard for most mortals (and they may well >> be right -- too painful for me, anyway)! >> >> > Would you mind telling me where you found that information ? Because > right now, I am wasting a lot of cycles because of memory copy in both > directions, and it is sometimes slow enough so that it is annoying, > I found it reading through the in-program help (the C-API section, whatever it's called) on a Matlab installation at my university. I guess this was Matlab 2006A. A quick Google search turns this up: http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/index.html?/access/helpdesk/help/techdoc/matlab_external/f25255.html They give the following example, which seems to create a Matlab array "pArray" with data owned by the C variable "data": mxArray *pArray = mxCreateDoubleMatrix(0, 0, mxREAL); double data[10]; mxSetPr(pArray, data); mxSetM(pArray, 1); mxSetN(pArray, 10); |
From: Fran K. <bu...@ca...> - 2006-11-07 05:28:48
|
Hi, PHAjjRMACY for LESS http://www.mitujunhertshieasde.com =20 Your slightest wish is our command. |
From: David C. <da...@ar...> - 2006-11-07 05:00:46
|
Andrew Straw wrote: > David Cournapeau wrote: > >> - To send data from the calling process to matlab, you first have to >> create a mxArray, which is the basic matlab handler of a matlab array, >> and populating it. Using mxArray is very ackward : you cannot create >> mxArray from existing data, you have to copy data to them, etc... >> > My understanding, never having done it, but from reading the docs, is > that you can create a "hybrid array" where you manage the memory. Thus, > you can create an mxArray from existing data. However, the docs > basically say that this is too hard for most mortals (and they may well > be right -- too painful for me, anyway)! > Would you mind telling me where you found that information ? Because right now, I am wasting a lot of cycles because of memory copy in both directions, and it is sometimes slow enough so that it is annoying, cheers, David |