[Numpy-discussion] atpy and readable buffer error
I get this error that I do not understand. Does anyone know what is happening and how to get around it import atpy t = atpy.Table() name = [aa,bb,cc] t.add_column(name,name) k = [1,2,3] t.add_column(num,k) t Table name='None' rows=3 fields=2 name = [aaa,bbb,ccc] p = atpy.Table() p.add_column(name,name) p.add_column(num,k) t.append(p) Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atpy/basetable.py, line 301, in append raise Exception(Columns do not match) Exception: Columns do not match nn = t.name.astype(|S3) t.remove_columns(name) t.add_column(name,nn) t.append(p) Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atpy/basetable.py, line 302, in append self.data = np.hstack((self.data, table.data)) File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/shape_base.py, line 258, in hstack return _nx.concatenate(map(atleast_1d,tup),1) TypeError: expected a readable buffer object Cheers Tommy ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?
On Feb 8, 2010, at 5:38 PM, David Cournapeau wrote: On Tue, Feb 9, 2010 at 6:43 AM, Travis Oliphant oliph...@enthought.com wrote: I think we need to make that decision now. It seems to have gotten hung up in conflicts that need to be resolved. How should we go about it? Does the numpy steering council (name?) have a role here. It seems like consensus has been reached on making 1.4.1 an ABI compatible release. The remaining question is what to call the next release of NumPy 1.5 or 2.0. I am for 1.5 as well, as long as it is marked experimental (the installers name would have an experimental tag or something). Just wanted to chime in as a user of numpy that following the discussion that the care the developers are taking in deciding issues like this gives me strong confidence in the software written. All over many thanks to all that has made numpy such an enormously useful tool in my scientific career! Cheers Tommy Grav ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] numpy for 2.6 on mac os x
The current dmg on the numpy download pages is buildt against 2.5. Is there any plans to make one for 2.6 or do I have to compile from the source? Cheers Tommy ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix default to column vector?
On Jun 4, 2009, at 5:25 PM, Christopher Barker wrote: Keith Goodman wrote: Maybe announcing that numpy will drop support for matrices in a future version (3.0, ...) would save a lot of pain in the long run. Or make them better. There was a pretty good discussion of this a while back on this list. We all had a lot of opinions, and there were some good ideas in that thread. However, no none stepped up to implement any of it. I think the reason is that none of the core numpy developers use them/want them. In fact, many of those contributing to the discussion (myself included), didn't think it likely that they'd use them, even with improvements. Someone that thinks they are important needs to step up and really make them work. Or the core development team split the matrices out of numpy and make it as separate package that the people that use them could pick up and run with. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix default to column vector?
On Jun 4, 2009, at 5:41 PM, Alan G Isaac wrote: On 6/4/2009 5:27 PM Tommy Grav apparently wrote: Or the core development team split the matrices out of numpy and make it as separate package that the people that use them could pick up and run with. This too would be a mistake, I believe. But it depends on whether a goal is to have more people use NumPy. I believe the community will gain from growth. In sum, my argument is this: Keeping a matrix object in NumPy has substantial benefits in encouraging growth of the NumPy community, and as far as I can tell, it is imposing few costs. Therefore I think there is a very substantial burden on people who propose removing the matrix object to demonstrate just how the NumPy community will benefit from this change. This is a perfectly valid argument. I am actually quite happy with the numpy package as it is (I work in astronomy), I was just pointing out that if there are few of the core numpy people interested in maintaing or upgrading the matrix class one solution might be to make it a scipy-like package that easily can be installed on top of numpy, but where the code base might be more accessible to those that are interested in matrices, but feel that numpy is a daunting beast to tackle. Some sense of ownership of a matrixpy package might encourage more people to contribute. Just an idea ;-) Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Leopard install
On Apr 12, 2009, at 7:02 PM, David Cournapeau wrote: On Mon, Apr 13, 2009 at 1:19 AM, Stuart Edwards sedwar...@cinci.rr.com wrote: Hi I am trying to install numpy 1.3.0 on Leopard 10.5.6 and at the point in the install process where I select a destination, my boot disc is excluded with the message: I think you need to install python from python.org (version 2.5) to install the numpy binary, Or you can alternatively use the ActiveState python binary (v2.5), which also seems to work. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [Announce] Numpy 1.3.0 rc1
On Mar 30, 2009, at 2:56 AM, David Cournapeau wrote: On Mon, Mar 30, 2009 at 3:36 AM, Robert Pyle rp...@post.harvard.edu wrote: I just installed 2.5.4 from python.org, and the OS X installer still doesn't work. This is on a PPC G5; I haven't tried it on my Intel MacBook Pro. I think I got it. To build numpy, I use virtualenv to make a bootstrap environment, but then the corresponding python path get embedded in the .mpkg - so unless you have your python interpreter in exactly the same path as my bootstrap (which is very unlikely), it won't run at all. This would also explain why I never saw the problem. This is exactly the problem. This is the error message that you get when running the .dmg and no hard drives are available for selection. You cannot install numpy 1.3.0rc1 on this volume. numpy requires /Users/david/src/dsp/numpy/1.3.x/bootstrap Python 2.5 to install. I will prepare a new binary, Any idea when a new binary will be available on sourceforge.net? Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] building numpy/scipy
Is there any reason why you can not use the numpy-1.2.1-win32- superpack-python2.4.exe from the http://sourceforge.net/project/showfiles.php?group_id=1369package_id=175103 download page? I think that is what Mr. Kern meant by using the binaries. This will install already built code into the proper places on your Windows box. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] building numpy/scipy
There is a superpack for the python2.5 at the same page. Again a binary .exe file that should make the installing a fair bit easier. Cheers Tommy On Jan 2, 2009, at 11:26 PM, Mike Landis wrote: Have to use Pyton 2.5 because I'm also using web2py. Python 2.5 and a bunch of packages that depend on it are already installed. At 11:05 PM 1/2/2009, you wrote: Is there any reason why you can not use the numpy-1.2.1-win32- superpack-python2.4.exe from the http://sourceforge.net/project/showfiles.php?group_id=1369package_id=175103 download page? I think that is what Mr. Kern meant by using the binaries. This will install already built code into the proper places on your Windows box. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.2/1871 - Release Date: 1/1/2009 5:01 PM ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Py3k and numpy
On Dec 4, 2008, at 2:03 PM, Robert Kern wrote: It does. What problems are people seeing? Is it just the Windows build that causes people to say numpy doesn't work with Python 2.6? There is currently no official Mac OSX binary for numpy for python 2.6, but you can build it from source. Is there any time table for generating a 2.6 Mac OS X binary? Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.2.0rc1 tagged!
I thought is was pretty standard that non-system versions of python should go into /Library/Frameworks/Python.framework/ on the OS X? Is this not the case? Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.2.0rc1 tagged!
On Sep 10, 2008, at 10:12 PM, Robert Kern wrote: On Wed, Sep 10, 2008 at 19:58, Tommy Grav [EMAIL PROTECTED] wrote: I thought is was pretty standard that non-system versions of python should go into /Library/Frameworks/Python.framework/ on the OS X? Is this not the case? Yes, but frameworks are versioned, and the files installed by .mpkg packages have the version fully specified. EPD uses a different version number than the www.python.org release in order to keep the two installations separate (so you can install EPD, then delete it with few, if any repercussions). I see. I have been using ActivePython and the numpy packages has always worked fine for me :) Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Bug in numpy.histogram?
With the most recent change in numpy 1.1 it seems that numpy.histogram was broken when wanting a normalized histogram. I thought the idea was to leave the functionality of histogram as it was in 1.1 and then break the api in 1.2? import numpy a = [0,1,2,3,4,5,6,7,8] numpy.histogram(a) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/numpy/lib/function_base.py:166: FutureWarning: The semantics of histogram will be modified in release 1.2 to improve outlier handling. The new behavior can be obtained using new=True. Note that the new version accepts/ returns the bin edges instead of the left bin edges. Please read the docstring for more information. Please read the docstring for more information., FutureWarning) (array([1, 1, 1, 1, 0, 1, 1, 1, 1, 1]), array([ 0. , 0.8, 1.6, 2.4, 3.2, 4. , 4.8, 5.6, 6.4, 7.2])) data, bins = numpy.histogram(a) len(data) 10 len(bins) 10 b = [1,3,5,6,9] data, bins = numpy.histogram(a,b) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/numpy/lib/function_base.py:193: FutureWarning: The semantic for bins will change in version 1.2. The bins will become the bin edges, instead of the left bin edges. , FutureWarning) data array([2, 2, 1, 3, 0]) bins array([1, 3, 5, 6, 9]) data, bins = numpy.histogram(a,b,normed=True) Traceback (most recent call last): File console, line 0, in module File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/lib/function_base.py, line 189, in histogram raise ValueError, 'Use new=True to pass bin edges explicitly.' ValueError: Use new=True to pass bin edges explicitly. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Bug in numpy.histogram?
I understand this and agree, but it still means that the API for histogram is broken since normed can only be used with the new=True parameter. I though the whole point of the future warning was to avoid this. It is not a big deal, just means that one is forced to use the new API somewhat quicker :) Cheers Tommy On Jun 9, 2008, at 11:17 AM, Pauli Virtanen wrote: ma, 2008-06-09 kello 11:11 -0400, Tommy Grav kirjoitti: With the most recent change in numpy 1.1 it seems that numpy.histogram was broken when wanting a normalized histogram. I thought the idea was to leave the functionality of histogram as it was in 1.1 and then break the api in 1.2? [clip] data, bins = numpy.histogram(a,b,normed=True) Traceback (most recent call last): File console, line 0, in module File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/lib/function_base.py, line 189, in histogram raise ValueError, 'Use new=True to pass bin edges explicitly.' ValueError: Use new=True to pass bin edges explicitly. I think the point in this specific change was that numpy.histogram previously returned invalid results when normed=True and explicit bins were given; the previous code always normalized the results assuming the bins were of equal size. Moreover, I think it was not obvious what normalized results should mean when one of the bins is of infinite size. Pauli ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Which Python to Use on OSX, Was: 1.1.0 OSX Installer Fails Under 10.5.3?
You have to very careful when you do this. For example the system numpy is in ../python2.5/Extras/lib/ under the framework, while I think the numpy binary installer installs things in ../python2.5/lib/site-packages/. So if one is not careful one ends up with two numpy packages with all the problems that can cause. I have installed Activepython on my machine (PPC w/ 10.5.3) and it has worked more or less flawlessly. The system python is still there and is untouched since I installed Leopard and I do all my development against the activepython distribution. Cheers Tommy On Jun 4, 2008, at 6:02 AM, Vincent Noel wrote: Another way to do things which might be useful, if you're not afraid to modify the system python install, (more-or-less suggested at http://wiki.python.org/moin/MacPython/Leopard), is to create a symbolic link to make everything look as if you had installed macpython, ie sudo ln -s /System/Library/Frameworks/Python.framework/ /Library/Frameworks/Python.framework Since, according to the MacPython page, the Leopard python is the same as the MacPython (2.5.1), all the packages you'll find on the web that suppose you have MacPython installed should be happy (easy_installing eggs works fine as well). HOWEVER you gotta add export PATH=/Library/Frameworks/Python.framework/Versions/Current/ bin:$PATH export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/ Current/lib/python2.5/site-packages in your ~/.bash_profile, otherwise the (older) system numpy will get used. This is because the system python adds /System/.../2.5/Extras in front of the /site-packages directory (weird, but hey). Following this road, I was able to install NumPy 1.1, matplotlib 0.98 and ipython without any problem -- the best thing is that the system wxPython is used, when it can be a PITA to setup correctly through other ways. As was said by others, I guess there might be unforeseen consequences, but everything seems to work fine for now. Cheers Vincent On Wed, Jun 4, 2008 at 10:25 AM, J. Stark [EMAIL PROTECTED] wrote: Robert, I see your point, but why not just install a separate NumPy to run with the system Python? That is what I have always done in the past without problems. I guess I always feel a sense of uncertainty with having two separate Python installations as to which actually gets used in any particular situation. I appreciate that for experts who use Python daily, this isn't an issue, but for someone like myself who may have gaps of several months between projects that use Python, this is a real issue as I forget those kinds of subtleties. J. On Wed, Jun 4, 2008 at 1:48 AM, J. Stark [EMAIL PROTECTED] wrote: On this topic, I would be interested to hear people's advice on using the system provided Python v an independent install. In 25 years of using Macs I have learned through several painful lessons that its wise to customize the system as little as possible: this minimizes both conflicts and reduces problems when doing system upgrades. I have therefore always used the default Python provided by OSX, so far with no obvious disadvantages for the types of scripts I use (primarily home written SciPy scientific code). However, I note that many people run either the pythomac.org distribution, or the ActiveState. What are the advantages to this? By installing a separate Python, you are actually customizing the system *less* than if you used the system Python and installed a bunch of extra packages. Parts of Apple's software uses the system Python. If you upgrade packages inside there (like numpy!) you might run into problems. -- 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 ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.1.0 OSX Installer Fails Under 10.5.3?
Where is your python located I have installed numpy 1.1.0 using the binary installer successfully on 10.5.3 but I am using ActiveState python. I think the problem might be that the installer looks in /Library/Frameworks/Python.framework/ for python, while the standard python is located somewhere else. Cheers Tommy On Jun 3, 2008, at 5:33 PM, J. Stark wrote: I have just tried to run the 1.1.0 OSX installer on a MacBookAir running 10.5.3 and the installer fails with You cannot install numpy 1.1.0 on this volume. numpy requires System Python 2.5 to install. The system python version reports as jaroslav$ python Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin which is the same version that Leopard has had all along, as far as I am aware. On the the other hand, there have been some reports on PythonMac about odd python behaviour following the 10.5.3 upgrade. Has anybody used this installer successfully under 10.5.3, and/or have any idea of what is going on. Incidentally, this is a new machine with just the default system installation. Jaroslav ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] URGENT: Re: 1.1.0rc1, Mac Installer: please test it
Doing the same on a the Mac installer also returns 3 failures and 12 errors with all=True. Installer works fine though :) [skathi:~] tgrav% python ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May 1 2007, 17:40:00) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type help, copyright, credits or license for more information. import numpy numpy.test(all=True) Numpy is installed in /Library/Frameworks/Python.framework/Versions/ 2.5/lib/python2.5/site-packages/numpy Numpy version 1.1.0rc1 Python version 2.5.1 (r251:54863, May 1 2007, 17:40:00) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] ./Library/ Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ numpy/core/ma.py:609: UserWarning: Cannot automatically convert masked array to numeric because data is masked in one or more locations. warnings.warn(Cannot automatically convert masked array to \ F... ...F F..EEE....E..EE.EE.. == ERROR: Test creation by view -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/tests/test_mrecords.py, line 51, in test_byview assert_equal_records(mbase._data, base._data.view(recarray)) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/testutils.py, line 74, in assert_equal_records assert_equal(getattr(a,f), getattr(b,f)) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/testutils.py, line 103, in assert_equal return _assert_equal_on_sequences(actual.tolist(), RuntimeError: array_item not returning smaller-dimensional array == ERROR: Test filling the array -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/tests/test_mrecords.py, line 258, in test_filled assert_equal(mrecfilled['c'], np.array(('one','two','N/A'), dtype='|S8')) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/testutils.py, line 103, in assert_equal return _assert_equal_on_sequences(actual.tolist(), RuntimeError: array_item not returning smaller-dimensional array == ERROR: Tests fields retrieval -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/tests/test_mrecords.py, line 62, in test_get assert_equal(getattr(mbase,field), mbase[field]) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/testutils.py, line 104, in assert_equal desired.tolist(), File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/core.py, line 2552, in tolist result = self.filled().tolist() RuntimeError: array_item not returning smaller-dimensional array == ERROR: Test pickling -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/ma/tests/test_mrecords.py, line 243, in test_pickling
Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test
Powerbook G4 with 10.5.2 and Activestate Python 2.5.1.1, no problems beyond the two endian test failures Cheers Tommy On May 20, 2008, at 12:57 PM, Christopher Burns wrote: Reminder to please test the installer. We already discovered a couple endian bugs on PPC, which is good, but we'd like to verify the release candidate on several more machines before the 1.1.0 tag on Thursday. It only takes a few minutes and you get the added bonus of having a current install of numpy. :) Thank you, Chris ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test
Yes it does put python in that location as it should ;o) Cheers Tommy On May 20, 2008, at 2:20 PM, Christopher Burns wrote: Hey Tommy, Does ActiveState install python in the same location as python.org? [EMAIL PROTECTED] 10:35:05 $ which python /Library/Frameworks/Python.framework/Versions/Current/bin/python On Tue, May 20, 2008 at 11:04 AM, Tommy Grav [EMAIL PROTECTED] wrote: Powerbook G4 with 10.5.2 and Activestate Python 2.5.1.1, no problems beyond the two endian test failures Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test
On May 19, 2008, at 3:39 PM, Christopher Burns wrote: I've built a Mac binary for the 1.1 release candidate. Mac users, please test it from: https://cirl.berkeley.edu/numpy/numpy-1.1.0rc1-py2.5-macosx10.5.dmg This is for the MacPython installed from python.org. Thanks, Chris I tried this build on my PPC running 10.5.2. It works with two failed tests given below. [*:~] tgrav% python ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May 1 2007, 17:40:00) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type help, copyright, credits or license for more information. [*:~] tgrav% python -c 'import numpy; numpy.test()' Numpy is installed in /Library/Frameworks/Python.framework/Versions/ 2.5/lib/python2.5/site-packages/numpy Numpy version 1.1.0rc1 Python version 2.5.1 (r251:54863, May 1 2007, 17:40:00) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] [Test log snipped] == FAIL: test_basic (numpy.core.tests.test_multiarray.TestView) -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/core/tests/test_multiarray.py, line 843, in test_basic assert_array_equal(y, [67305985, 134678021]) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/testing/utils.py, line 248, in assert_array_equal verbose=verbose, header='Arrays are not equal') File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/testing/utils.py, line 240, in assert_array_compare assert cond, msg AssertionError: Arrays are not equal (mismatch 100.0%) x: array([16909060, 84281096]) y: array([ 67305985, 134678021]) == FAIL: test_keywords (numpy.core.tests.test_multiarray.TestView) -- Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/core/tests/test_multiarray.py, line 852, in test_keywords assert_array_equal(y,[[513]]) File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/testing/utils.py, line 248, in assert_array_equal verbose=verbose, header='Arrays are not equal') File /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/numpy/testing/utils.py, line 240, in assert_array_compare assert cond, msg AssertionError: Arrays are not equal (mismatch 100.0%) x: array([[258]], dtype=int16) y: array([[513]]) -- Ran 1004 tests in 2.569s FAILED (failures=2) ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test
On May 19, 2008, at 4:38 PM, Robert Kern wrote: On Mon, May 19, 2008 at 3:35 PM, Robert Kern [EMAIL PROTECTED] wrote: Endianness issues. Probably bugs in the code. By which I meant test code. numpy itself is fine and is working correctly. The tests themselves incorrectly assume little-endianness. I am just a silent newbie of the numpy list, so I hope that someone will put this in as a ticket if it is warranted :) Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] numpy release
I think a long term strategy needs to be adopted for histogram. Right now there is a great confusion in what the bins keyword does. Right now it is defined as the lower edge of each bin, meaning that the last bin is open ended and [inf,bin0 does not exist. While this may not be the right thing to fix in 1.1.0, I would really like to see it fixed somewhere down the line. On Apr 24, 2008, at 10:28 AM, Pauli Virtanen wrote: Wed, 23 Apr 2008 16:20:41 -0400, David Huard wrote: I haven't found a way to fix histogram reliably without breaking the current behavior. There is a patch attached to the ticket, if the decision is to break histogram. Summary of the facts (again...): a) histogram's docstring does not match its behavior wrt discarding data This is an easy fix and should definitively go into 1.1.0 :) b) given variable-width bins, histogram(..., normed=True) the results are wrong Also a quick fix that should be part of 1.1.0 c) it might make more sense to handle discarding data in some other way than what histogram does now I would like to see this, but it does not have to happen in 1.1.0 :) I think there are now a couple of choices what to do with this: A) Change the semantics of histogram function. Old code using histogram will just simply break, maybe in mysterious ways Not really a satisfactory approach. I really don't mind, even though it would break some code of mine. I would rather see a better function and have to do some code changes, than the current confusion. Other people will likely disagree. B) Rename the bins parameter to bin_edges or something else, so that any old code using histogram immediately raises an exception that is easily understood. Given this approach bin_edges would contain one more value than bins given that the right edge of the last bin has to be defined. C) Create a new parameter with more sensible behavior and a name different from bins, and deprecate (at least giving sequences to) the bins parameter: put up a DeprecationWarning if the user does this, but still produce the same results as the old histogram. This way the user can forward-port her code at leisure. I think this is probably the best approach to accommodate everyone. So which one (or something else) do we choose for 1.1.0? -- Pauli Virtanen Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram
On Apr 7, 2008, at 4:14 PM, LB wrote: +1 for axis and +1 for a keyword to define what to do with values outside the range. For the keyword, ather than 'outliers', I would propose 'discard' or 'exclude', because it could be used to describe the four possibilities : - discard='low' = values lower than the range are discarded, values higher are added to the last bin - discard='up' = values higher than the range are discarded, values lower are added to the first bin - discard='out' = values out of the range are discarded - discard=None= values outside of this range are allocated to the closest bin For the default behavior, most of the case, the sum of the bins 's population should be equal to the size of the original one for me, so I would prefer discard=None. But I'm also okay with discard='low' in order not to break older code, if this is clearly stated. It seems that people in this discussion are forgetting that the bins are actually defined by the lower boundaries supplied, such that bins = [1,3,5] actually currently means bin1 - 1 to 2.9... bin2 - 3 to 4.9... bin3 - 5 to inf (of course in version 1.0.1 the documentation is inconsistent with the behavior as described by the original poster). This definition of bins makes it hard to exclude values as it forces the user to give an extra value in the bin definition, i.e. the bins statement above only give two bins, while supplying three values. That seems confusing to me. I am not sure what the right approach is, but currently using range will clip the values outside the number the user wants. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram
On Apr 5, 2008, at 2:01 PM, Bruce Southey wrote: Hi, I have been investigating Ticket #605 'Incorrect behavior of numpy.histogram' (http://scipy.org/scipy/numpy/ticket/605 ). I think that my preference depends on the definition of what the bin number means. If the bin numbers are the lower bounds of the bins (numpy default behavior) then it would make little sense to exclude anything above the largest bin. I don't have access to numpy on my laptop at the moment, so I can't remember wether numpy has a keyword for what the bins array is defining? Having this as a keyword of (lower,middle,upper) of the bin would be very helpful. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Warnings
How can I get the line number of where a numpy warning message is envoked in my code? Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Getting subarray
I have two arrays: a = numpy.array([0,1,2,3,4,5,6,7,8,9]) b = numpy.array([0,0,1,1,2,2,0,1,2,3]) I would like to get the part of a that corresponds to where b is equal to i. For example: i = 0 = ([0,1,6]) i = 1 = ([2,3,7]) Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Import problem
I am trying to import scipy.optimize on my Mac OS X PowerPc and get this error [EMAIL PROTECTED] Python/Astronomy -- python ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on Python 2.4.3 (#1, Apr 3 2006, 18:07:18) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type help, copyright, credits or license for more information. import scipy.optimize Traceback (most recent call last): File stdin, line 1, in ? File /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/optimize/__init__.py, line 7, in ? from optimize import * File /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/optimize/optimize.py, line 26, in ? import linesearch File /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/optimize/linesearch.py, line 3, in ? import minpack2 ImportError: Failure linking new module: /Library/Frameworks/ Python.framework/Versions/Current/lib/python2.4/site-packages/scipy/ optimize/minpack2.so: Library not loaded: /usr/local/lib/libg2c.0.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/ Current/lib/python2.4/site-packages/scipy/optimize/minpack2.so Reason: image not found How do I get a hold of libg2c.0.dylib for my system? Cheers Tommy ___ Numpy-discussion mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Import problem
Where did you get the scipy binary from? I was using the superpack from the scipy.org downloads page. I however found the library bundle up with g77 and downloaded that so now I get the import to work. I expect that there might be other libraries I am missing but I will have to deal with that as I go along. Cheers Tommy ___ Numpy-discussion mailing list [EMAIL PROTECTED] http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] lsq problem
I need to fit a gaussian profile to a set of points and would like to use scipy (or numpy) to do the least square fitting if possible. I am however unsure if the proper routines are available, so I thought I would ask to get some hints to get going in the right direction. The input are two 1-dimensional arrays x and flux, together with a function def Gaussian(a,b,c,x1): return a*exp(-(pow(x1,2)/pow(c,2))) - c I would like to find the values of (a,b,c), such that the difference between the gaussian and fluxes are minimalized. Would scipy.linalg.lstsq be the right function to use, or is this problem not linear? (I know I could find out this particular problem with a little research, but I am under a little time pressure and I can not for the life of me remember my old math classes). If the problem is not linear, is there another function that can be used or do I have to code up my own lstsq function to solve the problem? Thanks in advance for any hints to the answers. Cheers Tommy ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion