27;newiter'
> to 'nditer', is that a reasonable name or does anyone have a better
> suggestion?
+1. As a general rule, never name anything "new".
--
Robert Kern
"I have come to believe that the whole world is an e
;s it. In other words, this is what I want
> distutils to do:
>
> $ cython cmesh.pyx
> $ gcc -fPIC -o cmesh.o -c cmesh.c -I$SPKG_LOCAL/include/python2.6
> -I$SPKG_LOCAL/lib/python2.6/site-packages/numpy/core/include
> $ gfortran -fPIC -o fmesh.o -c fmesh.f90
> $ gcc -shared -o cmesh.s
mbda x, axis: np.sqrt(np.sum(x**2, axis=axis))
>> d = norm(w[:,:,None] - y[None,None], -1)
>>
>> Angus.
>
> Thanks! Now if I could understand why
> w[:,:,None] - y[None,None] is what I needed...
np.newaxis is None. Idiomatically, that should be written
d = norm(w[:,:,
([0,1,0,0,0], dtype=bool)
> print b[m]
> print b[m][0,0]
> b[m][0,0] = -1
> print b[m][0,0]
>
> I think the boolean slicing is making a copy instead of a view. is there
> a way around this?
bm = b[m]
bm[0,0] = -1
b[m] = bm
--
Robert Kern
"I have come to believe that the whole
r to me what operations are different under
Mark's changes.
--
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
__
j]
0.0065380564732848701
[~]
|19> A.min()
0.0065380564732848701
--
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
___
On Tue, Mar 1, 2011 at 18:40, Jon Olav Vik wrote:
> Robert Kern gmail.com> writes:
>> > Within a single machine, that sounds fine. What about processes running on
>> > different nodes, with different main memories?
>>
>> You mean mmaping a file on a shared f
On Tue, Mar 1, 2011 at 17:06, Jon Olav Vik wrote:
> Robert Kern gmail.com> writes:
>> >> It's up to the virtual memory manager, but usually, it will just load
>> >> those pages (chunks the size of mmap.PAGESIZE) that are touched by
>> >> your req
On Tue, Mar 1, 2011 at 15:36, Jon Olav Vik wrote:
> Robert Kern gmail.com> writes:
>> >> >> You can have each of those processes memory-map the whole file and
>> >> >> just operate on their own slices. Your operating system's virtual
>> >
On Tue, Mar 1, 2011 at 07:20, Jon Olav Vik wrote:
> Robert Kern gmail.com> writes:
>
>> On Mon, Feb 28, 2011 at 18:50, Sturla Molden molden.no> wrote:
>> > Den 01.03.2011 01:15, skrev Robert Kern:
>> >> You can have each of those processes memory-map t
On Mon, Feb 28, 2011 at 18:50, Sturla Molden wrote:
> Den 01.03.2011 01:15, skrev Robert Kern:
>> You can have each of those processes memory-map the whole file and
>> just operate on their own slices. Your operating system's virtual
>> memory manager should handle
ap and read/write to non-overlapping
> portions without interfering with each other allows for fast, simple parallel
> I/
> O.
You can have each of those processes memory-map the whole file and
just operate on their own slices. Your operating system's virtual
memory manager should handle all
2D arrays. z0_legend in a 1D
> look-up table. I assume the error here comes from trying to index a 1D array
> with a 2D array.
Make sure that z0_legend is a numpy array, not a list.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is
1D array with a
> roughness value for each class. I am trying to create a new 2D array
> containing a map of the roughness values.
roughness = z0_legend[landcover]
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible
ckage.
A python-matplotlib-nogui in main? ;-)
If you are going to do an Ubuntu-only fix, would that allow using our
prebuilt doc packages? IIRC, the only objection to that was that it
was Debian policy to build docs from sources. But then again, that
might have just been the first objection.
--
On Fri, Feb 11, 2011 at 11:34, Bruce Southey wrote:
> The apparent problem occurs when the user has to build the documentation
> from source as sphinx and matlibplot are dependencies.
No, please reread the original post.
--
Robert Kern
"I have come to believe that the whole
Ubuntu users of numpy?
We might be able to commit to building and releasing complete doc
packages with each source release. Could you just download and use
those? We currently make such doc packages, but I don't think we keep
old micro revisions around, and I suspect you would want those.
htt
On Thu, Feb 10, 2011 at 15:32, eat wrote:
> Hi Robert,
>
> On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern wrote:
>>
>> On Thu, Feb 10, 2011 at 14:29, eat wrote:
>> > Hi Robert,
>> >
>> > On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern
>> &
On Thu, Feb 10, 2011 at 14:51, Joshua Holbrook wrote:
> Maybe I'm missing something, but why not just implement sum() using
> dot() and ones() ?
You can't do everything that sum() does with just dot() and ones().
--
Robert Kern
"I have come to believe that the whole
On Thu, Feb 10, 2011 at 14:29, eat wrote:
> Hi Robert,
>
> On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern wrote:
>>
>> On Thu, Feb 10, 2011 at 11:53, eat wrote:
>> > Thanks Chuck,
>> >
>> > for replying. But don't you still feel very odd that d
and do their iterations more quickly, at least for some common
combinations of dtype and contiguity.
--
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
On Wed, Feb 9, 2011 at 10:48, Neal Becker wrote:
> Still, I wonder if numpy would benefit from a 'find_first' function.
I certainly could have used one many times.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terri
On Tue, Feb 8, 2011 at 11:55, Ben Gamari wrote:
> On Tue, 8 Feb 2011 10:46:34 -0600, Robert Kern wrote:
>> (v*v).sum(axis=1)[:,np.newaxis]
>>
>> You can leave off the newaxis bit if you don't really need a column vector.
>>
> Fair enough, I unfortunately neg
t;
> but surely there must be a better way. Any ideas?
(v*v).sum(axis=1)[:,np.newaxis]
You can leave off the newaxis bit if you don't really need a column vector.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by
[~]
|17> mean_xyz = sum_xyz / counts[:,np.newaxis]
[~]
|18> mean_xyz
array([[ 0.78316224, 0.4409687 , 0.10126793],
[ 0.68330832, 0.4934926 , 0.39946005],
[ 0.26787528, 0.12850502, 0.76042557],
[ 0.54244609, 0.35049674, 0.78332874],
[ 0.28331422, 0.67514095, 0.07765996
s sorted along the key.
* A temporary array is formed by dropping the fields not in the key for the
two arrays and concatenating the result. This array is then sorted, and
the common entries selected. The output is constructed by
filling the fields
with the selected entries
ood. But that may just be my perspective because I'm subscribed
to both and filter them both to the same folder.
--
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
complete, this would be part of
> libndarray, and could be used directly from C without depending on Python.
It think his real question is whether einsum() and the iterator stuff
can live in a separate module that *uses* a released version of numpy
rather than a development branch.
--
Robert K
vely, there is 1 Gb of free address space, but broken
up into two 0.5 Gb blocks. You could not allocate a third 1 Gb block
because there is nowhere to put it.
You can detect this problem early by doing an np.empty() of the right
size early in the program.
--
Robert Kern
"I have come to believe
ord scalar. It can be indexed because it is often
convient to treat such records like tuples. This replaces the default
indexing behavior of scalars (which is to simply disallow indexing).
a_rank_0 is an array, so the array indexing semantics are the default,
and we do not change them.
--
Robe
to index
into a rank-0 array. Use an empty tuple instead.
[~]
|1> dt = np.dtype([('x', ' a_rank_0 = np.zeros((), dtype=dt)
[~]
|3> a_rank_0[()]
(0.0, 0.0)
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible
22044605e-16,
> -3.33066907e-16, -3.33066907e-16])
>>>> np.round(aa).astype(int)
> array([1, 1, 1, 1, 1])
This is behavior inherited from C and matches Python's behavior.
int(aa[0]) == 0. Similarly, inside the C code, (int)(1.0 - 2.22e-16)
== 0.
--
Robert Kern
"
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1, 1, 1, 1, 1, 1])
He's not pointing out a bug. His array does not hav
erstand broadcasting rules, e.g. for
> calculating outer products (I mentioned this in a previous thread).
See numpy.lib.stride_tricks for tools to do this, specifically the
as_strided() function. See numpy.broadcast_arrays() for the latter
functionality.
http://docs.scipy.org/doc/numpy/reference/ge
}
> #else
> void
> init_numpy()
> {
> import_array();
> }
> #endif
Just put "import_array();" into initcvisual(). You should not put it
in any other function.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that
zation function for your
module, e.g. initcvisual(). Do not put it into a separate function for
the user of your module to call.
--
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 h
On Wed, Dec 22, 2010 at 16:32, Ian Stokes-Rees
wrote:
> Like most people these days, I have multiple 24" monitors. I don't need
> "print" of ndarrays to wrap after 72 columns. Is there some way to
> change this?
np.set_printoptions(linewidth=100)
--
Robert Kern
r j from 0 <= j < nselected:
out[i,j] = j
for j from nselected <= j < ntotal:
u = rk_interval(j+1, self.internal_state)
if u < nselected:
out[i,u] = j
return out.reshape(shape)
--
Robert Kern
&qu
py. Use boolean indexing.
http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#boolean
--
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."
-
dtype'
The default truth value probably should be True, but not for this
reason. The correct idiom to use is this:
def f(dtype=None):
if dtype is None:
print 'using default dtype'
--
Robert Kern
"I have come to believe that the whole world is an enigma, a har
On Mon, Dec 6, 2010 at 21:51, Benjamin Root wrote:
> On Monday, December 6, 2010, Robert Kern wrote:
>> On Mon, Dec 6, 2010 at 20:18, Mario Moura wrote:
>>> Hi Folks
>>>
>>> Is it possible some example how deal with strides with combinations, let
>>>
On Mon, Dec 6, 2010 at 20:18, Mario Moura wrote:
> Hi Folks
>
> Is it possible some example how deal with strides with combinations, let see:
No, sorry. It is not possible to generate combinations just using strides.
--
Robert Kern
"I have come to believe that the whole world i
bout the string conversion rather than about numerical differences.
Unfortunately, there are still cross-platform numerical differences
that are real (but are irrelevant to the validity of the code under
test). Hex-printing for floats only helps a little to make doctests
useful for numerical code.
in divide
>> Out[7]: inf
>>
>> I have been using the orig_settings so that I can take over the
>> control of this from the user and then set it back to how it was.
>
> Thank, Skipper. That works. Do you wrap it in a try...except? And then
> raise whatever brought you
Can anyone point me in the direction of a good step-step guide og using this
> api to export function pointers from NumPy to your own modules?
http://docs.scipy.org/doc/numpy/user/c-info.how-to-extend.html?highlight=import_array
--
Robert Kern
"I have come to believe that the whole wo
(1,1) which is what
> I wanted. The question is: is it possible to omit the [0,1]
> in the index?
No, but you can write generic code for it:
t[np.arange(t.shape[0]), x, y]
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is mad
ement for
> scipy.stats.nanstd. Maybe I'll have to add an asterisk to the drop-in
> part. Either that, or suck it up and store the damn mean.
The difference is less than eps. Quite possibly, the one-pass version
is even closer to the true value than the two-pass version.
--
Robert Kern
On Sun, Nov 21, 2010 at 17:43, Keith Goodman wrote:
> Does np.std() make two passes through the data?
Yes. See PyArray_Std() in numpy/core/src/calculation.c
--
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
e indices makes a copy of the data. Those copies are
incremented independently, then they are shoved back into the original
foo array. At no point does the array know that these methods are
being called because of this special combination of operators and that
you want it to behave like a hist
On Wed, Nov 17, 2010 at 13:11, Sebastian Haase wrote:
> On Wed, Nov 17, 2010 at 7:48 PM, Nathaniel Smith wrote:
>> On Wed, Nov 17, 2010 at 10:32 AM, Sebastian Haase
>> wrote:
>>> On Wed, Nov 17, 2010 at 7:26 PM, Robert Kern wrote:
>>>> On Wed, Nov 17, 2
to also allow float ndarrays then ?
It only works for float scalars by accident. Do not rely on it.
--
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."
ntext:
>
> Say I have a 2d array-like object with axis 0 named 'space' and axis 1
> named 'time', I'd like to be able to make the following distinctions:
>
> a['time':2] --> a[:,2]
> a['time':2:] --> a[:,2:]
>
> a['space
able is
> an object of type 'str'. How should I understand this? Does python not
> understand that numpy.int32 is an integer?
Correct. On a 64-bit system, numpy.int32 does not subtype from int.
The format codes do strict type-checking.
--
Robert Kern
"I have come to believe
t has some thing to do with
> the operating system or JAVA!.
Check your JavaScript settings. The search functionality is
implemented in JavaScript.
--
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 t
n the failing machine numpy.__version__
> returns '1.2.0'. Machines on which the broadcasting works as I expect I see
> '1.3.0' (or later) in numpy.__version__.
>
> Have broadcast rules changed since 1.2.0? Or maybe I just don't understand
> broadcasting?
e don't touch the math module at all. That would be evil.
--
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 underlyi
cos to throw a Domain Exception. This does not happen
> when
> I use Python 2.4 with Numpy 1.0.3.
acos() is not a numpy function. It comes from the stdlib math module.
Python 2.6 tightened up many of the border cases for the math
functions. That is probably where the behavior difference comes fr
omeone please explain?
rand() and randn() were added as conveniences for people who were used
to the MATLAB functions. numpy.random.random_sample((2,3)) and
numpy.random.standard_normal((2,3)) are the preferred, more consistent
functions to use. Ignore rand() and randn() if you like.
--
Robert
t; compiler (I don't know about the fortran compiler.
Are you sure that the python executable that you are using is the
64-bit python executable that you think it is?
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by ou
7;] didn't get copied correctly when it got
assigned. If you assign D[0]['n1'] and D[1]['n1'] separately, it
works.
[~]
|12> D[0]['n1'] = A
[~]
|16> D[1]['n1'] = A
[~]
|17> D
array([ ((array([[ 0.],
[ 1.],
[ 2.],
[ 3.],
hat they return the same
subclass of ndarray that the original object is. So
type(some_matrix.ravel()) is also matrix. Since matrix objects are
always 2D, you get the above behavior. One could probably overwrite
those methods to return ndarrays of the proper shape instead.
If you are doing such shape-
which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
> Do you think it is safe just to delete the folder
> /System/Library/Frameworks/Python.framework to «uninstall» the wrong
> version?
No! Do not touch that! It is used by OS X.
--
Robert Kern
"I have com
on 32 bits or 64 bits? I ask because there are different
> floating point precisions on the 32 bit platform and the results can depend
> on how the compiler does things.
Eh, what? Are you talking about the sometimes-differing intermediate
precisions? I wasn't aware that was constrained t
brary/Frameworks/Python.framework/Versions/Current/bin before
/usr/bin. Then when you type "python", you will get this installation
of Python and all of its libraries.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made te
> It would be really useful to have a complete example somewhere. As in, a
> set of files for a minimum example that builds and runs.
http://github.com/numpy/numpy/tree/master/doc/newdtype_example/
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
en
On Thu, Oct 28, 2010 at 16:37, Ian Stokes-Rees
wrote:
>
>
> On 10/28/10 5:29 PM, Robert Kern wrote:
>> On Thu, Oct 28, 2010 at 15:17, Ian Stokes-Rees
>> wrote:
>>> I have an ndarray with named dimensions. I find myself writing some
>>> fairly laboriou
__getattr__ to __getitem__?
Using __getattribute__ tends to slow down almost all operations on the
array substantially. Perhaps __getattr__ would work better, but all of
the methods and attributes would mask the fields. If you can find a
better solution that doesn't have such an impact on norm
On Thu, Oct 28, 2010 at 12:47, Brennan Williams
wrote:
> On 29/10/2010 6:35 a.m., Robert Kern wrote:
>> On Thu, Oct 28, 2010 at 12:33, Brennan Williams
>> wrote:
>>> On 29/10/2010 2:34 a.m., Robert Kern wrote:
>>>> On Thu, Oct 28, 2010 at 06:38, Brennan
On Thu, Oct 28, 2010 at 12:33, Brennan Williams
wrote:
> On 29/10/2010 2:34 a.m., Robert Kern wrote:
>> On Thu, Oct 28, 2010 at 06:38, Brennan Williams
>> wrote:
>>> I have used both linear least squares and radial basis functions as a
>>> proxy equatio
the different second order terms.
A = np.column_stack([
np.ones_like(x),
x, y, z,
x*x, y*y, z*z,
x*y, y*z, x*z,
])
x, res, rank, s = np.linalg.lstsq(A, f)
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our ow
> to a normal python float. But I still get this error message.
>
> At this point, I suspect that I'm doing something dumb, rather than
> discovering some unique bug in numpy. Can anyone help me out?
Can you provide a complete, self-contained example that does not work?
What kind of
gt; rather than
> my_analysis.perform(optimizer='Amoeba')
+11ty-billion
> This lets users do introspection on the pyOpt namespace to see what
> functions they can choose from, which is rather friendlier in an
> interactive environment.
Or implement their own without having to modify
nstantiate, typically
> passed as an argument by the client code/user.....
Example?
--
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 underl
type is np.unsignedinteger:
|3> np.issubdtype(np.uint16, np.unsignedinteger)
True
--
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 u
> AttributeError: 'module' object has no attribute 'parse'
You have a local module named parser.py . This is interfering with the
local "import parser" in compiler/transformer.py . Rename your module
or execute numpy.test() from somewhere else. This is not a bug in
n
" As a wiki, it will automatically be "official".
--
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
___
oat wl;
> int cssid;
> int br;
> }hm1dval1;
>
> to an element of this array
> I get the array object, i can see the fields. The type of the array
> elements is Pyarray_VOID
>
> however following code gives me a segfault
>
> hm1dval1 **s = PyArray_DATA(ao);
Sin
mpatibly. There is not only too much code in numpy to
rewrite, but a ton of other code that we do not maintain that relies
on our current memory model.
--
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
c.set_values(q=3.0, wl=2.5, cssid=6, br=7)
>
>
> So following code should be valid in C:
>
> hm1dval s* = PyArray_DATA(array);
>
> but the members are 0 after casting in spite they were set previously.
The elements of a dtype=object array are PyObject* pointers. In C, an
array of poi
On Sat, Oct 2, 2010 at 22:10, David Warde-Farley
wrote:
> On 2010-10-01, at 7:22 PM, Robert Kern wrote:
>
>> Also some design, documentation, format version bump, and (not least)
>> code away. ;-)
>
> Would it require a format version number bump? I thought that was a .NPY
On Fri, Oct 1, 2010 at 02:13, Francesc Alted wrote:
> A Thursday 30 September 2010 18:20:16 Robert Kern escrigué:
>> On Wed, Sep 29, 2010 at 03:17, Francesc Alted
> wrote:
>> > Hi,
>> >
>> > I'm going to give a seminar about serialization, and I
On Thu, Sep 30, 2010 at 23:04, Geoffrey Irving wrote:
> On Fri, Oct 1, 2010 at 11:39 AM, Robert Kern wrote:
>> s = mlab.pipeline.triangular_mesh_source(x,y,z,triangles)
>> s.data.cell_data.scalars = # Your data here.
>> surf = mlab.pipeline.surface(s)
>> su
On Thu, Sep 30, 2010 at 16:26, Geoffrey Irving wrote:
> On Fri, Oct 1, 2010 at 10:18 AM, Robert Kern wrote:
>> On Thu, Sep 30, 2010 at 16:00, Geoffrey Irving wrote:
>>> On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern wrote:
>>>> On Thu, Sep 30, 2010 at 15:30, Geoff
On Thu, Sep 30, 2010 at 16:00, Geoffrey Irving wrote:
> On Fri, Oct 1, 2010 at 9:38 AM, Robert Kern wrote:
>> On Thu, Sep 30, 2010 at 15:30, Geoffrey Irving wrote:
>>> Hello,
>>>
>>> I'm not sure where the correct place to ask questions about Mayavi,
t, unfortunately. The only way I have found is to
assign UV texture coordinates to the vertices and slap on a texture.
Assigning the UV coordinates is usually not easy.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by o
have any code that
actually does it. Most likely the author assumed that it would be
faster (or tested it to be faster with their CPU/hard disk
configuration) to not compress.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrib
On Wed, Sep 29, 2010 at 20:11, wrote:
> On Wed, Sep 29, 2010 at 9:03 PM, Damien Morton wrote:
>> On Thu, Sep 30, 2010 at 3:28 AM, Robert Kern wrote:
>>> On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
>>>> Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote
On Wed, Sep 29, 2010 at 12:00, Pauli Virtanen wrote:
> Wed, 29 Sep 2010 11:15:08 -0500, Robert Kern wrote:
> [clip: inplace addition with duplicates]
>> Use numpy.bincount() instead.
>
> It might be worthwhile to add a separate helper function for this
> purpose. Bincount ma
+= y" idiom in order to do
something different to achieve the semantics you want.
--
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."
-- Umber
/ len([]) -> 0.0 / 0 -> nan, so yes.
--
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
___
interface
self.base = base
Constructor information:
Definition: np.lib.stride_tricks.DummyArray(self, interface, base=None)
Then np.asarray() will consume that object to make an ndarray that
references the given memory.
--
Robert Kern
"I have come to believe that the whole wor
On Wed, Sep 22, 2010 at 10:48, wrote:
> On Wed, Sep 22, 2010 at 10:34 AM, Robert Kern wrote:
>> On Wed, Sep 22, 2010 at 09:27, wrote:
>>> I would like to generate random numbers based on a random seed, for
>>> example what numpy.random does if the seed is not spec
y (using buffer=).
>
> But, how to then efficiently find a sequence?
mmap objects have most of the usual string methods:
[~]
|2> f = open('./scratch/foo.py', 'r+b')
[~]
|4> m = mmap.mmap(f.fileno(), 0)
[~]
|6> m.find('import')
11
[~]
|7> m[11:1
33437794758841e-288)
> Alternatively, what's a good way to randomly generate an initial
> state?
np.random.RandomState() will do the best thing on each platform.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible b
On Tue, Sep 21, 2010 at 17:40, Pauli Virtanen wrote:
> Tue, 21 Sep 2010 17:28:08 -0500, Robert Kern wrote:
> [clip]
>>> *that* == return a complex number from .real
>>
>> What is the alternative? I'm personally happy with saying that many of
>> the operations
> It probably shouldn't do *that* at the least.
>
> *that* == return a complex number from .real
What is the alternative? I'm personally happy with saying that many of
the operations we define on numpy arrays can be done because we know
the types and that object arrays subvert th
reason that np.mean() gives the same result as np.ma.mean() is that it
simply defers to the .mean() method on the object, so it works as
expected on a masked array. Many other functions will not.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigm
m = mmap.mmap(f.fileno(), 0)
In [23]: buffer(m)
Out[23]:
--
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
_
ollowing contents:
>
> *.o
> *.a
> *.pyc
> *.swp
> *~
> build
*.pyo
*.so
*.pyd
.gdb_history
dist
--
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
On Mon, Sep 13, 2010 at 21:24, David Goldsmith wrote:
> (Sorry for the OT post; I thought I'd get a more sympathetic response
> here than on the MATLAB lists.) ;)
I'm sorry, but that's *really* off-topic.
--
Robert Kern
"I have come to believe that the whole worl
601 - 700 of 2838 matches
Mail list logo