On Fri, Jan 27, 2012 at 1:29 PM, Robert Kern wrote:
> Well, if you really need to do this in more than one place, define a
> utility function and call it a day.
>
> def should_not_plot(x):
> if x is None:
> return True
> elif isinstance(x, np.ndarray):
> return x.size == 0
>
Hi Ruby,
I still do not fully understand your question but what I do in such cases is to
construct a very simple array and test the functions.
The help of numpy.histogram2d or numpy.histogramdd (for more than two dims)
might help here.
So I guess, basically you want to ignore the x,y positions
Sorry, I realize I didn't describe the problem completely clear or correct.
the (x,y) in this case is just many co-ordinates, and each coordinate
has a list of values (Z value) associated with it. The bins are
allocated for the Z.
I hope this clarify things a little. Thanks again.
Ruby
On
I think this is exactly what I need. Thanks for your help, Olivier.
Ruby
On Fri, Jan 20, 2012 at 9:50 AM, Olivier Delalleau wrote:
> What do you mean by "summarize"?
> If for instance you want to sum along Y, just do
> my_array.sum(axis=1)
>
> -=- Olivier
>
> 2012/1/20 Ruby Stevenson
>>
>> hi
> You'd want to update your mask appropriately to get everything you
> want to select, one criteria at a time e.g.:
> mask = a[:,0] == 1
> mask &= a[:,1] == 1960
>
> Alternatively:
> mask = (a[:,0] == 1) & (a[:,1] == 1960)
> but be careful with the parens, & and | are normally high-priority
> bitw
On Mon, Jan 30, 2012 at 11:31 AM, Ted To wrote:
> On 01/30/2012 12:13 PM, Brett Olsen wrote:
>> On Mon, Jan 30, 2012 at 10:57 AM, Ted To wrote:
>>> Sure thing. To keep it simple suppose I have just a two dimensional
>>> array (time,output):
>>> [(1,2),(2,3),(3,4)]
>>> I would like to look at all
> Thanks! That works great if I only want to search over one index but I
> can't quite figure out what to do with more than a single index. So
> suppose I have a labeled, multidimensional array with labels 'month',
> 'year' and 'quantity'. a[['month','year']] gives me an array of indices
> but "
On 01/30/2012 12:13 PM, Brett Olsen wrote:
> On Mon, Jan 30, 2012 at 10:57 AM, Ted To wrote:
>> Sure thing. To keep it simple suppose I have just a two dimensional
>> array (time,output):
>> [(1,2),(2,3),(3,4)]
>> I would like to look at all values of output for which, for example time==2.
>>
>>
On Mon, Jan 30, 2012 at 10:57 AM, Ted To wrote:
> Sure thing. To keep it simple suppose I have just a two dimensional
> array (time,output):
> [(1,2),(2,3),(3,4)]
> I would like to look at all values of output for which, for example time==2.
>
> My actual application has a six dimensional array a
Sure thing. To keep it simple suppose I have just a two dimensional
array (time,output):
[(1,2),(2,3),(3,4)]
I would like to look at all values of output for which, for example time==2.
My actual application has a six dimensional array and I'd like to look
at the contents using one or more of the
Ted, can you clarify what you're asking for? Maybe give a trivial example of an
array and the desired output?
I'm pretty sure this is a slicing question though:
> If I have a three dimensional array a=(x,y,z), can I look at the values of z
> given particular values for x and y?
Given that elemen
he is not asking for slicing. he is asking for how to index array by
element value but not element index.
2012/1/30 Zachary Pincus
> a[x,y,:]
>
> Read the slicing part of the tutorial:
> http://www.scipy.org/Tentative_NumPy_Tutorial
> (section 1.6)
>
> And the documentation:
> http://docs.scipy.
a[x,y,:]
Read the slicing part of the tutorial:
http://www.scipy.org/Tentative_NumPy_Tutorial
(section 1.6)
And the documentation:
http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
On Jan 30, 2012, at 10:25 AM, Ted To wrote:
> Hi,
>
> Is there some straightforward way to access
On Mon, Jan 30, 2012 at 3:25 PM, Ted To wrote:
> Is there some straightforward way to access an array by values across a
> subset of its dimensions? For example, if I have a three dimensional
> array a=(x,y,z), can I look at the values of z given particular values
> for x and y?
a[x, y, :] shoul
I am afraid you have to write index inquire function by yourself. I did
like this.
chao
2012/1/30 Ted To
> Hi,
>
> Is there some straightforward way to access an array by values across a
> subset of its dimensions? For example, if I have a three dimensional
> array a=(x,y,z), can I look at the
Hi,
Is there some straightforward way to access an array by values across a
subset of its dimensions? For example, if I have a three dimensional
array a=(x,y,z), can I look at the values of z given particular values
for x and y?
Thanks,
Ted
___
NumPy-D
On Sat, Jan 28, 2012 at 11:14 PM, Charles R Harris <
charlesr.har...@gmail.com> wrote:
>
>
> On Sat, Jan 28, 2012 at 11:15 AM, eat wrote:
>
>> Hi,
>>
>> Short demonstration of the issue:
>> In []: sys.version
>> Out[]: '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit
>> (Intel)]'
>> In
17 matches
Mail list logo