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: Fernando P. <fpe...@gm...> - 2006-08-29 19:11:53
|
On 8/29/06, Charles R Harris <cha...@gm...> wrote: > Speaking of features, I wonder if more of the methods should return > references. For instance, it might be nice to write something like: > > a.sort().searchsorted([...]) > > instead of making two statements out of it. +1 for more 'return self' at the end of methods which currently don't return anything (well, we get the default None), as long as it's sensible. I really like this 'message chaining' style of programming, and it annoys me that much of the python stdlib gratuitously prevents it by NOT returning self in places where it would be a perfectly sensible thing to do. I find it much cleaner to write x = foo.bar().baz(param).frob() than foo.bar() foo.baz(param) x = foo.frob() but perhaps others disagree. Cheers, f |
From: Charles R H. <cha...@gm...> - 2006-08-29 19:06:41
|
Hi Travis, On 8/29/06, Travis Oliphant <oli...@ie...> wrote: > > > Hi all, > > Classes start for me next Tuesday, and I'm teaching a class for which I > will be using NumPy / SciPy extensively. I need to have a release of > these two (and hopefully matplotlib) that work with each other. > > Therefore, I'm going to make a 1.0b5 release of NumPy over the weekend > (probably Monday), and also get a release of SciPy out as well. At that > point, I'll only be available for bug-fixes to 1.0. Therefore, the next > release after 1.0b5 I would like to be 1.0rc1 (release-candidate 1). > > To facilitate that, after 1.0b5 there will be a feature-freeze (except > for in the compatibility modules and the alter_code scripts which can > still be modified to ease the transition burden). Speaking of features, I wonder if more of the methods should return references. For instance, it might be nice to write something like: a.sort().searchsorted([...]) instead of making two statements out of it. The 1.0rc1 release of NumPy will be mid September I suspect. > > Also, I recognize that the default-axis switch is a burden for those who > have already transitioned code to use NumPy (for those just starting out > it's not a big deal because of the compatibility layer). I am curious as to why you made this switch. Not complaining, mind. Chuck |
From: Alan G I. <ai...@am...> - 2006-08-29 19:05:23
|
You can get some speed up for numeric data: def list2index2(L): aL =3D asarray(L) eL =3D empty_like(L) for v,k in enumerate(set(L)): =09eL[aL =3D=3D k] =3D v return numpy.asmatrix(eL).T fwiw, Alan Isaac |
From: Torgil S. <tor...@gm...> - 2006-08-29 19:00:00
|
def list2index(L): idx=dict((y,x) for x,y in enumerate(set(L))) return asmatrix(fromiter((idx[x] for x in L),dtype=int)) # old $ python test.py Numbers: 29.4062280655 seconds Characters: 84.6239070892 seconds Dates: 117.560418844 seconds # new $ python test.py Numbers: 1.79700994492 seconds Characters: 1.6025249958 seconds Dates: 1.7974088192 seconds 16, 52 and 100 times faster //Torgil On 8/29/06, Keith Goodman <kwg...@gm...> wrote: > I have a very long list that contains many repeated elements. The > elements of the list can be either all numbers, or all strings, or all > dates [datetime.date]. > > I want to convert the list into a matrix where each unique element of > the list is assigned a consecutive integer starting from zero. > > I've done it by brute force below. Any tips for making it faster? (5x > would make it useful; 10x would be a dream.) > > >> list2index.test() > Numbers: 5.84955787659 seconds > Characters: 24.3192870617 seconds > Dates: 39.288228035 seconds > > > import datetime, time > from numpy import nan, asmatrix, ones > > def list2index(L): > > # Find unique elements in list > uL = dict.fromkeys(L).keys() > > # Convert list to matrix > L = asmatrix(L).T > > # Initialize return matrix > idx = nan * ones((L.size, 1)) > > # Assign numbers to unique L values > for i, uLi in enumerate(uL): > idx[L == uLi,:] = i > > def test(): > > L = 5000*range(255) > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Numbers:', t2-t1, 'seconds' > > L = 5000*[chr(z) for z in range(255)] > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Characters:', t2-t1, 'seconds' > > d = datetime.date > step = datetime.timedelta > L = 5000*[d(2006,1,1)+step(z) for z in range(255)] > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Dates:', t2-t1, 'seconds' > > ------------------------------------------------------------------------- > 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-08-29 18:57:42
|
Hi all, Classes start for me next Tuesday, and I'm teaching a class for which I will be using NumPy / SciPy extensively. I need to have a release of these two (and hopefully matplotlib) that work with each other. Therefore, I'm going to make a 1.0b5 release of NumPy over the weekend (probably Monday), and also get a release of SciPy out as well. At that point, I'll only be available for bug-fixes to 1.0. Therefore, the next release after 1.0b5 I would like to be 1.0rc1 (release-candidate 1). To facilitate that, after 1.0b5 there will be a feature-freeze (except for in the compatibility modules and the alter_code scripts which can still be modified to ease the transition burden). The 1.0rc1 release of NumPy will be mid September I suspect. Also, I recognize that the default-axis switch is a burden for those who have already transitioned code to use NumPy (for those just starting out it's not a big deal because of the compatibility layer). As a result, I've added a module called fix_default_axis whose converttree method will walk a hierarchy and change all .py files to fix the default axis problem in those files. This can be done in one of two ways (depending on the boolean argument import_change). If import_change is False a) Add and axis=<olddefault> keyword argument to any function whose default changed in 1.0b2 or 1.0b3, which does not already have the axis argument --- this method does not distinguish where the function came from and so can do the wrong thing with similarly named functions from other modules (.e.g. builtin sum and itertools.repeat). If import_change is True b) Change the location where the function is imported from numpy to numpy.oldnumeric where the default axis is the same as before. This approach looks for several flavors of the import statement and alters the import location for any function whose default axis argument changed --- this can get confused if you use from numpy import sum as mysum --- it will not replace that usage of sum. I used this script on the scipy tree in mode a) as a test (followed by a manual replacement of all? incorrect substitutions). I hope it helps. I know it's annoying to have such things change. But, it does make NumPy much more consistent with respect to the default axis argument. With a few exceptions (concatenate, diff, trapz, split, array_split), the rule is that you need to specify the axis if there is more than 1 dimension or it will ravel the input. -Travis |
From: Tim H. <tim...@ie...> - 2006-08-29 18:48:28
|
Tim Hochberg wrote: > Keith Goodman wrote: > >> I have a very long list that contains many repeated elements. The >> elements of the list can be either all numbers, or all strings, or all >> dates [datetime.date]. >> >> I want to convert the list into a matrix where each unique element of >> the list is assigned a consecutive integer starting from zero. >> >> > If what you want is that the first unique element get's zero, the second > one, I don't think the code below will work in general since the dict > does not preserve order. You might want to look at the results for the > character case to see what I mean. If you're looking for something else, > you'll need to elaborate a bit. Since list2index doesn't return > anything, it's not entirely clear what the answer consists of. Just idx? > Idx plus uL? > > >> I've done it by brute force below. Any tips for making it faster? (5x >> would make it useful; 10x would be a dream.) >> >> > Assuming I understand what you're trying to do, this might help: > > def list2index2(L): > idx = ones([len(L)]) > map = {} > for i, x in enumerate(L): > index = map.get(x) > if index is None: > map[x] = index = len(map) > idx[i] = index > return idx > > > It's almost 10x faster for numbers and about 40x faster for characters > and dates. However it produces different results from list2index in the > second two cases. That may or may not be a good thing depending on what > you're really trying to do. > Ugh! I fell victim to premature optimization disease. The following is both clearer and faster: Sigh. def list2index3(L): idx = ones([len(L)]) map = {} for i, x in enumerate(L): if x not in map: map[x] = len(map) idx[i] = map[x] return idx > -tim > > >> >> >>>> list2index.test() >>>> >>>> >> Numbers: 5.84955787659 seconds >> Characters: 24.3192870617 seconds >> Dates: 39.288228035 seconds >> >> >> import datetime, time >> from numpy import nan, asmatrix, ones >> >> def list2index(L): >> >> # Find unique elements in list >> uL = dict.fromkeys(L).keys() >> >> # Convert list to matrix >> L = asmatrix(L).T >> >> # Initialize return matrix >> idx = nan * ones((L.size, 1)) >> >> # Assign numbers to unique L values >> for i, uLi in enumerate(uL): >> idx[L == uLi,:] = i >> >> def test(): >> >> L = 5000*range(255) >> t1 = time.time() >> idx = list2index(L) >> t2 = time.time() >> print 'Numbers:', t2-t1, 'seconds' >> >> L = 5000*[chr(z) for z in range(255)] >> t1 = time.time() >> idx = list2index(L) >> t2 = time.time() >> print 'Characters:', t2-t1, 'seconds' >> >> d = datetime.date >> step = datetime.timedelta >> L = 5000*[d(2006,1,1)+step(z) for z in range(255)] >> t1 = time.time() >> idx = list2index(L) >> t2 = time.time() >> print 'Dates:', t2-t1, 'seconds' >> >> ------------------------------------------------------------------------- >> 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 >> >> >> >> > > > > ------------------------------------------------------------------------- > 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-08-29 18:40:24
|
Keith Goodman wrote: > I have a very long list that contains many repeated elements. The > elements of the list can be either all numbers, or all strings, or all > dates [datetime.date]. > > I want to convert the list into a matrix where each unique element of > the list is assigned a consecutive integer starting from zero. > If what you want is that the first unique element get's zero, the second one, I don't think the code below will work in general since the dict does not preserve order. You might want to look at the results for the character case to see what I mean. If you're looking for something else, you'll need to elaborate a bit. Since list2index doesn't return anything, it's not entirely clear what the answer consists of. Just idx? Idx plus uL? > I've done it by brute force below. Any tips for making it faster? (5x > would make it useful; 10x would be a dream.) > Assuming I understand what you're trying to do, this might help: def list2index2(L): idx = ones([len(L)]) map = {} for i, x in enumerate(L): index = map.get(x) if index is None: map[x] = index = len(map) idx[i] = index return idx It's almost 10x faster for numbers and about 40x faster for characters and dates. However it produces different results from list2index in the second two cases. That may or may not be a good thing depending on what you're really trying to do. -tim > >>> list2index.test() >>> > Numbers: 5.84955787659 seconds > Characters: 24.3192870617 seconds > Dates: 39.288228035 seconds > > > import datetime, time > from numpy import nan, asmatrix, ones > > def list2index(L): > > # Find unique elements in list > uL = dict.fromkeys(L).keys() > > # Convert list to matrix > L = asmatrix(L).T > > # Initialize return matrix > idx = nan * ones((L.size, 1)) > > # Assign numbers to unique L values > for i, uLi in enumerate(uL): > idx[L == uLi,:] = i > > def test(): > > L = 5000*range(255) > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Numbers:', t2-t1, 'seconds' > > L = 5000*[chr(z) for z in range(255)] > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Characters:', t2-t1, 'seconds' > > d = datetime.date > step = datetime.timedelta > L = 5000*[d(2006,1,1)+step(z) for z in range(255)] > t1 = time.time() > idx = list2index(L) > t2 = time.time() > print 'Dates:', t2-t1, 'seconds' > > ------------------------------------------------------------------------- > 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: Keith G. <kwg...@gm...> - 2006-08-29 17:57:35
|
I have a very long list that contains many repeated elements. The elements of the list can be either all numbers, or all strings, or all dates [datetime.date]. I want to convert the list into a matrix where each unique element of the list is assigned a consecutive integer starting from zero. I've done it by brute force below. Any tips for making it faster? (5x would make it useful; 10x would be a dream.) >> list2index.test() Numbers: 5.84955787659 seconds Characters: 24.3192870617 seconds Dates: 39.288228035 seconds import datetime, time from numpy import nan, asmatrix, ones def list2index(L): # Find unique elements in list uL = dict.fromkeys(L).keys() # Convert list to matrix L = asmatrix(L).T # Initialize return matrix idx = nan * ones((L.size, 1)) # Assign numbers to unique L values for i, uLi in enumerate(uL): idx[L == uLi,:] = i def test(): L = 5000*range(255) t1 = time.time() idx = list2index(L) t2 = time.time() print 'Numbers:', t2-t1, 'seconds' L = 5000*[chr(z) for z in range(255)] t1 = time.time() idx = list2index(L) t2 = time.time() print 'Characters:', t2-t1, 'seconds' d = datetime.date step = datetime.timedelta L = 5000*[d(2006,1,1)+step(z) for z in range(255)] t1 = time.time() idx = list2index(L) t2 = time.time() print 'Dates:', t2-t1, 'seconds' |
From: Charles R H. <cha...@gm...> - 2006-08-29 17:32:57
|
Hi All, I've finished moving all the docstrings in arraymethods to add_newdocs. Much of the documentation is still incomplete and needs nicer formatting, so if you are so inclined, or even annoyed with some of the help messages, feel free to fix things up. Chuck |
From: <kor...@id...> - 2006-08-29 17:18:44
|
>Hi, Travis >I can pack my scripts into an executable with py2exe, but errors occur >once it runs: >No scipy-style subpackage 'random' found in D:\test\dist\numpy. >Ignoring: No module named info >import core -> failed: No module named _internal >import lib -> failed: 'module' object has no attribute '_ARRAY_API' >import linalg -> failed: 'module' object has no attribute '_ARRAY_API' >import dft -> failed: 'module' object has no attribute '_ARRAY_API' >Traceback (most recent call last): > File "main.py", line 9, in ? > File "numpy\__init__.pyc", line 49, in ? > > File "numpy\add_newdocs.pyc", line 2, in ? > gkDc > File "numpy\lib\__init__.pyc", line 5, in ? > > File "numpy\lib\type_check.pyc", line 8, in ? > > File "numpy\core\__init__.pyc", line 6, in ? > > File "numpy\core\umath.pyc", line 12, in ? > > File "numpy\core\umath.pyc", line 10, in __load I am cross referencing this from the py2exe mailing list. There seems to have been a fix for this problem #---------------------------begining of setup.py--------------------# from distutils.core import setup import py2exe from distutils.filelist import findall import os import matplotlib matplotlibdatadir = matplotlib.get_data_path() matplotlibdata = findall(matplotlibdatadir) matplotlibdata_files = [] for f in matplotlibdata: dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:]) matplotlibdata_files.append((os.path.split(dirname)[0], [f])) packages = ['matplotlib', 'pytz'] includes = [] excludes = [] dll_excludes = ['libgdk_pixbuf-2.0-0.dll', 'libgobject-2.0-0.dll', 'libgdk-win32-2.0-0.dll', 'wxmsw26uh_vc.dll'] opts = { 'py2exe': { 'packages' : packages, 'includes' : includes, 'excludes' : excludes, 'dll_excludes' : dll_excludes } } setup ( console=['test.py'], options = opts, data_files = matplotlibdata_files ) #--------------------------End of setup.py--------------# >>1) First Problem: numpy\core\_internal.pyc not included in Library.zip >>No scipy-style subpackage 'core' found in C:\WinCE\Traces\py2exe >>test\dist\library.zip\numpy. Ignoring: No module named _internal >>Traceback (most recent call last): >> File "profiler_ftt.py", line 15, in ? >> from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\ >> File "matplotlib\backends\backend_wx.pyc", line 152, in ? >> File "matplotlib\backend_bases.pyc", line 10, in ? >> File "matplotlib\colors.pyc", line 33, in ? >> File "matplotlib\numerix\__init__.pyc", line 67, in ? >> File "numpy\__init__.pyc", line 35, in ? >> File "numpy\_import_tools.pyc", line 173, in __call__ >> File "numpy\_import_tools.pyc", line 68, in _init_info_modules >> File "<string>", line 1, in ? >> File "numpy\lib\__init__.pyc", line 5, in ? >> File "numpy\lib\type_check.pyc", line 8, in ? >> File "numpy\core\__init__.pyc", line 6, in ? >> File "numpy\core\umath.pyc", line 12, in ? >> File "numpy\core\umath.pyc", line 10, in __load >>AttributeError: 'module' object has no attribute '_ARRAY_API' >>I resolved that issue by adding the file >>...\Python24\Lib\site-packages\numpy\core\_internal.pyc in >>...\test\dist\library.zip\numpy\core. >>Each time I compile that executable, I add the file by hand. >>Does anybody know how to automatically add that file? the setup.py was from the person who wrote the instructions for this fix. also here is my setup.py just for reference although mine is probably incorrect due to me being new with py2exe #------------------------setup.py------------------------# from distutils.core import setup import py2exe from distutils.filelist import findall import os import matplotlib matplotlibdatadir = matplotlib.get_data_path() matplotlibdata = findall(matplotlibdatadir) matplotlibdata_files = [] for f in matplotlibdata: dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:]) matplotlibdata_files.append((os.path.split(dirname)[0], [f])) setup( console=['templatewindow.py'], options={ "py2exe": { "compressed": 1, "optimize": 2, "packages": ["encodings", "kinterbasdb", "pytz.zoneinfo.UTC", "matplotlib.numerix", ], "dll_excludes": ["tcl84.dll", "tk84.dll"] } mpldata = glob.glob(r'C:\Python24\share\matplotlib\*') mpldata.append(r'C:\Python24\share\matplotlib\.matplotlibrc') data_files = [("prog\\locale\\fr\\LC_MESSAGES", mylocaleFR), ("prog\\locale\\de\\LC_MESSAGES", mylocaleDE), ("prog\\locale\\en\\LC_MESSAGES", mylocaleEN), ... ("matplotlibdata", mpldata), ("prog\\amaradata", amaradata), ("prog\\amaradata\\Schemata", amaraschemata), ] ) #-----------------------EOF-----------------# I was receiving this same "AttributeError: 'module' object has no attribute '_ARRAY_API'" error, and i did the same thing this person did, unzipped the folder, put the _internal.pyc file in the numpy/core folder and then rezipped the folder and I am receiving a wx error, but the numpy array_api error is gone. You may want to check this out and let us know if it works for you also. -Kenny p.s. i tried sending this 4 times prior but believe it did not send because it was alot longer so i shortened it, sorry if it posted 4 times |
From: Christopher B. <Chr...@no...> - 2006-08-29 17:12:19
|
Robin Dunn wrote: > BTW Chris, try using buffer(RGB) and buffer(Alpha) in your sample, I > expect that will work with the current code. yup. that does work. I was concerned that it would make a copy, but it looks like it makes a new buffer object, but using the same data buffer, so that should be fine. Thanks for all this, -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: Travis O. <oli...@ie...> - 2006-08-29 16:50:09
|
Matt Knox wrote: > is the following behaviour expected? or is this a bug with > numpy.object_ ? I'm using numpy 1.0b1 > > >>> print numpy.array([],numpy.float64).size > 0 > > >>> print numpy.array([],numpy.object_).size > 1 > > Should the size of an array initialized from an empty list not always > be 1 ? or am I just crazy? > Not in this case. Explictly creating an object array from any object (even the empty-list object) gives you a 0-d array containing that object. When you explicitly create an object array a different section of code handles it and gives this result. This is a recent change, and I don't think this use-case was considered as a backward incompatibility (which I believe it is). Perhaps we should make it so array([],....) always returns an empty array. I'm not sure. Comments? -Travis |
From: Keith G. <kwg...@gm...> - 2006-08-29 15:43:36
|
randn incorrectly returns random numbers only between 0 and 1 in numpy 1.0b1. random.randn works. >> from numpy.matlib import * >> randn(3,4) matrix([[ 0.60856413, 0.35500732, 0.48089868, 0.7044022 ], [ 0.71098538, 0.8506885 , 0.56154652, 0.4243273 ], [ 0.89655777, 0.92339559, 0.62247685, 0.70340003]]) >> randn(3,4) matrix([[ 0.84349201, 0.55638171, 0.19052097, 0.0927636 ], [ 0.60144183, 0.3788309 , 0.41451568, 0.61766302], [ 0.98992704, 0.94276652, 0.18569066, 0.69976656]]) >> randn(3,4) matrix([[ 0.69003273, 0.07171546, 0.34549767, 0.20901683], [ 0.1333439 , 0.4086678 , 0.80960253, 0.86864547], [ 0.75329427, 0.6760677 , 0.32496542, 0.99402779]]) >> random.randn(3,4) array([[ 1.00107604, 0.41418557, -0.07923699, 0.19203247], [-0.29386593, 0.02343702, -0.42366834, -1.27978993], [ 0.25722357, -0.53765827, 0.50569238, -2.44592854]]) |
From: W. B. S. <cs...@gm...> - 2006-08-29 15:15:26
|
hi, i posted this to the forum, but it looks like the email list gets much more traffic, so here goes. i am attempting to reproduce a portion of the example on using ctypes from the current version of the numpy book (the example can be found on pps 313-16). here is what i am trying to do: import numpy import interface x = numpy.array(range(1,1)) y = numpy.ones_like(x) z = interface.add(a,b) prints the following error: BEGIN ERROR>> 26 b = N.require(b, dtype, requires) 27 c = N.empty_like(a) ---> 28 func(a,b,c,a.size) 29 return c 30 ArgumentError: argument 1: exceptions.TypeError: Don't know how to convert parameter 1 <<END ERROR In case it matters, here are the relevant bits of code I am using (since I have not just copied the entire text from the example): BEGIN testAddInt.c >> /* Add arrays of contiguous data */ typedef struct {double real;} cdouble; typedef struct {float real;} cfloat; void dadd(double *a, double *b, double *c, long n) { while (n--) { *c++ = *a++ + *b++; } } void sadd(float *a, float *b, float *c, long n) { while (n--) { *c++ = *a++ + *b++; } } <<END testAddInt.c and the interface code: BEGIN interface.py>> __all__ = ['add'] import numpy as N from ctypes import * import os _path = os.path.dirname('__file__') lib = N.ctypeslib.ctypes_load_library('testAddInt', _path) for name in ['sadd','dadd']: getattr(lib,name).restype=None def select(dtype): if dtype.char in['?bBhHf']: return lib.sadd, single else: return lib.dadd, float return func, ntype def add(a,b): requires = ['CONTIGUOUS','ALIGNED'] a = N.asanyarray(a) func, dtype = select(a.dtype) a = N.require(a, dtype, requires) b = N.require(b, dtype, requires) c = N.empty_like(a) func(a,b,c,a.size) return c <<END interface.py any hints/clues/suggestions as to what i am doing wrong here? since i am so new at this, i am assuming there is a simple mistake in what i am doing, but i cannot find it! thanks so much, bryan |
From: Matt K. <mat...@ho...> - 2006-08-29 14:05:36
|
# is the following behaviour expected? or is this a bug with numpy.object_ = ? I'm using numpy 1.0b1# # >>> print numpy.array([],numpy.float64).size#= 0## >>> print numpy.array([],numpy.object_).size# 1## Should the size of a= n array initialized from an empty list not always be 1 ? or am I just crazy= ?## Thanks,# # - Matt Knox =20 Correction... I mean shouldn't it always be 0, not 1 _________________________________________________________________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-= 4911fb2b2e6d= |
From: Matt K. <mat...@ho...> - 2006-08-29 12:59:20
|
is the following behaviour expected? or is this a bug with numpy.object_ ?= I'm using numpy 1.0b1 =20 >>> print numpy.array([],numpy.float64).size0 >>> print numpy.array([],numpy.object_).size1 Should the size of an array initialized from an empty list not always be 1 = ? or am I just crazy? =20 Thanks, =20 - Matt Knox _________________________________________________________________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-= 4911fb2b2e6d= |
From: tristan C. <tco...@ya...> - 2006-08-29 10:01:55
|
Hello, I am having troubles with py2exe and numpy/matplotlib... Configuration : Windows XP pro ActivePython 2.4.2.10 Scipy 0.4.9 Numpy 0.9.8 MatplotLib 0.87.1 Py2exe 0.6.5 WxPython 2.6 I am using the following setup.py file: #--------------------------------------------------------- from distutils.core import setup import py2exe from distutils.filelist import findall import os import matplotlib matplotlibdatadir = matplotlib.get_data_path() matplotlibdata = findall(matplotlibdatadir) matplotlibdata_files = [] for f in matplotlibdata: dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:]) matplotlibdata_files.append((os.path.split(dirname)[0], [f])) packages = ['matplotlib', 'pytz'] includes = [] excludes = [] dll_excludes = ['libgdk_pixbuf-2.0-0.dll', 'libgobject-2.0-0.dll', 'libgdk-win32-2.0-0.dll', 'wxmsw26uh_vc.dll'] opts = { 'py2exe': { 'packages' : packages, 'includes' : includes, 'excludes' : excludes, 'dll_excludes' : dll_excludes } } setup ( console=['test.py'], options = opts, data_files = matplotlibdata_files ) #----------------------------- EOF --------------------------- I compile the application by running ">setup.py py2exe" At the end of compilation phase, it is written : The following modules appear to be missing ['AppKit', 'FFT', 'Foundation', 'Image', 'LinearAlgebra', 'MA', 'MLab', 'Matrix', 'Numeric', 'PyObjCTools', 'P yQt4', 'Pyrex', 'Pyrex.Compiler', 'RandomArray', '_curses', '_ssl', 'backends.draw_if_interactive', 'backends. new_figure_manager', 'backends.pylab_setup', 'backends.show', 'cairo', 'cairo.gtk', 'fcompiler.FCompiler', 'fc ompiler.show_fcompilers', 'fltk', 'gd', 'gobject', 'gtk', 'lib.add_newdoc', 'matplotlib.enthought.pyface.actio n', 'mlab.amax', 'mlab.amin', 'numarray', 'numarray.convolve', 'numarray.fft', 'numarray.ieeespecial', 'numarr ay.linear_algebra', 'numarray.linear_algebra.mlab', 'numarray.ma', 'numarray.numeric', 'numarray.random_array' , 'numerix.ArrayType', 'numerix.Complex', 'numerix.Complex32', 'numerix.Complex64', 'numerix.Float', 'numerix. Float32', 'numerix.Float64', 'numerix.Int', 'numerix.Int16', 'numerix.Int32', 'numerix.Int8', 'numerix.NewAxis ', 'numerix.UInt16', 'numerix.UInt32', 'numerix.UInt8', 'numerix.absolute', 'numerix.add', 'numerix.all', 'num erix.allclose', 'numerix.alltrue', 'numerix.arange', 'numerix.arccos', 'numerix.arccosh', 'numerix.arcsin', 'n umerix.arcsinh', 'numerix.arctan', 'numerix.arctan2', 'numerix.arctanh', 'numerix.argmax', 'numerix.argmin', ' numerix.argsort', 'numerix.around', 'numerix.array', 'numerix.arrayrange', 'numerix.asarray', 'numerix.asum', 'numerix.bitwise_and', 'numerix.bitwise_or', 'numerix.bitwise_xor', 'numerix.ceil', 'numerix.choose', 'numerix .clip', 'numerix.compress', 'numerix.concatenate', 'numerix.conjugate', 'numerix.convolve', 'numerix.cos', 'nu merix.cosh', 'numerix.cross_correlate', 'numerix.cumproduct', 'numerix.cumsum', 'numerix.diagonal', 'numerix.d ivide', 'numerix.dot', 'numerix.equal', 'numerix.exp', 'numerix.fabs', 'numerix.fft.fft', 'numerix.fft.inverse _fft', 'numerix.floor', 'numerix.fmod', 'numerix.fromfunction', 'numerix.fromstring', 'numerix.greater', 'nume rix.greater_equal', 'numerix.hypot', 'numerix.identity', 'numerix.indices', 'numerix.innerproduct', 'numerix.i scontiguous', 'numerix.less', 'numerix.less_equal', 'numerix.log', 'numerix.log10', 'numerix.logical_and', 'nu merix.logical_not', 'numerix.logical_or', 'numerix.logical_xor', 'numerix.matrixmultiply', 'numerix.maximum', 'numerix.minimum', 'numerix.mlab.amax', 'numerix.mlab.amin', 'numerix.mlab.cov', 'numerix.mlab.diff', 'numerix .mlab.hanning', 'numerix.mlab.rand', 'numerix.mlab.std', 'numerix.mlab.svd', 'numerix.multiply', 'numerix.nega tive', 'numerix.newaxis', 'numerix.nonzero', 'numerix.not_equal', 'numerix.nx', 'numerix.ones', 'numerix.outer product', 'numerix.pi', 'numerix.power', 'numerix.product', 'numerix.put', 'numerix.putmask', 'numerix.rank', 'numerix.ravel', 'numerix.repeat', 'numerix.reshape', 'numerix.resize', 'numerix.searchsorted', 'numerix.shape ', 'numerix.sin', 'numerix.sinh', 'numerix.size', 'numerix.sometrue', 'numerix.sort', 'numerix.sqrt', 'numerix .subtract', 'numerix.swapaxes', 'numerix.take', 'numerix.tan', 'numerix.tanh', 'numerix.trace', 'numerix.trans pose', 'numerix.typecode', 'numerix.typecodes', 'numerix.where', 'numerix.which', 'numerix.zeros', 'numpy.Comp lex', 'numpy.Complex32', 'numpy.Complex64', 'numpy.Float', 'numpy.Float32', 'numpy.Float64', 'numpy.Infinity', 'numpy.Int', 'numpy.Int16', 'numpy.Int32', 'numpy.Int8', 'numpy.UInt16', 'numpy.UInt32', 'numpy.UInt8', 'nump y.inf', 'numpy.infty', 'numpy.oldnumeric', 'objc', 'paint', 'pango', 'pre', 'pyemf', 'qt', 'setuptools', 'setu ptools.command', 'setuptools.command.egg_info', 'trait_sheet', 'matplotlib.numerix.Float', 'matplotlib.numerix .Float32', 'matplotlib.numerix.absolute', 'matplotlib.numerix.alltrue', 'matplotlib.numerix.asarray', 'matplot lib.numerix.ceil', 'matplotlib.numerix.equal', 'matplotlib.numerix.fromstring', 'matplotlib.numerix.indices', 'matplotlib.numerix.put', 'matplotlib.numerix.ravel', 'matplotlib.numerix.sqrt', 'matplotlib.numerix.take', 'm atplotlib.numerix.transpose', 'matplotlib.numerix.where', 'numpy.core.conjugate', 'numpy.core.equal', 'numpy.c ore.less', 'numpy.core.less_equal', 'numpy.dft.old', 'numpy.random.rand', 'numpy.random.randn'] 1) First Problem: numpy\core\_internal.pyc not included in Library.zip No scipy-style subpackage 'core' found in C:\WinCE\Traces\py2exe test\dist\library.zip\numpy. Ignoring: No module named _internal Traceback (most recent call last): File "profiler_ftt.py", line 15, in ? from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\ File "matplotlib\backends\backend_wx.pyc", line 152, in ? File "matplotlib\backend_bases.pyc", line 10, in ? File "matplotlib\colors.pyc", line 33, in ? File "matplotlib\numerix\__init__.pyc", line 67, in ? File "numpy\__init__.pyc", line 35, in ? File "numpy\_import_tools.pyc", line 173, in __call__ File "numpy\_import_tools.pyc", line 68, in _init_info_modules File "<string>", line 1, in ? File "numpy\lib\__init__.pyc", line 5, in ? File "numpy\lib\type_check.pyc", line 8, in ? File "numpy\core\__init__.pyc", line 6, in ? File "numpy\core\umath.pyc", line 12, in ? File "numpy\core\umath.pyc", line 10, in __load AttributeError: 'module' object has no attribute '_ARRAY_API' I resolved that issue by adding the file ...\Python24\Lib\site-packages\numpy\core\_internal.pyc in ...\test\dist\library.zip\numpy\core. Each time I compile that executable, I add the file by hand. Does anybody know how to automatically add that file? 2) Second problem: I don't know how to resolve that issue: Traceback (most recent call last): File "profiler_ftt.py", line 15, in ? from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\ File "matplotlib\backends\backend_wx.pyc", line 152, in ? File "matplotlib\backend_bases.pyc", line 10, in ? File "matplotlib\colors.pyc", line 33, in ? File "matplotlib\numerix\__init__.pyc", line 67, in ? File "numpy\__init__.pyc", line 35, in ? File "numpy\_import_tools.pyc", line 173, in __call__ File "numpy\_import_tools.pyc", line 68, in _init_info_modules File "<string>", line 1, in ? File "numpy\random\__init__.pyc", line 3, in ? File "numpy\random\mtrand.pyc", line 12, in ? File "numpy\random\mtrand.pyc", line 10, in __load File "numpy.pxi", line 32, in mtrand AttributeError: 'module' object has no attribute 'dtype' I don't find the file numpy.pxi in my file tree nor in \test\dist\library.zip. I browsed the web in the hope to find a solution but nothing. It seems that this issue is well known but no solution provided in mailing lists. What is that file "numpix.pxi"? Where to find it or how is it generated? How to resolve that execution issue? Thanks, Regards, Tristan |
From: Bruce W. <bru...@gm...> - 2006-08-29 06:10:08
|
Hi, Travis I can pack my scripts into an executable with py2exe, but errors occur once it runs: No scipy-style subpackage 'random' found in D:\test\dist\numpy. Ignoring: No module named info import core -> failed: No module named _internal import lib -> failed: 'module' object has no attribute '_ARRAY_API' import linalg -> failed: 'module' object has no attribute '_ARRAY_API' import dft -> failed: 'module' object has no attribute '_ARRAY_API' Traceback (most recent call last): File "main.py", line 9, in ? File "numpy\__init__.pyc", line 49, in ? =01=07=02 File "numpy\add_newdocs.pyc", line 2, in ? =10gkDc File "numpy\lib\__init__.pyc", line 5, in ? File "numpy\lib\type_check.pyc", line 8, in ? File "numpy\core\__init__.pyc", line 6, in ? File "numpy\core\umath.pyc", line 12, in ? File "numpy\core\umath.pyc", line 10, in __load AttributeError: 'module' object has no attribute '_ARRAY_API' This is the main.py file: #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # filename:main.py import wx import numpy class myFrame(wx.Frame): def __init__(self, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) ##------ your widgets ##------ put stuff into sizer self.sizer_ =3D wx.BoxSizer(wx.VERTICAL) ## self.sizer_.Add(your_ctrl, proportion =3D 1, flag =3D wx.EXPAND) ## apply sizer self.SetSizer(self.sizer_) self.SetAutoLayout(True) def main(): ## {{{ app =3D wx.PySimpleApp(0) frame =3D myFrame(None, -1, title =3D '') frame.Show(True) app.SetTopWindow(frame) app.MainLoop() ## }}} if __name__ =3D=3D "__main__":main() #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # filename:setup.py import glob import sys from distutils.core import setup import py2exe includes =3D ["encodings", "encodings.*", ] excludes =3D ["javax.comm"] options =3D { "py2exe": { #"compressed": 1, #"optimize": 0, #"bundle_files":2, "skip_archive":1, "includes": includes, 'excludes': excludes } } setup( version =3D "0.1", description =3D "", name =3D "test", options =3D options, windows =3D [ { "script":"main.py", } ], #zipfile =3D None, ) and I run this command to compile the scripts: python setup.py py2exe and all packages I use are: python2.4.3 numpy-0.98 py2exe-0.6.5 wxpython-2.6.3.2 I unistalled Numeric before I compiled scripts. If you google "numpy py2exe", you can find others guys stumbled by the same issue with ease: http://aspn.activestate.com/ASPN/Mail/Message/py2exe-users/3249182 http://www.nabble.com/matplotlib,-numpy-and-py2exe-t1901429.html I just hope this can be fixed in the next table release of numpy. On 8/29/06, Travis Oliphant <oli...@ie...> wrote: > bruce.who.hk wrote: > > Hi, Travis > > > > I just wonder if NumPy 1.0b4 can get along with py2exe? Just a few week= s ago I made a application in Python. At first I used Numpy, it works OK, b= ut I cannot pack it into a workable executable with py2exe and the XXX.log = saied that numpy cannot find some module. I found some hints in py2exe wiki= , but it still doesn't work. At Last I tried Numeric instead and it got OK.= I just hope that you donnot stop the maintenance of Numeric before you are= sure that Numpy can work with py2exe. > > > We've already stopped maintenance of Numeric nearly 1 year ago. If > NumPy doesn't work with py2exe then we need help figuring out why. The > beta-release period is the perfect time to fix that. I've never used > py2exe myself, but I seem to recall that some have been able to make it > work. > > The problem may just be listing the right set of modules to carry along > because you may not be able to get that with just the Python-side > imports. Post any errors you receive to > num...@li... > > Thanks, > > > -Travis > > Bruce Who |
From: Robin D. <ro...@al...> - 2006-08-29 06:10:05
|
Travis Oliphant wrote: > Christopher Barker wrote: >> HI all, >> >> File >> "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", >> line 2814, in SetDataBuffer >> return _core_.Image_SetDataBuffer(*args, **kwargs) >> TypeError: non-character array cannot be interpreted as character buffer >> >> If I try to pass in a numpy array, while it works great with a >> numarray array. > > This error sounds like wx is using the *wrong* buffer protocol. Don't > use bf_getcharbuffer as it is of uncertain utility. It is slated for > removal from Python 3000. It was meant to be used as a way to determine > buffers that were supposed to contain characters (not arbitrary data). > > Just use bf_getreadbuffer and bf_getwritebuffer from tp_as_buffer. I'm using PyArg_Parse($input, "t#", ...) to get the buffer pointer and size. Is there another format specifier to use for the buffer pointer using the other slots or do I need to drop down to a lower level API to get it? I didn't realize there was a distinction between buffer and character buffer. Another read of the PyArg_Parse docs with that new fact makes things a little more clear. Looking at the code I guess "s#" will do it, I guess I thought it would try to coerce the object to a PyString like some other APIs do, which I was trying to avoid, but it doesn't appear to do that, (only encoding a unicode object if that is passed.) I think I'll take a shot at using tp_as_buffer directly to avoid any confusion in the future and avoid the arg parse overhead... Any other suggestions? BTW Chris, try using buffer(RGB) and buffer(Alpha) in your sample, I expect that will work with the current code. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! |
From: PGM <pgm...@gm...> - 2006-08-29 05:25:26
|
Folks, I keep running into the following problem since some recent update (I'm currently running 1.0b3, but the problem occurred roughly around 0.9.8): >>> import numpy.core.ma as MA >>> x=MA.array([[1],[2]],mask=False) >>> x.sum(None) /usr/lib64/python2.4/site-packages/numpy/core/ma.py in reduce(self, target, axis, dtype) 393 m.shape = (1,) 394 if m is nomask: --> 395 return masked_array (self.f.reduce (t, axis)) 396 else: 397 t = masked_array (t, m) TypeError: an integer is required #................................ Note that x.sum(0) and x.sum(1) work fine. I know some consensus seems to be lacking with MA, but still, I can't see why axis=None is not recognized. Corollary: with masked array, the default axis for sum is 0, when it's None for regular arrays. Is there a reason for this inconsistency ? Thanks a lot |
From: Bill B. <wb...@gm...> - 2006-08-29 03:55:10
|
On 8/29/06, Travis Oliphant <oli...@ie...> wrote: > Example: > > If a.shape is (3,4,5) > and b.shape is (4,3,2) > > Then > > tensordot(a, b, axes=([1,0],[0,1])) > > returns a (5,2) array which is equivalent to the code: > > c = zeros((5,2)) > for i in range(5): > for j in range(2): > for k in range(3): > for l in range(4): > c[i,j] += a[k,l,i]*b[l,k,j] That's pretty cool. >From there it shouldn't be too hard to make a wrapper that would allow you to write c_ji = a_kli * b_lkj (w/sum over k and l) like: tensordot_ez(a,'kli', b,'lkj', out='ji') or maybe with numexpr-like syntax: tensor_expr('_ji = a_kli * b_lkj') [pulling a and b out of the globals()/locals()] Might be neat to be able to build a callable function for repeated reuse: tprod = tensor_func('_ji = [0]_kli * [1]_lkj') # [0] and [1] become parameters 0 and 1 c = tprod(a, b) or to pass the output through a (potentially reused) array argument: tprod1 = tensor_func('[0]_ji = [1]_kli * [2]_lkj') tprod1(c, a, b) --bb |
From: Travis O. <oli...@ie...> - 2006-08-29 03:03:41
|
Simon Burton wrote: >>>> numpy.dot.__doc__ >>>> > matrixproduct(a,b) > Returns the dot product of a and b for arrays of floating point types. > Like the generic numpy equivalent the product sum is over > the last dimension of a and the second-to-last dimension of b. > NB: The first argument is not conjugated. > > Does numpy support summing over arbitrary dimensions, > as in tensor calculus ? > > I could cook up something that uses transpose and dot, but it's > reasonably tricky i think :) > I've just added tensordot to NumPy (adapted and enhanced from numarray). It allows you to sum over an arbitrary number of axes. It uses a 2-d dot-product internally as that is optimized if you have a fast blas installed. Example: If a.shape is (3,4,5) and b.shape is (4,3,2) Then tensordot(a, b, axes=([1,0],[0,1])) returns a (5,2) array which is equivalent to the code: c = zeros((5,2)) for i in range(5): for j in range(2): for k in range(3): for l in range(4): c[i,j] += a[k,l,i]*b[l,k,j] -Travis |
From: Torgil S. <tor...@gm...> - 2006-08-29 00:31:07
|
> The C-code is basically a directy "translation" of the original Python > code. ... > If I had to do it over again, I would place the std implementation there where > it could be appropriately optimized. Isn't C-code a good place for optimizations? //Torgil On 8/27/06, Travis Oliphant <oli...@ie...> wrote: > Torgil Svensson wrote: > > Hi > > > > ndarray.std(axis=1) seems to have memory issues on large 2D-arrays. I > > first thought I had a performance issue but discovered that std() used > > lots of memory and therefore caused lots of swapping. > > > There are certainly lots of intermediate arrays created as the > calculation proceeds. The calculation is not particularly "smart." It > just does the basic averaging and multiplication needed. > > > I want to get an array where element i is the stadard deviation of row > > i in the 2D array. Using valgrind on the std() function... > > > > $ valgrind --tool=massif python -c "from numpy import *; > > a=reshape(arange(100000*100),(100000,100)).std(axis=1)" > > > > ... showed me a peak of 200Mb memory while iterating line by line... > > > > > The C-code is basically a directy "translation" of the original Python > code. There are lots of temporaries created (apparently 5 at one point > :-). I did this before I had the _internal.py code in place where I > place Python functions that need to be accessed from C. If I had to do > it over again, I would place the std implementation there where it could > be appropriately optimized. > > > > -Travis > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Torgil S. <tor...@gm...> - 2006-08-29 00:24:45
|
This is really a matplotlib problem. >From matplotlib users mailing-list archives: > From: Charlie Moad <cwmoad@gm...> > Snapshot build for use with numpy-1.0b3 > 2006-08-23 06:11 > > Here is a snapshot of svn this morning for those wanting to work with the numpy beta. Both builds are for python2.4 and windows. > > exe: http://tinyurl.com/gf299 > egg: http://tinyurl.com/fbjmg > > -Charlie That exe-file worked for me. //Torgil On 8/28/06, Travis Oliphant <oli...@ie...> wrote: > kor...@id... wrote: > > On 8/25/06, Travis Oliphant <oli...@ie...> wrote: > > > >> kor...@id... wrote: > >> > >>> Message: 4 > >>> Date: Thu, 24 Aug 2006 14:17:44 -0600 > >>> From: Travis Oliphant <oli...@ee...> > >>> Subject: Re: [Numpy-discussion] (no subject) > >>> To: Discussion of Numerical Python > >>> <num...@li...> > >>> Message-ID: <44E...@ee...> > >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >>> > >>> kor...@id... wrote: > >>> > >>> > >>> > >>> You have a module built against an older version of NumPy. What modules > >>> are being loaded? Perhaps it is matplotlib or SciPy > >>> > >>> > >> You need to re-build matplotlib. They should be producing a binary that > >> is compatible with 1.0b2 (I'm being careful to make sure future releases > >> are binary compatible with 1.0b2). > >> > >> Also, make sure that you remove the build directory under numpy if you > >> have previously built a version of numpy prior to 1.0b2. > >> > > You have to download the SVN version of matplotlib. The released > version does not support 1.0b2 and above yet. > > -Travis > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Robert K. <rob...@gm...> - 2006-08-28 23:38:27
|
Christopher Barker wrote: > While I'm a great advocate of the new array protocol, it seems > supporting the buffer protocol also would be a good idea. I've enclosed > some simple test code. It works with numarray, but not numpy 1.0b4 Instead of I.SetDataBuffer(some_array) you can use I.SetDataBuffer(buffer(some_array)) and it seems to work on OS X with Python 2.4, numpy 1.0b2 and wxMac 2.6.3.3 . -- 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 |