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: <ar...@st...> - 2006-11-04 22:32:18
|
Siterer Robert Kern <rob...@gm...>: > ar...@st... wrote: >> Hi, >> >> I'm sorry if this might seem like a stupid question to some of you, >> but I have been struggling for the better part of the afternoon trying >> to install NumPy on my G4 iBook, so I hope somebody can take the time >> to lend me a helping hand. I have searched a little in the mail >> archives and tried to follow the instructions on this page: >> http://www.scipy.org/Installing_SciPy/Mac_OS_X > > Note that these are instructions for installing scipy, so there is a =20 > lot there > that you don't need to do just to install numpy. Notably, some of the thin= gs > that you are having problems with. I did get the impression that it was kind of an overkill... >> After that I didn't really expect the installation of NumPy to work, >> but I got a "permission denied"-error message that I'm not so sure is >> connected to the missing FFW. > > You probably tried to run a previous build or install as root. =20 > Delete the build/ > directory (probably as root) and try another build as a regular =20 > user. Don't use > root until you actually want to install (and then, only if you need to). That got the installation a lot further, but it still halts with an =20 error message, this time about failing to test the configuration. Arild N=E6ss =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=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 % python setup.py build Running from numpy source directory. F2PY Version 2_3396 blas_opt_info: FOUND: extra_link_args =3D ['-Wl,-framework', '-Wl,Accelerate'] define_macros =3D [('NO_ATLAS_INFO', 3)] extra_compile_args =3D ['-faltivec', =20 '-I/System/Library/Frameworks/vecLib.framework/Headers'] lapack_opt_info: FOUND: extra_link_args =3D ['-Wl,-framework', '-Wl,Accelerate'] define_macros =3D [('NO_ATLAS_INFO', 3)] extra_compile_args =3D ['-faltivec'] running build running config_fc running build_src building py_modules sources creating build creating build/src.macosx-10.3-fat-2.5 creating build/src.macosx-10.3-fat-2.5/numpy creating build/src.macosx-10.3-fat-2.5/numpy/distutils building extension "numpy.core.multiarray" sources creating build/src.macosx-10.3-fat-2.5/numpy/core Generating build/src.macosx-10.3-fat-2.5/numpy/core/config.h customize NAGFCompiler customize AbsoftFCompiler customize IbmFCompiler Could not locate executable g77 Could not locate executable f77 Could not locate executable gfortran Could not locate executable f95 customize GnuFCompiler customize Gnu95FCompiler customize G95FCompiler customize GnuFCompiler customize Gnu95FCompiler customize NAGFCompiler customize NAGFCompiler using config C compiler: gcc -arch ppc -arch i386 -isysroot =20 /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double =20 -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 compile options: =20 '-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 =20 -Inumpy/core/src -Inumpy/core/include =20 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 =20 -c' gcc: _configtest.c gcc: cannot specify -o with -c or -S and multiple compilations gcc: cannot specify -o with -c or -S and multiple compilations failure. removing: _configtest.c _configtest.o numpy/core/setup.py:50: DeprecationWarning: raising a string exception =20 is deprecated raise "ERROR: Failed to test configuration" Traceback (most recent call last): File "setup.py", line 89, in <module> setup_package() File "setup.py", line 82, in setup_package configuration=3Dconfiguration ) File "/Users/arildnss/Desktop/numpy-1.0/numpy/distutils/core.py", =20 line 174, in setup return old_setup(**new_attr) File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/c= ore.py", line 151, in =20 setup dist.run_commands() File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/d= ist.py", line 974, in =20 run_commands self.run_command(cmd) File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/d= ist.py", line 994, in =20 run_command cmd_obj.run() File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/c= ommand/build.py", line 112, in =20 run self.run_command(cmd_name) File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/c= md.py", line 333, in =20 run_command self.distribution.run_command(command) File =20 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/d= ist.py", line 994, in =20 run_command cmd_obj.run() File =20 "/Users/arildnss/Desktop/numpy-1.0/numpy/distutils/command/build_src.py", li= ne =20 87, in run self.build_sources() File =20 "/Users/arildnss/Desktop/numpy-1.0/numpy/distutils/command/build_src.py", li= ne =20 106, in build_sources self.build_extension_sources(ext) File =20 "/Users/arildnss/Desktop/numpy-1.0/numpy/distutils/command/build_src.py", li= ne =20 212, in build_extension_sources sources =3D self.generate_sources(sources, ext) File =20 "/Users/arildnss/Desktop/numpy-1.0/numpy/distutils/command/build_src.py", li= ne =20 270, in generate_sources source =3D 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 |
From: Robert K. <rob...@gm...> - 2006-11-04 21:59:05
|
ar...@st... wrote: > Hi, > > I'm sorry if this might seem like a stupid question to some of you, > but I have been struggling for the better part of the afternoon trying > to install NumPy on my G4 iBook, so I hope somebody can take the time > to lend me a helping hand. I have searched a little in the mail > archives and tried to follow the instructions on this page: > http://www.scipy.org/Installing_SciPy/Mac_OS_X Note that these are instructions for installing scipy, so there is a lot there that you don't need to do just to install numpy. Notably, some of the things that you are having problems with. > Python 2.5 is installed, and I have installed Apple's Developer's > Tools (i.e. the package "December 2002 Mac OS X Developer Tools"). The > GCC/G77-installation seemed to go ok. You probably can't use g77 along with Python 2.5. Python 2.5 is built with gcc 4.0 but g77 never got ported to the 4.x platform. However, it's not at all necessary for numpy. > When I try to install the FFW libraries however, I get an error > message telling me that my "C compiler cannot create executables" > (full output below). numpy does not use FFTW at all, so don't let this hold you up. If you want to troubleshoot the problem, however, look at the config.log file for more information. grep for the string "cannot create executables". > After that I didn't really expect the installation of NumPy to work, > but I got a "permission denied"-error message that I'm not so sure is > connected to the missing FFW. You probably tried to run a previous build or install as root. Delete the build/ directory (probably as root) and try another build as a regular user. Don't use root until you actually want to install (and then, only if you need to). -- 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: <ar...@st...> - 2006-11-04 21:22:27
|
Hi, I'm sorry if this might seem like a stupid question to some of you, =20 but I have been struggling for the better part of the afternoon trying =20 to install NumPy on my G4 iBook, so I hope somebody can take the time =20 to lend me a helping hand. I have searched a little in the mail =20 archives and tried to follow the instructions on this page: http://www.scipy.org/Installing_SciPy/Mac_OS_X Python 2.5 is installed, and I have installed Apple's Developer's =20 Tools (i.e. the package "December 2002 Mac OS X Developer Tools"). The =20 GCC/G77-installation seemed to go ok. When I try to install the FFW libraries however, I get an error =20 message telling me that my "C compiler cannot create executables" =20 (full output below). After that I didn't really expect the installation of NumPy to work, =20 but I got a "permission denied"-error message that I'm not so sure is =20 connected to the missing FFW. So I'm at loss... Anyone? Many thanks, Arild N=E6ss =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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D %pwd /Users/arildnss/Desktop/fftw-3.1.2 %./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking build system type... powerpc-apple-darwin8.8.0 checking host system type... powerpc-apple-darwin8.8.0 checking for gcc... gcc checking for C compiler default output file name... configure: error: =20 C compiler cannot create executables See `config.log' for more details. %pwd /Users/arildnss/Desktop/numpy-1.0 %python setup.py build Running from numpy source directory. F2PY Version 2_3396 blas_opt_info: FOUND: extra_link_args =3D ['-Wl,-framework', '-Wl,Accelerate'] define_macros =3D [('NO_ATLAS_INFO', 3)] extra_compile_args =3D ['-faltivec', =20 '-I/System/Library/Frameworks/vecLib.framework/Headers'] lapack_opt_info: FOUND: extra_link_args =3D ['-Wl,-framework', '-Wl,Accelerate'] define_macros =3D [('NO_ATLAS_INFO', 3)] extra_compile_args =3D ['-faltivec'] running build running config_fc running build_src building py_modules sources error: build/src.macosx-10.3-fat-2.5/numpy/distutils/__config__.py: =20 Permission denied |
From: Lisandro D. <da...@gm...> - 2006-11-04 21:12:07
|
On 11/4/06, Mike C. Fletcher <mcf...@vr...> wrote: > We wouldn't be able to get rid > of the abstraction mechanism entirely, as we would still have data-types > such as lists-of-lists-of-integers that wouldn't support the protocol. > Perhaps this will sound stupid, but I was thinking about extending some builtin Python types to provide datatype info. A list/tuple is an array of Python objects, an int/float/complex could return a datatype upon query. This could be very efficient if some predefined datatypes were already defined in the C-side. MPI provides predefined datatypes (MPI_INT, MPI_FLOAT) and new user-defined datatypes are created from them. --=20 Lisandro Dalc=EDn --------------- Centro Internacional de M=E9todos Computacionales en Ingenier=EDa (CIMEC) Instituto de Desarrollo Tecnol=F3gico para la Industria Qu=EDmica (INTEC) Consejo Nacional de Investigaciones Cient=EDficas y T=E9cnicas (CONICET) PTLC - G=FCemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 |
From: Tim H. <tim...@ie...> - 2006-11-04 20:23:28
|
Colin J. Williams wrote: > Tim Hochberg wrote: > [snip] > >> A style note: please use the named dtypes (int32, uint32, etc) rather >> than the old-style letter codes; the former is much clearer. The answer >> to your question might have been immediately apparent had you been >> using named dtypes. >> >> >> > +1 > >> Personally, I'd also prefer people use the "ones([n])" syntax instead >> of the I-wish-it-were-deprecated-but-it's-too-much-to-hope-for "ones(n)" >> syntax. T >> >> -tim >> >> >> > Could you elaborate please? > > Sure. The general form of the zeros function, and several others[1], is: zeros(shape, dtype) Here 'shape' is a sequence of one sort or another. There's also a second form that's applicable only to one dimensional arrays: zeros(length, dtype) Where length is an integer. I don't recall if this is a historical legacy or is intended as a convenience function or a bit of both. Either way, the result is that there are two ways to spell "give me a 1D array of zeros with a given length and dtype": zeros([length], dtype) and zeros(length, dtype) I have two issues with having this second spelling. First, it's one more thing to remember. Whenever I see the scalar spelling I have to use a little bit extra of my limited brainpower to remember that it is not in fact a typo, but is instead a shortcut. The second issue is pedagogical. If people are initially exposed to the first form, the extension to multiple dimensions is straightforward. They'll probably guess the correct way right off the bat, and if not, they'll get it right away when it's explained. On the other hand, if they are initially exposed to the second form, the multidimensional form is far from obvious. In addition, they'll probably spend a long time thinking that the one-dimensional way is the normal way, but that we have to jump through weird hoops to get multidimensional arrays to work. That's bad propaganda for numpy. This all seems like a rather large price to pay to avoid typing the occasional pair of brackets. That's my two cents. Just say not to form #2. -tim ... [1] Yes, I'm neglecting the order parameter; I don't think it matters for this discussion. |
From: Sasha <nd...@ma...> - 2006-11-04 18:03:25
|
On 11/3/06, Torgil Svensson <tor...@gm...> wrote: > class struct_type(Structure): > _fields_ = [....] > > ... > ... which is somewhat static in nature. How do you create "structures" > dynamically? > You can put the above in a function that takes fields as an argument, or type('struct_type', (Structure,), {'_fields_':[('a', c_int), ('b', c_long)]}) |
From: Mike C. F. <mcf...@vr...> - 2006-11-04 16:20:28
|
Josh Marshall wrote: > On 11/31/06, Fernando Perez <fpe...@gm...> wrote: > > >> Fernando Perez wrote: >> ps - one more thing. This guy: >> >> http://blog.vrplumber.com/ >> >> has been rewriting the OpenGL bindings using ctypes, and I've seen >> posts from him about numpy (in his blog). He might be able to >> contribute something... >> ... > Now, I haven't spent much time looking at these parts of OpenGL- > ctypes, as they have just worked for me. I would think that it would > be trivial to write a FormatHandler which uses the ndarray interface > and data type description to use any object implenting it as an input > for OpenGL. This would include things such as PIL images. > Yes, this is the purpose of the design, to allow users to write new format handlers that can be registered at run-time and act as first-class data-formats within the system. PIL images, custom vector objects, memory-mapped files, media buffers and the like are all contemplated as useful array storage formats. > Mike, can you give us your opinion on how a standardised data type > descriptor would be helpful for PyOpenGL? The PEP and some > information about it can be found here: > http://www.scipy.org/ArrayInterfacePEP > A standardised data-type descriptor would be of some benefit for us, as it would allow a single handler to deal with larger numbers of storage formats (reducing the amount of coding required). That said, the spec as proposed has far more features than *most* OpenGL users will use (OpenGL being largely (though not exclusively) focused on simple, homogeneous data-types), and the handler mechanism largely abstracts away the problem for *us* at the moment. We wouldn't be able to get rid of the abstraction mechanism entirely, as we would still have data-types such as lists-of-lists-of-integers that wouldn't support the protocol. The likely efficiency of accessing the metadata (versus current implementation where in some cases we wind up producing a whole dictionary object with meta-data just to pull out a single value) would be attractive. We also need functionality to get at the data-pointer for the objects to make any description useful, though I suppose that's out of scope for this particular PEP. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Colin J. W. <cj...@sy...> - 2006-11-04 12:30:27
|
Tim Hochberg wrote: [snip] > A style note: please use the named dtypes (int32, uint32, etc) rather > than the old-style letter codes; the former is much clearer. The answer > to your question might have been immediately apparent had you been > using named dtypes. > > +1 > Personally, I'd also prefer people use the "ones([n])" syntax instead > of the I-wish-it-were-deprecated-but-it's-too-much-to-hope-for "ones(n)" > syntax. T > > -tim > > Could you elaborate please? Colin W. |
From: Travis O. <oli...@ie...> - 2006-11-04 01:54:41
|
George Sakkis wrote: > Albert Strasheim wrote: > > >> Check the thread "Strange results when sorting array with fields" from >> about a week back. Travis made some changes to sorting in the presence >> of fields that should solve your problem, assuming your fields appear in >> the order you want to sort (i.e. you want to sort f1, f2, f3 and not >> something like f1, f3, f2). >> > > I'm afraid this won't help in my case; I want to sort twice, once by f1 > and once by f2. I guess I could make a second file with the fields > swapped but this seems more messy and inefficient than Francesc's > suggestion. > As a final contribution before I become more quiet for a few weeks (and aside from hopefully releasing 1.0.1 soon), I've added a feature to allow specifying the sorting order for record arrays. It's added to the sort method as the order= keyword. You can pass in a string (specifying which field comes first --- all other fields will stay in the same order) or you can pass in a list or tuple which indicates the field order (any fields un-specified will stay in their same relative order). It works be creating a new data-type object with the .names attribute replaced with a newly ordered one and then calling sort on a view of the array with that data-type. The VOID_compare uses the names tuple to determine the ordering. This was the un-named option in my previous list. It's a better solution than all of the others, I think. The newly created data-type is discarded after the sorting is complete. -Travis |
From: Info <ah...@ny...> - 2006-11-04 01:40:13
|
Добрый день! |
From: Tim H. <tim...@ie...> - 2006-11-03 20:39:31
|
George Sakkis wrote: > Tim Hochberg wrote: > > >> George Sakkis wrote: >> >>> Can anyone explain this ? >>> >>> >>> >>>>>> import numpy as N >>>>>> x = N.arange(1,6,dtype='B') >>>>>> x >>>>>> >>>>>> >>> array([1, 2, 3, 4, 5], dtype=uint8) >>> >>> >>>>>> N.repeat(x, N.ones(5,'H')) >>>>>> >>>>>> >>> array([1, 2, 3, 4, 5], dtype=uint8) >>> >>> >>>>>> N.repeat(x, N.ones(5,'l')) >>>>>> >>>>>> >>> array([1, 2, 3, 4, 5], dtype=uint8) >>> >>> >>>>>> N.repeat(x, N.ones(5,'L')) >>>>>> >>>>>> >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in ? >>> File >>> "/usr/local/lib/python2.4/site-packages/numpy/core/fromnumeric.py", >>> line 83, in repeat >>> return repeat(repeats, axis) >>> TypeError: array cannot be safely cast to required type >>> >>> >> It means you can't safely a value of type uint32 ('L') to a value of >> type int32 ('i'). The second argument of repeat needs to be castable to >> type int32. >> > > I see. I suppose there is a better reason for this than a "why on earth > would anyone repeat a value more than 2**32-1 times". Besides, why > should it be castable to a signed type since we're talking about number > of repetitions ? > I suspect it's just a matter of simplicity although I haven't looked at the code in question. On the way in all of the arrays are going to need to be cast to some standard integral type. While unit32 might make sense, int32 is by far the more common type. If one was to use uint32 as the type, before casting int32 to uint32, one would have to scan the array looking for negative values lest they get cast into really big positive values. An analogous problem exists for casting uint32 to int32, but since unit32 is rather uncommon, one can just make users do the necessary checking and casting by hand and probably someone will only notice every couple of years. >> A style note: please use the named dtypes (int32, uint32, etc) rather >> than the old-style letter codes; the former is much clearer. The answer >> to your question might have been immediately apparent had you been >> using named dtypes. >> > > I'm using numpy along with the struct module, so the letter codes are > convenient for talking to both modules. > I imagine they are, but they're harder for me, and I suspect many others, to remember. Your more likely to get a useful answer if your readers don't have to go look stuff up. -tim |
From: Travis O. <oli...@ee...> - 2006-11-03 20:26:36
|
I'm writing this to indicate that I won't be as visible on the lists for a few weeks as I have some pressing matters to attend to that will take more of my time. I apologize for not being able to help more right now. Best regards, -Travis Oliphant |
From: George S. <geo...@gm...> - 2006-11-03 20:25:55
|
Tim Hochberg wrote: > George Sakkis wrote: > > Can anyone explain this ? > > > > > >>>> import numpy as N > >>>> x = N.arange(1,6,dtype='B') > >>>> x > >>>> > > array([1, 2, 3, 4, 5], dtype=uint8) > > > >>>> N.repeat(x, N.ones(5,'H')) > >>>> > > array([1, 2, 3, 4, 5], dtype=uint8) > > > >>>> N.repeat(x, N.ones(5,'l')) > >>>> > > array([1, 2, 3, 4, 5], dtype=uint8) > > > >>>> N.repeat(x, N.ones(5,'L')) > >>>> > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > > File > > "/usr/local/lib/python2.4/site-packages/numpy/core/fromnumeric.py", > > line 83, in repeat > > return repeat(repeats, axis) > > TypeError: array cannot be safely cast to required type > > > It means you can't safely a value of type uint32 ('L') to a value of > type int32 ('i'). The second argument of repeat needs to be castable to > type int32. I see. I suppose there is a better reason for this than a "why on earth would anyone repeat a value more than 2**32-1 times". Besides, why should it be castable to a signed type since we're talking about number of repetitions ? > A style note: please use the named dtypes (int32, uint32, etc) rather > than the old-style letter codes; the former is much clearer. The answer > to your question might have been immediately apparent had you been > using named dtypes. I'm using numpy along with the struct module, so the letter codes are convenient for talking to both modules. George |
From: Tim H. <tim...@ie...> - 2006-11-03 19:43:43
|
George Sakkis wrote: > Can anyone explain this ? > > >>>> import numpy as N >>>> x = N.arange(1,6,dtype='B') >>>> x >>>> > array([1, 2, 3, 4, 5], dtype=uint8) > >>>> N.repeat(x, N.ones(5,'H')) >>>> > array([1, 2, 3, 4, 5], dtype=uint8) > >>>> N.repeat(x, N.ones(5,'l')) >>>> > array([1, 2, 3, 4, 5], dtype=uint8) > >>>> N.repeat(x, N.ones(5,'L')) >>>> > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "/usr/local/lib/python2.4/site-packages/numpy/core/fromnumeric.py", > line 83, in repeat > return repeat(repeats, axis) > TypeError: array cannot be safely cast to required type > It means you can't safely a value of type uint32 ('L') to a value of type int32 ('i'). The second argument of repeat needs to be castable to type int32. A style note: please use the named dtypes (int32, uint32, etc) rather than the old-style letter codes; the former is much clearer. The answer to your question might have been immediately apparent had you been using named dtypes. Personally, I'd also prefer people use the "ones([n])" syntax instead of the I-wish-it-were-deprecated-but-it's-too-much-to-hope-for "ones(n)" syntax. T -tim |
From: George S. <geo...@gm...> - 2006-11-03 19:11:00
|
Can anyone explain this ? >>> import numpy as N >>> x = N.arange(1,6,dtype='B') >>> x array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'H')) array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'l')) array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'L')) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.4/site-packages/numpy/core/fromnumeric.py", line 83, in repeat return repeat(repeats, axis) TypeError: array cannot be safely cast to required type Thanks, George |
From: Shane H. <sha...@ie...> - 2006-11-03 16:27:45
|
I'm looking for a better way to map the characters of a unicode string to indexes into an array of geometry. The following code is functional, but it seems sub-optimal with all that numpy has to offer:: textOrds = map(ord, text.encode('utf-8')) idx = indexMap[textOrds] textGeo = geometry[idx] text is a simple python string coming in. I then manually covert it to unicode ordinals. Those are then mapped through indexMap, which happens to be a 1-to-1 mapping between unicode ordinals and valid indexes into geometry. I then use the idx array to take a selection from geometry for the text. As I mentioned before, this works alright, however two things seem inefficient. First is the manual mapping to unicode ordinals. Is there a way to have numpy do that for me? Secondly is the mapping through indexMap, because it is only sparsely populated -- usually only a 2-5 thousand entries out of the 64 thousand allocated. I've thought of using unicode.translate, but characters cannot be used for indexes in numpy. What are your collective thoughts on making this cleaner and more efficient? Thanks, -Shane Holloway |
From: Alexander B. <ale...@gm...> - 2006-11-03 15:56:59
|
On 11/3/06, Torgil Svensson <tor...@gm...> wrote: > class struct_type(Structure): > _fields_ = [....] > > ... > ... which is somewhat static in nature. How do you create "structures" > dynamically? > You can put the above in a function that takes fields as an argument, or type('struct_type', (Structure,), {'_fields_':[('a', c_int), ('b', c_long)]}) |
From: Albert C. <num...@ml...> - 2006-11-03 15:54:18
|
On Fri, Nov 03, 2006 at 05:19:09PM +0100, Karol Langner wrote: > On Friday 03 of November 2006 16:09, Albert Chin wrote: > > We have atlas-3.6.0 installed in a non-standard location. When > > building the numpy-1.0 shared libraries, we'd like to encode the > > non-standard location in the RPATH of the executable. We do this with > > other Python modules by adding the following to setup.cfg: > > [build_ext] > > rpath=<path to library> > > > > But, this doesn't work for numpy-1.0. Is there another way to do this? > > try something like this in your site.cfg: > > [atlas] > library_dirs = <paths to libraries> > include_dirs = <paths to include dirs> > atlas_libs = <names of libraries> The library_dirs variable will simply set the path for the linker to search for the library (i.e. -L<paths to libraries>). However, it won't add the -Wl,-rpath,<paths to libraries> on Linux that we want (or -R<paths to libraries> on Solaris, etc.). -- albert chin (ch...@th...) |
From: Francesc A. <fa...@ca...> - 2006-11-03 15:52:13
|
A Dijous 02 Novembre 2006 22:26, A. M. Archibald escrigu=E9: > On 02/11/06, Francesc Altet <fa...@ca...> wrote: > > I see this as a major issue in numarray and poses in great danger the > > intended support of PyTables for numarray that we planned for some time > > (until end of 2007). It would be nice to know if the numarray crew would > > be willing to address this, or, now that NumPy 1.0 is out, they have > > decided to completely drop the support for it. > > > > We'd really like to continue offering support for numarray (in the end, > > it is a very good piece of software) in PyTables, but don't having a > > solution for this problem anytime soon, will make this very problematic > > to us. > > Someone has to say it: you could just drop support for the obsolete > numarray and provide only support for its successor, numpy. Yeah, that would be the easy path, agreed. However, only God knows how many code out there exists that still uses numarray (or Numeric). We were optimistic that, given the implementation of the stunningly efficient and easy-to-use array protocol in the three packages (NumPy, numarray and Numeric), that very much boosted the interoperability between them, support for all three would be a relatively easy thing to keep in next release PyTables (with NumPy at its core). Unfortunately, time has demonstrated how easy for a package to become obsolete (and hence, useless) is. Just a new version of Python (2.5 this time) and the advent of 64-bit platforms has rendered obsolete both numarray and Numeric in one shot. Mmm, perhaps it would make more sense to support just numarray (and Numeric up to an extend) in just 32-bit platforms, but again, even that could be risky. Well, "que sera, sera..." only time will say (as the song says). Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Francesc A. <fa...@ca...> - 2006-11-03 15:21:48
|
Hi, This is just to inform you that I've detected also problems with indexation code in Numeric (24.2) with Python 2.5 and 64-bit platforms. The next reproduces the issue: >>> a=3DNumeric.array([1,0]) >>> a array([1, 0]) >>> a[:] zeros((0,), 'l') # ?? # The order of values in the array doesn't seem to affect >>> a=3DNumeric.array([0,1]) >>> a array([0, 1]) >>> a[:] zeros((0,), 'l') # ? I know that support for Numeric has officially ceased. This is just to let others know that using latest Numeric with Python 2.5 and 64-bit platforms (or, at very least, Linux64 on top of AMD64 :P) can lend to pretty scaring results. Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Karol L. <kar...@kn...> - 2006-11-03 15:21:36
|
On Friday 03 of November 2006 16:09, Albert Chin wrote: > We have atlas-3.6.0 installed in a non-standard location. When > building the numpy-1.0 shared libraries, we'd like to encode the > non-standard location in the RPATH of the executable. We do this with > other Python modules by adding the following to setup.cfg: > [build_ext] > rpath=<path to library> > > But, this doesn't work for numpy-1.0. Is there another way to do this? try something like this in your site.cfg: [atlas] library_dirs = <paths to libraries> include_dirs = <paths to include dirs> atlas_libs = <names of libraries> Karol -- written by Karol Langner Fri Nov 3 17:18:38 CET 2006 -- written by Karol Langner Fri Nov 3 17:19:08 CET 2006 |
From: Albert C. <num...@ml...> - 2006-11-03 15:09:49
|
We have atlas-3.6.0 installed in a non-standard location. When building the numpy-1.0 shared libraries, we'd like to encode the non-standard location in the RPATH of the executable. We do this with other Python modules by adding the following to setup.cfg: [build_ext] rpath=<path to library> But, this doesn't work for numpy-1.0. Is there another way to do this? -- albert chin (ch...@th...) |
From: Torgil S. <tor...@gm...> - 2006-11-03 06:38:30
|
> > It seems to me that at the python level, there's not much reason to > > choose the dtypes proposal over ctypes. I disagree. I can see a point in unifying ctypes and dtypes but in my mindset they've got two different scopes. ctypes is an interface to the c language dtype is a data description for the python language The biggest advantages python has over c in my mind (except the script vs compile) is that it's dynamic and expressive. I think basing dtype on ctypes is in that mind is simply destructive and against what I like best with python. ctypes mimics c's static behaviour: class struct_type(Structure): _fields_ = [....] ... ... which is somewhat static in nature. How do you create "structures" dynamically? How do you do things like this in ctypes: mytype=filter(lambda x: is_little_endian(x),map(lambda x: x==int32 and int64 or x, old_type)) b=['gg',[1,2,3]] mytype=dtype([{str: uint64 , list:another_type }[type(x)] for x in b]) I'm sure it's possibl but I'm also suspecting it not at all as clean and expressive (my second argument for choosing python over c). Since we creating something new in python isn't it best we do something the python way and later see if we can adapt the c structure to that rather than the other way around? If we can't adapt ctypes to this new thing i'm perfectly happy with leaving ctypes as is. ctype is doing a great job on the c interaction level but is plain ugly on the python level. On 11/1/06, Bill Baxter <wb...@gm...> wrote: > > On 11/2/06, A. M. Archibald <per...@gm...> wrote: > > On 01/11/06, Travis Oliphant <oli...@ie...> wrote: > > > > > And it may be a good idea to also have a get_ctype method or some-such > > > on the ctypes attribute so that one could get a "ctypes description" > > > from the NumPy data-type. > > > > It seems to me that at the python level, there's not much reason to > > choose the dtypes proposal over ctypes. There is one at the C level, > > it seems (though I, like perhaps most of the people on python-dev, > > have never actually tried using either). So perhaps, to persuade the > > python-dev folks, what is needed is a comparison of what has to be > > done at the C level. What would it take to rewrite numpy to use > > ctypes? There seems to be some problem with extending the type objects > > used by ctypes, but it's not very clear to me what that problem is > > (what the extensions are supposed to do). > > > I posted a message to the thread trying to prod things in that direction. > I.e. can we see a simple concrete example of the complications involved in > using ctypes interface code, vs the presumably much nicer > numpy/data-descriptor code. I too think that would help convince people. > Just saying it's more compilcated, trust me, doesn't help when most people > reading the list have never had to write any sort of C extension. > > --bb > > > ------------------------------------------------------------------------- > 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: <ws...@16...> - 2006-11-03 03:41:52
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>新建网页 1</TITLE> <META http-equiv=Content-Language content=zh-cn> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD> <BODY> <TABLE id=table1 width="100%" border=1> <TBODY> <TR> <TD> <P style="LINE-HEIGHT: 200%" align=center><FONT color=#0000ff><FONT size=2>主办单位: 易腾企业管理咨询有限公司</FONT><SPAN lang=zh-cn><FONT size=6><B><BR></B></FONT><b><font size="5">非财务经理的财务管理-沙盘模拟课程</font></b></SPAN></FONT></P> <P style="LINE-HEIGHT: 150%"><B><SPAN class=noo><FONT color=#0000ff size=3>课程背景</FONT></SPAN></B><BR><FONT lang=ZH-CN size=2> 如何将技术手段与财务运作相结合,使每位管理和技术人员都从老板的角度进行思考,有效地规避财务陷阱,实现管理决策与经营目标的一致性?通过沙盘模拟实施体验式教学,每个小组5-6人模拟公司的生产、销售和财务分析过程,使学员"身同体受",完成从 know-what向 know-why 转化。通过二十八个实际案例分析,使企业各级管理和技术人员掌握财务管理知识,利用财务信息改进管理决策,实现管理效益最大化。<br> ★ 对会计与财务管理有基本了解, 提高日常管理活动的财务可行性;<br> ★ 掌握合乎财务原则的管理决策方法, 与老板的思维同步;<br> ★ 通过成本分析,找到有效降低成本的途径;<br> ★ 通过边际效应分析,实施正确的成本决策;<br> ★ 掌握业绩评价的依据和方法,评估经营业绩, 实施科学的业绩考核.</FONT><BR><SPAN class=r3><B><FONT color=#0000ff size=3>课程大纲</FONT></B></SPAN><BR> <FONT face=宋体 size=2><font color="#0000FF">一、企业财务管理的内容及管理会计的作用</font><br> 1、财务会计的职能<br> 2、财务专家的思维模式<br> 3、财务工作的基本内容<br> 4、财务管理的四个基本原理<br> 5、会计工作的十三个基本原则<br> <font color="#0000FF">二、如何阅读和分析财务报表</font><br> 1、会计报表的构成<br> 2、资产负债表:<br> 资产负债表的逻辑结构与主要内容(透视资产负债表的各个部分)<br> 解读资产负债表(应收款、存货、应付款、固定资产、借款、股东权益)<br> 企业拥有何物,谁拥有企业<br> 财务杠杆的运用----资本结构分析<br> 3、损益表:<br> 损益表的逻辑结构与主要内容<br> 如何正确确认收入避免”苹果电脑事件”<br> 如何计算制造成本, 反映每种产品的实际贡献<br> 如何计算共同成本<br> 如何计算息税前利润和净利润<br> 4、现金流量表的阅读与分析<br> 现金流量表的逻辑结构与主要内容<br> 5、会计报表之间的关系(Dupont模型的应用)<br> 6、如何从会计报表读懂企业经营状况?<br> 案例分析:读报表,判断企业业绩水平<br> <font color="#0000FF">三、如何利用财务数据分析并改善经营绩效</font><br> 1、财务比率分析<br> 2、关键财务指标解析<br> 总资产收益率/净资产收益率<br> 营业利润率/总资产周转率<br> 总资产周转率与资产管理<br> 3、盈利能力分析:资产回报率、股东权益回报率、资产流动速率<br> 4、风险指数分析:流动比率、负债/权益比率、营运偿债能力<br> 5、财务报表综合解读:综合运用财务信息透视公司运作水平<br> ◆ 案例分析:某上市公司的财务状况分析与经营绩效评价<BR><font color="#0000FF">四、成本分析与成本决策</font><br> 1、产品成本的概念和构成<br> 2、CVP(本-量-利)分析与运用<br> 3、固定成本与边际效应分析<br> 4、如何运用目标成本法控制产品成本,保证利润水平<br> 5、如何运用ABC作业成本法进行管理分析,实施精细成本管理<br> 6、如何针对沉没成本和机会成本进行正确决策<br> 7、如何改善采购、生产等环节的运作以改良企业的整体财务状况<br> ◆ 综合案例分析<br> <font color="#0000FF">五、投资决策</font><br> </FONT><font face="宋体" size="2">1、管理和技术方案的可行性分析<br> 2、设备改造与更新的决策分析<br> 3、如何根据成本与市场进行合理定价<br> 4、长期投资项目的现金流分析<br> 5、资金的时间价值<br> 6、投资项目评价方法<br> 回收期法<br> 净现值法<br> 内部收益率法<br> ◆ 综合案例演练</font><FONT size=2><BR><font color="#0000FF">六、绩效考评与内部控制</font><br> 1、如何确定责任成本<br> 2、如何实施内部控制<br> 3、如何针对成本中心进行费用控制<br> 4、如何针对利润中心进行业绩考核<br> 5、如何针对投资中心进行业绩评价<br> 6、如何运用内部市场链进行管理,使每个部门都成为利润中心<br> 案例研讨: GE 和海尔的绩效考评 <br> </FONT><B><FONT color=#0000ff size=3>导师简介</FONT></B><BR> <font size="2">Mr Wang,管理工程硕士、高级经济师,国际职业培训师协会认证职业培训师,历任跨国公司管理会计分析师、营运总监等高级管理职务多年,同时还担任<价值工程> 杂志审稿人、辽宁省营口市商业银行独立董事等职务,对企业管理有较深入的研究。王老师从事管理咨询工作8年来,先后为IBM、TDK、松下、可口可乐、康师傅、汇源果汁、雪津啤酒、吉百利食品、冠捷电子、正新橡胶、美国ITT集团、广上科技、美的空调、中兴通讯、京信通信、联想电脑,应用材料(中国)公司、艾克森-金山石化、中国化工进出口公司、正大集团、厦华集团、灿坤股份、NEC东金电子、太原钢铁集团、PHILIPS、深圳开发科技、大冷王运输制冷、三洋华强、TCL、美的汽车、上海贝尔阿尔卡特、天津扎努西、上海卡博特等三百多家知名企业提供项目辅导或专题培训,受到广泛好评。<br> <br> </font><B><FONT size=2 color="#0000ff">时间地点:</FONT> </B><FONT size=2> 11月11-12日(周六日) 上海 <BR></FONT><B><FONT color=#0000ff size=2>费用:</FONT></B><FONT size=2> 1980元/人(含教材、午餐等) 四人以上参加,赠予一名免费名额<BR>报名/咨询:<b> <font color="#0000FF"> 021-51187131</font> </b> 张小姐 <br> 注:如您不需要此邮件,请来电说明。 </FONT></P></TD></TR></TBODY></TABLE></BODY></HTML> |
From: <sz1...@16...> - 2006-11-03 00:49:01
|
财务部/总经理: 您好! 感谢您阅读本邮件,但愿对您的工作有所帮助!如果您对邮件不感兴趣,请恕打扰! 我是上海索立实业有限公司,本公司现有各种发票可以优惠代开。(普通发票为0.8-2%,增值发票为6%-8%,海关缴款书为2-4%)。详细点数根据票额洽谈! 注:普通发票包括运输、租赁、广告设计、建筑安装、其它服务、商品销售(电子产品、五金交电、仪表仪器、机械设备、塑胶制品、化工原料、医疗设备)……等所有行业发票。海关缴款书以海关代征税收,完全可以代替增值税发票。 本公司实力雄厚,与全国各大城市的各个行业的公司有发票业务联系。由于规模庞大,本公司完全可以依照贵公司的需要来进行合作! 我公司寻找真诚合作伙伴,若贵公司有需要或其它问题。请来电联系! 联系人: 陈建国 13544007750 E-mail: jas...@16... 附言:此业务长期受理,请留备用!!! |