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: Peter B. <Pet...@ug...> - 2006-09-26 08:20:45
|
Hi, Not sure if this is a numpy or a matplotlib issue, but I can't seem to get= =20 matplotlib-0.87.5 to work with numpy1.0rc: Python 2.4.3 (#1, Sep 21 2006, 13:06:42) [GCC 4.1.1 (Gentoo 4.1.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pylab import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196, in= ? import cm File "/usr/lib/python2.4/site-packages/matplotlib/cm.py", line 5, in ? import colors File "/usr/lib/python2.4/site-packages/matplotlib/colors.py", line 33, in= ? from numerix import array, arange, take, put, Float, Int, where, \ File "/usr/lib/python2.4/site-packages/matplotlib/numerix/__init__.py", l= ine=20 74, in ? Matrix =3D matrix NameError: name 'matrix' is not defined This is on an AMD64 platform. I tried removing the build directories of bot= h=20 packages, and reinstalling, but that didn't work. I also posted this to the matplotlib list, but got no reply. Thanks! Peter |
From: <lis...@ma...> - 2006-09-25 19:04:42
|
Ignore this query -- silly mistake on my part. Sorry. On Sep 25, 2006, at 2:30 PM, lis...@ma... wrote: > I've just tried building RC1 on OSX 10.4 (Intel), and it fails > almost immediately. This did not fail in the past with beta5 or > from SVN: > > Osoyoos:~/Development/numpy-1.0rc1 chris$ python setup.py build > Running from numpy source directory. > F2PY Version 2_3198 > blas_opt_info: > FOUND: > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] > define_macros = [('NO_ATLAS_INFO', 3)] > extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/ > vecLib.framework/Headers'] > > lapack_opt_info: > FOUND: > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] > define_macros = [('NO_ATLAS_INFO', 3)] > extra_compile_args = ['-msse3'] > > running build > running config_fc > running build_src > building py_modules sources > creating build > creating build/src.darwin-8.7.1-i386-2.4 > creating build/src.darwin-8.7.1-i386-2.4/numpy > creating build/src.darwin-8.7.1-i386-2.4/numpy/distutils > building extension "numpy.core.multiarray" sources > creating build/src.darwin-8.7.1-i386-2.4/numpy/core > Generating build/src.darwin-8.7.1-i386-2.4/numpy/core/config.h > customize NAGFCompiler > customize AbsoftFCompiler > customize IbmFCompiler > Could not locate executable g77 > Could not locate executable f77 > Could not locate executable f95 > customize GnuFCompiler > customize Gnu95FCompiler > customize Gnu95FCompiler > customize Gnu95FCompiler using config > C compiler: gcc -fno-strict-aliasing -Wno-long-double -no-cpp- > precomp -mno-fused-madd -fPIC -fno-common -dynamic -DNDEBUG -g -O3 - > Wall -Wstrict-prototypes > > compile options: '-I/Library/Frameworks/Python.framework/Versions/ > 2.4/include/python2.4 -Inumpy/core/src -Inumpy/core/include -I/ > Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c' > gcc: _configtest.c > gcc: installation problem, cannot exec `cc1': No such file or > directory > gcc: installation problem, cannot exec `cc1': No such file or > directory > failure. > removing: _configtest.c _configtest.o > Traceback (most recent call last): > File "setup.py", line 89, in ? > setup_package() > File "setup.py", line 82, in setup_package > configuration=configuration ) > File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ > core.py", line 174, in setup > return old_setup(**new_attr) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/core.py", line 149, in setup > dist.run_commands() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/dist.py", line 946, in run_commands > self.run_command(cmd) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/dist.py", line 966, in run_command > cmd_obj.run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/command/build.py", line 112, in run > self.run_command(cmd_name) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/cmd.py", line 333, in run_command > self.distribution.run_command(command) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/dist.py", line 966, in run_command > cmd_obj.run() > File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ > command/build_src.py", line 87, in run > self.build_sources() > File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ > command/build_src.py", line 106, in build_sources > self.build_extension_sources(ext) > File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ > command/build_src.py", line 212, in build_extension_sources > sources = self.generate_sources(sources, ext) > File "/Users/chris/Development/numpy-1.0rc1/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 > > -- > Christopher Fonnesbeck > + Atlanta, GA > + fonnesbeck at mac.com > + Contact me on AOL IM using email address > > -- Christopher Fonnesbeck + Atlanta, GA + fonnesbeck at mac.com + Contact me on AOL IM using email address |
From: Robert K. <rob...@gm...> - 2006-09-25 19:00:10
|
lis...@ma... wrote: > I've just tried building RC1 on OSX 10.4 (Intel), and it fails almost > immediately. This did not fail in the past with beta5 or from SVN: It looks like a problem on your end: > gcc: installation problem, cannot exec `cc1': No such file or directory Can you build anything else with gcc? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: <lis...@ma...> - 2006-09-25 18:29:45
|
I've just tried building RC1 on OSX 10.4 (Intel), and it fails almost immediately. This did not fail in the past with beta5 or from SVN: Osoyoos:~/Development/numpy-1.0rc1 chris$ python setup.py build Running from numpy source directory. F2PY Version 2_3198 blas_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/ vecLib.framework/Headers'] lapack_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)] extra_compile_args = ['-msse3'] running build running config_fc running build_src building py_modules sources creating build creating build/src.darwin-8.7.1-i386-2.4 creating build/src.darwin-8.7.1-i386-2.4/numpy creating build/src.darwin-8.7.1-i386-2.4/numpy/distutils building extension "numpy.core.multiarray" sources creating build/src.darwin-8.7.1-i386-2.4/numpy/core Generating build/src.darwin-8.7.1-i386-2.4/numpy/core/config.h customize NAGFCompiler customize AbsoftFCompiler customize IbmFCompiler Could not locate executable g77 Could not locate executable f77 Could not locate executable f95 customize GnuFCompiler customize Gnu95FCompiler customize Gnu95FCompiler customize Gnu95FCompiler using config C compiler: gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fPIC -fno-common -dynamic -DNDEBUG -g -O3 -Wall - Wstrict-prototypes compile options: '-I/Library/Frameworks/Python.framework/Versions/2.4/ include/python2.4 -Inumpy/core/src -Inumpy/core/include -I/Library/ Frameworks/Python.framework/Versions/2.4/include/python2.4 -c' gcc: _configtest.c gcc: installation problem, cannot exec `cc1': No such file or directory gcc: installation problem, cannot exec `cc1': No such file or directory failure. removing: _configtest.c _configtest.o Traceback (most recent call last): File "setup.py", line 89, in ? setup_package() File "setup.py", line 82, in setup_package configuration=configuration ) File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ core.py", line 174, in setup return old_setup(**new_attr) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ command/build_src.py", line 87, in run self.build_sources() File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ command/build_src.py", line 106, in build_sources self.build_extension_sources(ext) File "/Users/chris/Development/numpy-1.0rc1/numpy/distutils/ command/build_src.py", line 212, in build_extension_sources sources = self.generate_sources(sources, ext) File "/Users/chris/Development/numpy-1.0rc1/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 -- Christopher Fonnesbeck + Atlanta, GA + fonnesbeck at mac.com + Contact me on AOL IM using email address |
From: Travis O. <oli...@ee...> - 2006-09-25 17:42:09
|
Francesc Altet wrote: >El dl 25 de 09 del 2006 a les 11:08 -0600, en/na Travis Oliphant va >escriure: > > >>Francesc Altet wrote: >> >> >> >>>Hi, >>> >>>Anybody know if there is a map between NumPy types and Numeric >>>typecodes? Something like 'typecodes' for numarray: >>> >>> Oh, you mean actual Numeric typecodes, not Numeric-like typecodes :-) dtype(obj).char will not work for the Numeric typecodes that changed, set up a dictionary-like object which uses dtype(obj).char on all but the ones that changed is my suggestion. See the core/numerictypes.py module for dictionary-like objects. Perhaps this would be a good thing to add to numpy/oldnumeric 'b' --> 'B' '1' --> 'b' 's' --> 'h' 'w' --> 'H' 'u' --> 'I' -Travis |
From: Francesc A. <fa...@ca...> - 2006-09-25 17:18:21
|
El dl 25 de 09 del 2006 a les 11:08 -0600, en/na Travis Oliphant va escriure: > Francesc Altet wrote: >=20 > >Hi, > > > >Anybody know if there is a map between NumPy types and Numeric > >typecodes? Something like 'typecodes' for numarray: > > =20 > > > How about >=20 > dtype(obj).char? This doesn't work for many types: >>> Numeric.array([1], typecode=3Dnumpy.dtype('int32').char) array([1]) this is fine, but: >>> Numeric.array([1], typecode=3Dnumpy.dtype('int16').char) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: typecode argument must be a valid type. >>> Numeric.array([1], typecode=3Dnumpy.dtype('int64').char) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: typecode argument must be a valid type. Anyway, this is not very important as I can do my own map internally. Thanks, --=20 >0,0< Francesc Altet http://www.carabos.com/ V V C=C3=A1rabos Coop. V. Enjoy Data "-" |
From: Travis O. <oli...@ee...> - 2006-09-25 17:09:13
|
Francesc Altet wrote: >Hi, > >Anybody know if there is a map between NumPy types and Numeric >typecodes? Something like 'typecodes' for numarray: > > How about dtype(obj).char? -Travis |
From: Francesc A. <fa...@ca...> - 2006-09-25 16:47:45
|
Hi, Anybody know if there is a map between NumPy types and Numeric typecodes? Something like 'typecodes' for numarray: >>> numarray.typecode {'UInt64': 'U', 'Int32': 'i', 'Int16': 's', 'Float64': 'd', 'Object': 'O', 'UInt8': 'b', 'UInt32': 'u', 'Complex64': 'D', 'UInt16': 'w', 'Bool': 'B', 'Complex32': 'F', 'Int64': 'N', 'Int8': '1', 'Float32': 'f'} Thanks, --=20 >0,0< Francesc Altet http://www.carabos.com/ V V C=C3=A1rabos Coop. V. Enjoy Data "-" |
From: Travis O. <oli...@ie...> - 2006-09-25 16:28:01
|
Christopher Hanley wrote: > Hi, > > Change set 3213 changed the data type printing with an array from > something like dtype=int64 to dtype='int64'. Although this is a small > cosmetic change it has broken all of the doctests I have written for > numpy code. I was changing the way dtypes print and this was an unexpected consequence. It has been restored. Please try r3215 -Travis |
From: Francesc A. <fa...@ca...> - 2006-09-25 15:23:15
|
Hi, I have been bitten by a subtlety in numpy scalar divisions. The next exposes the issue: >>> -1/20 -1 >>> Numeric.array([-1])[0] / Numeric.array([20])[0] -1 >>> numarray.array([-1])[0] / numarray.array([20])[0] -1 >>> numpy.array([-1])[0] / numpy.array([20])[0] 0 After some digging, I've found that Python and C follow different conventions for doing this negative division: Python do a floor of the result, while C truncates it. As numpy scalar operations seems to be implemented in C, it seems that it follows the C convention and truncates the result. In fact, I like this behaviour of NumPy scalars (at least, when I'm aware of it!), but I thought it would be nice to warn other people about that. Cheers, --=20 >0,0< Francesc Altet http://www.carabos.com/ V V C=C3=A1rabos Coop. V. Enjoy Data "-" |
From: Matthew B. <mat...@gm...> - 2006-09-25 14:35:23
|
Hi, I am sorry if I have missed anything obvious here, but is there a fast simple way to downcast an array to the smallest storage that hold array data within a specified precision - e.g. a = array([1.0]) small_a = fantasy_function(a, rtol=1.0000000000000001e-05, atol=1e-08 ) b = array([1.2]) small_b = fantasy_function(b, tol=1.0000000000000001e-05, atol=1e-08) where a.dtype becomes, say, uint8, and b.dtype becomes float32? Thanks a lot, Matthew |
From: <mi...@ya...> - 2006-09-25 14:10:21
|
:―― INFORMATION ―――――――――――――――――――――――――: 不正・悪質なサイトを一切排除しておりますので 安心してご利用ください。 http://love-match.bz/pc/?09 :――――――――――――――――――――――――――――――――――: *・゜゜・*:.。. .。.:*・゜゜・*:.。..。:*・゜゜・*:.。..。:**・゜゜・* お金と時間を持て余している人妻の間で、噂になってるあのサイト [登録・利用料全て無料] http://love-match.bz/pc/?09 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ □■ 不倫・ワリキリ専門の無料出会いサイト『Love☆Match』 ----------------------------------------------------------------- 登録料・利用料 ・・・・・・・・・【無料】 メールの送受信 ・・・・・・・・・【無料】 ユーザーの検索 ・・・・・・・・・【無料】 掲示板の閲覧・書込み ・・・・・・【無料】 画像交換・アップロード ・・・・・【無料】 アドレス交換・電話番号交換 ・・・【無料】 ----------------------------------------------------------------- どれだけ使っても全て無料! http://love-match.bz/pc/?09 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ □■ いつでも女性ユーザーがいっぱい。その理由は? ----------------------------------------------------------------- PC&モバイルに対応!いつでもどこでも気軽に楽しめる! ----------------------------------------------------------------- 仕事中は携帯電話から、プライベートは自宅からのんびりと。 気になる相手といつでも繋がっているから、新密度も急速にUP。 http://love-match.bz/pc/?09 ----------------------------------------------------------------- PCから簡単プロフィール作成。ネット初心者でもラクラク参加OK ----------------------------------------------------------------- 面倒な登録は一切不要。パソコンから簡単なプロフィールを作成して 初心者の方や女性でもすぐに参加できます。 http://love-match.bz/pc/?09 ----------------------------------------------------------------- 自由恋愛対応!直電・直メ交換支援ツール ----------------------------------------------------------------- 基本的にメールアドレスや電話番号は非公開ですが 仲良くなった人だけにメールアドレスや電話番号を教える事ができます。 http://love-match.bz/pc/?09 ----------------------------------------------------------------- 写真アップロードに対応!好みの相手を素早くCHECK! ----------------------------------------------------------------- 待ち合わせ場所にイメージとまったく違う人が来たら…。 ピュアックスなら会う前に写真交換ができるから、そんな不安も解消。 http://love-match.bz/pc/?09 ----------------------------------------------------------------- スレッド掲示板で秘密のパートナー検索も効率UP! ----------------------------------------------------------------- メインの掲示板のほかにスレッド型の掲示板を設置。 メル友から秘密のパートナーまで目的別のユーザーが集う掲示板です。 http://love-match.bz/pc/?09 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ □■ 毎日500人近くのユーザーが続々参加中!! □----------------------------------------------------------------- リエ(21歳/会社員) いつも1人でエッチなことを考えてます。 メールだといろいろ話せるんだけど、実際に会うとあまりしゃべれなく なっちゃうので、盛り上げてくれるような楽しい男の人いないかな? 引っ込み思案のせいか、男性経験はあまり無いんです。 優しく&楽しくリードしてくれる男性からのメール待ってます。 [写真有り] http://love-match.bz/pc/?09 □----------------------------------------------------------------- 真菜(24歳/フリーター) 彼氏が浮気してて超アタマきたっ!まなだって遊びたい盛りだし、ずっと ガマンしてたのにさ!かっこいい人見つけて思いっきりふってやるつもりで 登録してみた(笑) [写真有り] http://love-match.bz/pc/?09 □----------------------------------------------------------------- みさ(34歳/専業主婦) 殆ど家に帰ってこない仕事人間のだんなさまと二人きりの毎日で、ほんと 寂しい思いをしています。年下の男の子がいれば仲良くなりたいな。 年下の人とは付き合ったことがないので興味津々です(^^) [写真無し] http://love-match.bz/pc/?09 □----------------------------------------------------------------- 恭子(28歳/会社員) 彼氏とはいつも同じようなセックスばかりでかなり冷め気味です。 誰かあたしと熱いセックスを楽しみませんか?めんどくさい事は 言いません。ただ、いつもと違うドキドキするような事がしたい だけなんです。 [写真無し] http://love-match.bz/pc/?09 □----------------------------------------------------------------- ななこ(28歳/主婦) 半年前にだんなと別れて今は×1です。 夜のお仕事なので、昼間まったりと過ごしませんか? 心身ともに疲れ気味で、今、激しく癒されたいです。 [写真有り] http://love-match.bz/pc/?09 □----------------------------------------------------------------- 祥子(31歳/クリエイター) 平日は18時くらいまでは大体仕事してるので、その後に食事したり 楽しく飲んだりできるパートナー希望です。年上でも年下でも かまいませんので気軽にメールを送って頂けると嬉しいです。 [写真有り] http://love-match.bz/pc/?09 □----------------------------------------------------------------- ゅヵ`(20歳/学生) まずゎ会ってみないとはじまらなぃょね?! 横浜近辺の人で、いろんな意味でオトナな人は プロフ付きでめぇる送って☆ [写真有り] http://love-match.bz/pc/?09 □----------------------------------------------------------------- 出会いサイトのサクラに騙されないように↓ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ 【裏】無料の出会い情報 ------------------------------------------------------------- お金と時間を持て余している人妻の間で、噂になってるあのサイト [登録・利用料全て無料] http://love-match.bz/pc/?09 ------------------------------------------------------------- 彼女達が求めているのはこんな男性です。 ?年上女性にリードしてもらいたい、経験少なめの男性 ?体力・テクニックに自信が有る男性 男性会員が不足しています。我こそは、と思う方は今すぐ参加! [登録・利用料全て無料] http://love-match.bz/pc/?09 ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 広東省茂名市人民大街3-6-4-533 友誼網絡公司 139-3668-7892 |
From: Christopher H. <ch...@st...> - 2006-09-25 12:38:40
|
Hi, Change set 3213 changed the data type printing with an array from something like dtype=int64 to dtype='int64'. Although this is a small cosmetic change it has broken all of the doctests I have written for numpy code. I expect that I am not the only person this change has caught. Please restore the previous behavior until after the 1.0 release at least. Thank you, Chris |
From: Ivan V. i B. <iv...@ca...> - 2006-09-25 12:01:23
|
Hi all, these are just a couple of small fixes to the string support in Numexpr, and a test case for the string copy operation. For the base patches: 1.http://www.mail-archive.com/num...@li.../msg01551.html 2.http://www.mail-archive.com/num...@li.../msg02261.html Cheers, :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ Cárabos Coop. V. V V Enjoy Data "" |
From: A. M. A. <per...@gm...> - 2006-09-25 04:40:34
|
On 25/09/06, Angus McMorland <am...@gm...> wrote: > Hi all, > > Can someone explain why the following occurs? > > a = numpy.zeros((100)) > b = numpy.ones((10)) > a[20:30] = b # okay > eval('a[50:60] = b') # raises SyntaxError: invalid syntax > > Is there some line mangling that the interpretor does that eval doesn't do? No. Eval evaluates expressions, that is, formulas producing a value. "a=b" does not produce a value, so you are obtaining the same error you would if you'd written if a=b: ... The way you run code that doesn't return a value is with "exec". A. M. Archibald |
From: Angus M. <am...@gm...> - 2006-09-25 04:37:36
|
Hi all, Can someone explain why the following occurs? a = numpy.zeros((100)) b = numpy.ones((10)) a[20:30] = b # okay eval('a[50:60] = b') # raises SyntaxError: invalid syntax Is there some line mangling that the interpretor does that eval doesn't do? I see there's room for global and local parameters to eval. Would setting one of those be the answer? Cheers, Angus. -- AJC McMorland, PhD Student Physiology, University of Auckland Armourer, Auckland University Fencing Secretary, Fencing North Inc. |
From: Bill B. <wb...@gm...> - 2006-09-25 02:04:19
|
Hmm. Yes maybe a shift w/fill would be useful too. I can't recall needing such a thing, but it could probably also be implemented easily in a way similar to roll() above. A multi-axis roll might also be nice. Could just allow roll's shiftby and axis args to be tuples. Looking closer at the existing 'rollaxis', numpy.rollaxis(a, axis, start=0) if a.shape is (3,4,5,6) rollaxis(a, 3, 1).shape is (3,6,4,5) rollaxis(a, 2, 0).shape is (5,3,4,6) rollaxis(a, 1, 3).shape is (3,5,4,6) rollaxis(a, 1, 4).shape is (3,5,6,4) it occurs to me that what it is actually doing is not what we've been calling 'rolling'. It's just a move, really (remove value from one place and re-insert in another). So perhaps the name should be 'moveaxis' instead? --bb On 9/25/06, Alan G Isaac <ai...@am...> wrote: > On Mon, 25 Sep 2006, Bill Baxter apparently wrote: > > Went ahead and added an enhancement request: > > http://projects.scipy.org/scipy/numpy/ticket/293 > > This is something I've wanted in the past too. > > > GAUSS draws a useful distinction between "shifting" and > "rotating": > > Works roughly like this for the 2D case: > > #rotater: rotate row elements > # Format: y = rotater(x,r) > # rotater(x,r) > # Input: x RxK array > # rotateby size R integer array, or integer (rotation amounts) > # Output: y RxK array: > # rows rotated by rotateby > > #shiftr: shift row elements and fill with fv > # Format: y = shiftr(x,shiftby,fv) > # Input: x RxC array > # shiftby Rx1 array or scalar (shift amounts) > # fv Rx1 array or scalar (fill values) > # Output: y RxC array: > # rows shifted by shiftby > # rows filled with fill > > fwiw, > Alan Isaac |
From: Alan G I. <ai...@am...> - 2006-09-25 01:40:22
|
On Mon, 25 Sep 2006, Bill Baxter apparently wrote: > Went ahead and added an enhancement request: > http://projects.scipy.org/scipy/numpy/ticket/293 > This is something I've wanted in the past too. GAUSS draws a useful distinction between "shifting" and "rotating": Works roughly like this for the 2D case: #rotater: rotate row elements # Format: y = rotater(x,r) # rotater(x,r) # Input: x RxK array # rotateby size R integer array, or integer (rotation amounts) # Output: y RxK array: # rows rotated by rotateby #shiftr: shift row elements and fill with fv # Format: y = shiftr(x,shiftby,fv) # Input: x RxC array # shiftby Rx1 array or scalar (shift amounts) # fv Rx1 array or scalar (fill values) # Output: y RxC array: # rows shifted by shiftby # rows filled with fill fwiw, Alan Isaac |
From: Bill B. <wb...@gm...> - 2006-09-25 01:12:45
|
Went ahead and added an enhancement request: http://projects.scipy.org/scipy/numpy/ticket/293 This is something I've wanted in the past too. --bb On 9/25/06, Charles R Harris <cha...@gm...> wrote: > > > On 9/24/06, Bill Baxter <wb...@gm...> wrote: > > Howdy Angus, > > Yeh, that does seem like a hole in the API. Travis added a rollaxis() > > but there's still no simple way to roll the elements themselves. > > > > I took a look at numpy.fft.fftshift, which is a function that has to > > do a similar thing. It does it by concatenating aranges and then > > doing a take(). Presumably Pearu knew what he was doing when he wrote > > that, so we can assume this is probably close to the best possible. > > :-) From that idea here's a function that implements roll(). > > > > def roll(y,shift,axis): > > """Roll the elements in the array by 'shift' positions along the > > given axis.""" > > from numpy import asanyarray,concatenate,arange > > y = asanyarray(y) > > n = y.shape[axis] > > shift %= n # does the right thing for negative shifts, too > > return > y.take(concatenate((arange(shift,n),arange(shift))), axis) > > It is possible to do a shift inplace using two reflections implemented with > swaps. This works because two reflections is the same as a rotating twice > the distance between the centers of the reflections. I don't know if it is > worth implementing this, however. > > Chuck |
From: Charles R H. <cha...@gm...> - 2006-09-25 00:51:26
|
On 9/24/06, Bill Baxter <wb...@gm...> wrote: > > Howdy Angus, > Yeh, that does seem like a hole in the API. Travis added a rollaxis() > but there's still no simple way to roll the elements themselves. > > I took a look at numpy.fft.fftshift, which is a function that has to > do a similar thing. It does it by concatenating aranges and then > doing a take(). Presumably Pearu knew what he was doing when he wrote > that, so we can assume this is probably close to the best possible. > :-) From that idea here's a function that implements roll(). > > def roll(y,shift,axis): > """Roll the elements in the array by 'shift' positions along the > given axis.""" > from numpy import asanyarray,concatenate,arange > y = asanyarray(y) > n = y.shape[axis] > shift %= n # does the right thing for negative shifts, too > return y.take(concatenate((arange(shift,n),arange(shift))), axis) It is possible to do a shift inplace using two reflections implemented with swaps. This works because two reflections is the same as a rotating twice the distance between the centers of the reflections. I don't know if it is worth implementing this, however. Chuck |
From: Bill B. <wb...@gm...> - 2006-09-25 00:44:25
|
Howdy Angus, Yeh, that does seem like a hole in the API. Travis added a rollaxis() but there's still no simple way to roll the elements themselves. I took a look at numpy.fft.fftshift, which is a function that has to do a similar thing. It does it by concatenating aranges and then doing a take(). Presumably Pearu knew what he was doing when he wrote that, so we can assume this is probably close to the best possible. :-) From that idea here's a function that implements roll(). def roll(y,shift,axis): """Roll the elements in the array by 'shift' positions along the given axis.""" from numpy import asanyarray,concatenate,arange y = asanyarray(y) n = y.shape[axis] shift %= n # does the right thing for negative shifts, too return y.take(concatenate((arange(shift,n),arange(shift))), axis) Performance is only very slightly worse (<1%) using return y.take(r_[shift:n, :shift], axis) as the last line, which is maybe slightly more readable if you're down wit' the r_. I prefer the name 'roll' because: a) there's already rollaxis with conceptually similar behavior and b) 'shift' is used in other languages (perl comes to mind) sometimes to indicate shifting off the end, possibly filling in with zeros or just leaving the array shorter. c) 'rotate' seems potentially confusing given the existence of the 'rot90' function already. --bb On 9/25/06, Angus McMorland <am...@gm...> wrote: > Hi all, > > Other data languages that I have worked with have a routine for shifting > data along axes, with wrapping. > In IDL it's called 'shift', and works such that > print, a > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > > print, shift(a, 2, 0) > 2 3 0 1 > 6 7 4 5 > 10 11 8 9 > > print, shift(a, 2, 1) > 10 11 8 9 > 2 3 0 1 > 6 7 4 5 > > In pdl (pdl.perl.org) the equivalent routine is called rotate. Is there a > version of this in numpy, or can it be easily achieved using existing > technology - I could do it with multiple sliced assignment statements but > that seems very clunky and likely slow. I've looked through the examples and > the numpy book but without success. > > Angus. |
From: Angus M. <am...@gm...> - 2006-09-24 23:32:23
|
Hi all, Other data languages that I have worked with have a routine for shifting data along axes, with wrapping. In IDL it's called 'shift', and works such that print, a 0 1 2 3 4 5 6 7 8 9 10 11 print, shift(a, 2, 0) 2 3 0 1 6 7 4 5 10 11 8 9 print, shift(a, 2, 1) 10 11 8 9 2 3 0 1 6 7 4 5 In pdl (pdl.perl.org) the equivalent routine is called rotate. Is there a version of this in numpy, or can it be easily achieved using existing technology - I could do it with multiple sliced assignment statements but that seems very clunky and likely slow. I've looked through the examples and the numpy book but without success. Angus. -- AJC McMorland, PhD Student Physiology, University of Auckland Armourer, Auckland University Fencing Secretary, Fencing North Inc. |
From: Matthew B. <mat...@gm...> - 2006-09-23 19:16:01
|
> So, you can think of the test as > > if dtype(...): > print "Data-type has fields:" > else: > print "Data-type does not have fields:" Thank you as ever for your very clear and helpful explanation, Best, Matthew |
From: Travis O. <oli...@ie...> - 2006-09-23 18:42:05
|
Matthew Brett wrote: > Hi, > > Forgive my ignorance, but why is this? > > In [1]:from numpy import * > > In [2]:if not dtype('<f8'): > ...: print 'Truth value is no' > ...: > ...: > Truth value is no > Truth value of user-built Python objects is tested by looking at: 1) __nonzero__ method is called to determine truth value. 2) sequence or mapping behavior (then the length is used. If the length is greater than 0, then True, otherwise it's False. For data-type objects, there is no __nonzero__ method, but it does have "mapping" behavior so that fields can be extracted from a data-type using mapping notation. The "length" of the data-type is the number of defined fields. Therefore, if the data-type has no defined fields, it's length is 0 and it's truth value is "False". So, you can think of the test as if dtype(...): print "Data-type has fields:" else: print "Data-type does not have fields:" -Travis |
From: Bill B. <wb...@gm...> - 2006-09-23 16:03:14
|
Here's a new version of 'reparray'. I tested the previous version against 'repmat' for the 2d case and found it to be as much as 3x slower in some instances. Ick. So I redid it using the approach repmat uses -- reshape() and repeat() rather than concatenate(). Now it's very nearly as fast as repmat for the 2-d case. def reparray(A, tup): if numpy.isscalar(tup): tup = (tup,) d = len(tup) c = numpy.array(A,copy=False,subok=True,ndmin=d) shape = list(c.shape) n = c.size for i, nrep in enumerate(tup): if nrep!=1: c = c.reshape(-1,n).repeat(nrep,0) dim_in = shape[i] dim_out = dim_in*nrep shape[i] = dim_out n /= dim_in return c.reshape(shape) The full file with tests and timing code is attached. One thing I noticed while doing this was that repmat doesn't preserve subclasses. Which is funny considering 'mat' is part of the name and it only works on 2-d arrays. Using asanyarray() instead of asarray() in the first line should fix that. --Bill |