lot in advance.
Best,
Chao
--
please visit:
http://www.globalcarbonatlas.org/
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batimen
ec,pint = math.modf(x)
if pdec > threshold:
return int(math.ceil(pint)+1)
else:
return int(math.ceil(pint))
On Wed, Jul 16, 2014 at 3:18 PM, Chao YUE wrote:
> Dear all,
>
> I have two arrays with both float type, let's say X and Y. I wan
Dear all,
A bit sorry, this is not difficult. scipy.optimize.minimize_scalar seems to
solve my problem. Thanks anyway, for this great tool.
Cheers,
Chao
On Wed, Jul 16, 2014 at 3:18 PM, Chao YUE wrote:
> Dear all,
>
> I have two arrays with both float type, let's say X an
self grow mask attribute one day which will be equivalent to isnan.
> Bit views, anyone?)
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
--
please visit:
http://www.globalcarbonatla
guess.
Thanks for any comments.
Best,
Chao
--
please visit:
http://www.globalcarbonatlas.org/
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712
Oh, I didn't think it out. thanks.
Chao
On Thu, May 29, 2014 at 11:59 AM, Dave Hirschfeld wrote:
> Chao YUE gmail.com> writes:
>
> >
> >
> >
> > Dear all,
> > I have a simple question. Is there a way to denote the unchanged
> dimension
> in
.)?
thanks a lot in advance,
best,
Chao
--
please visit:
http://www.globalcarbonatlas.org/
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe
Thanks Pierre, good to know there are so many tricks available.
Chao
On Tue, Jul 9, 2013 at 4:55 PM, Pierre Gerard-Marchant wrote:
>
> On Jul 9, 2013, at 16:38 , Chao YUE wrote:
>
> > Sorry I didn't the docs very carefully. there is no doc for np.ma.argmax
>
t;
> On Jul 9, 2013, at 16:08 , Sebastian Berg
> wrote:
>
> > On Tue, 2013-07-09 at 15:14 +0200, Stéfan van der Walt wrote:
> >> On Tue, Jul 9, 2013 at 2:55 PM, Chao YUE wrote:
> >>> I am using 1.7.1 version of numpy and np.ma.argmax is not repecting the
nks,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax
Thanks to the two of you!!
Chao
On Mon, Jun 3, 2013 at 11:53 AM, Sebastian Berg
wrote:
> On Mon, 2013-06-03 at 10:44 +0200, Chao YUE wrote:
> > Dear all,
> >
> > I have an array with 4 dim:
> >
> > In [24]: dd.shape
> > Out[24]: (12, 13, 120, 170)
> &
ers,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax
estion.
>
>
> On Tue, Mar 26, 2013 at 10:23 AM, Chao YUE wrote:
>
>> Hi Neal,
>>
>> I forward you this mail which I think might be of help to your question.
>>
>> Chao
>>
>> -- Forwarded message --
>> From: Chao YUE
>
Hi Neal,
I forward you this mail which I think might be of help to your question.
Chao
-- Forwarded message --
From: Chao YUE
Date: Sat, Mar 16, 2013 at 5:40 PM
Subject: indexing of arbitrary axis and arbitrary slice?
To: Discussion of Numerical Python
Dear all,
Is there
Hi Nathaniel,
thanks for your reply, it works fine and suffice for my purpose.
cheers,
Chao
On Sat, Mar 16, 2013 at 5:49 PM, Nathaniel Smith wrote:
> On 16 Mar 2013 16:41, "Chao YUE" wrote:
> >
> > Dear all,
> >
> > Is there some way to index the num
,slice=0),
by this way you don't have to know the actual shape of the array.
for for 4-dim data, np.retrieve_data(data,axis=2,slice=0) will actually be
data[:,0,:,:]
thanks in advance,
Chao
--
***
Cha
,3,4) to extract the maximum value.
I doubt this is really useful.. too complicated..
Chao
On Fri, Jan 11, 2013 at 11:00 PM, Nathaniel Smith wrote:
> On Thu, Jan 10, 2013 at 9:40 AM, Chao YUE wrote:
> > Dear all,
> >
> > Are we going to consider returning the inde
://stackoverflow.com/questions/4150542/determine-index-of-highest-value-in-pythons-numpy
cheers,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Bat
Thanks. I tried again, it works.
On Thu, Dec 27, 2012 at 10:35 PM, Ralf Gommers wrote:
> from numpy.ma import testutils
>
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSC
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.
ri, Dec 14, 2012 at 3:15 PM, Robert Kern wrote:
> On Fri, Dec 14, 2012 at 1:57 PM, Chao YUE wrote:
> > Dear all,
> >
> > I tried to capture the zero divide error when I divide a masked array by
> > another. It seems that np.seterr is not working for masked array?
> >
consuming. Does anyone have similar situation?
thanks!
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE
lse True True]],
fill_value = 1e+20)
In [96]: np.divide(a,c)
Warning: divide by zero encountered in divide
Out[96]:
array([[ nan, 1., 1., 1.],
[ 1., 1., inf, inf]])
Chao
--
***
Chao YUE
L
in
> numpy array?
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
*******
I am using version 1.6.2
In [77]: np.__version__
Out[77]: '1.6.2'
On Thu, Nov 22, 2012 at 10:08 PM, Chao YUE wrote:
> Dear all,
>
> I tried the np.apply_over_axes and np.ma.apply_over_axes, it seems that
> they are not working for the masked array?
> I searched t
array([[[ 190.]],
[[ 590.]],
[[ 990.]]])
thanks,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF
Thanks for the explanations. Yes, what I am thinking is basically the same
but I didn't test the time.
I never try numexpr, but it would be nice to try it.
Chao
On Thu, Nov 22, 2012 at 3:20 PM, Francesc Alted wrote:
> On 11/22/12 1:41 PM, Chao YUE wrote:
> > Dear all,
> &g
like directly arr1/arr2,
rather than np.divide(arr1,arr2).
best regards,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
911
PM, Thouis (Ray) Jones wrote:
> On Sat, Nov 17, 2012 at 8:28 AM, Chao YUE wrote:
> > Dear all,
> >
> > I need to make a linear contrast of the 2D numpy array "data" from an
> > interval to another, the approach is:
> > I have another two list: "base&qu
Yes, both the "base" and "target" are ascending. Thanks!
Chao
On Sat, Nov 17, 2012 at 2:40 PM, Benjamin Root wrote:
>
>
> On Saturday, November 17, 2012, Chao YUE wrote:
>
>> Dear all,
>>
>> I need to make a linear contrast of the 2D nump
ename:lineno(function)
180470.1100.000 0.1100.000
mathex.py:132(lintrans)
112.495 12.495 19.061 19.061
mathex.py:196(plot_array_transg)
so is there anyway I can speed up this loop? Thanks for any suggestions!!
best,
Chao
--
******
ue, Sep 11, 2012 at 5:24 PM, Chao YUE wrote:
> Dear Richard,
>
> this is what I want. Thanks!
>
> Chao
>
>
> On Tue, Sep 11, 2012 at 3:19 PM, Richard Hattersley > wrote:
>
>> Hi Chao,
>>
>> If you don't mind modifying masked values, then if
a = np.ma.masked_less(np.arange(10),5)
> >>> a.base[3:6] = 1
> >>> a
>
> masked_array(data = [-- -- -- -- -- 1 6 7 8 9],
> mask = [ True True True True True False False False False
> False],
>fill_value = 99)
>
> Regards,
> Richard Ha
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.6
__
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
--
*******
Chao YUE
Laboratoire des Sciences
Thanks Robert. This is exactly what I want. I have a feeling that there
must be something in numpy that can do the job and I didn't know. Thanks
again,
Chao
2012/7/13 Robert Kern
> On Thu, Jul 12, 2012 at 10:32 PM, Chao YUE wrote:
> > Thanks all for the discussion. Actually I am
that I can pick any variables I want to plot as long as
they have the same dimension. otherwise, I have to change the index_range
for every variable.
cheers,
Chao
2012/7/13 Daniele Nicolodi
> On 12/07/2012 23:32, Chao YUE wrote:
> > Thanks all for the discussion. Actually I am tryi
^
SyntaxError: invalid syntax
I hope it's not too long, please comment as you like. Thanks a lot
Chao
2012/7/12 Benjamin Root
>
> On Thu, Jul 12, 2012 at 4:46 PM, Chao YUE wrote:
>
>> Hi Ben,
>>
>> it helps a lot. I am nearly finishing a function in a way I
, 3, 4])
In [28]: b[slice(None,4)]
Out[28]: array([1, 2, 3, 4])
so slice(4) is actually slice(None,4), how can I exactly want retrieve a[4]
using slice object?
thanks again!
Chao
2012/7/12 Benjamin Root
>
>
> On Thu, Jul 12, 2012 at 3:38 PM, Chao YUE wrote:
>
>> Dear al
umber array I want by giving values to function arguments.
thanks a lot,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
911
ing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 157
fine. The cal_cmi_big.py did work several days ago, I still have the file
generated by this script in my directory.
cheers,
Chao
2012/5/27 Chao YUE
> Dear Jeff,
>
> Thanks a lot for your reply. I think it might be related with the memory
> management on our sever. But anyway, as you suggest
n also find
this function in ncfunc.py. I tested all the script and data before I
upload on our ftp.
thanks again for your help,
cheers,
Chao
2012/5/26 Jeff Whitaker
> On 5/26/12 5:51 AM, Chao YUE wrote:
>
> Dear all,
>
> Previously I am able to run a script on our server
cipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - P
descriptors 1024
memorylocked 64 kbytes
maxproc 1024
would anybody be able to give me a short explanation or direct me to some
webpage which can help to understand the problem?
thanks et cheers,
Chao
--
******
Thanks Olivier. it works.
chao
2012/5/23 Olivier Delalleau
> Should be dt3.compressed()
>
> -=- Olivier
>
> 2012/5/23 Chao YUE
>
>> Dear all,
>>
>> is there a command for retrieving unmasked data from a mask array?
>> excepting using dt3[~dt3
Dear all,
is there a command for retrieving unmasked data from a mask array?
excepting using dt3[~dt3.mask].flatten()?
thanks,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement
Thanks Chris for informative post.
cheers,
Chao
2012/5/22 Chris Barker
> On Tue, May 22, 2012 at 6:33 AM, Chao YUE wrote:
>
> > Just in case some one didn't know this. Assign a float number to an
> integer
> > array element will always return integer.
>
>
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.6
thanks for this information.
Chao
2012/5/20 eat
> Hi,
>
> On Sun, May 20, 2012 at 10:21 AM, Chao YUE wrote:
>
>> Dear all,
>>
>> could anybody give one sentence about this? why in the loop I didn't get
>> zerodivision error by when I explicitly do th
by zero
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02;
I forgot whether I installed numpy 1.5.1 by esay_install or manually. But
anyway, I had the same issue with you that I cannot use pip uninstall numpy
to remove 1.5.1.
chao
2012/5/19 Tim Cera
>
>
> On Fri, May 18, 2012 at 5:49 PM, Chao YUE wrote:
>
>> Previously I have ins
/lib/python2.7/dist-packages/numpy/
but because the first path is before the second one in sys.path, so ipython
imports only the first one and ignore the second one.
Then I delete the directory of /usr/lib/pymodules/python2.7/numpy and redo
the import, I get the version 1.6.1
This means that impo
is line by blank space, and
replace special flag. but during this process,
I need to do type conversion.
any suggestion would be appreciated.
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Envi
27;ll find a little warning that I
> commented (because numpy.ma is already slow enough that I didn't want
> to make it even slower)...
>
> On 4/12/12, Chao YUE wrote:
> > Dear all numpy users,
> >
> > I am using numpy 1.6.1
> >
> > I find that if you wan
False False False False
False],
fill_value = 1e+20)
cheers,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Su
_version__
> Out[5]: '1.5.1'
>
> Now if the bug is fixed in 1.6, there's nothing more to do than just
> wait for the update !
> (Debian testing in my case)
>
> Best,
> Pierre
>
>
>
> _______
> NumPy-Discussion mailing list
&g
#x27;F')
array([1, 3, 2, 4])
cheers,
Chao
2012/4/5 Olivier Delalleau
> It works for me, which version of numpy are you using?
> What do you get when you type help(b.flatten)?
>
> -=- Olivier
>
> Le 5 avril 2012 04:45, Chao YUE a écrit :
>
>> Dear all,
>>
x27;C')
---
TypeError Traceback (most recent call last)
/mnt/f/ in ()
TypeError: flatten() takes no keyword arguments
order='F' gave tha same.
cheers,
chao
--
*******
ssubdtype(np.int16, np.integer) would not work, but
> they do.
>
> Cheers,
>Derek
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
*
Dear all,
how can I check type of array in if condition expression?
In [75]: type(a)
Out[75]:
In [76]: a.dtype
Out[76]: dtype('int32')
a.dtype=='int32'?
thanks!
Chao
--
*******
Chao YUE
Labo
,
> >
> > Chao
> >
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
**
thanks and cheers,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02
1].
but I just would like to know maybe there is already something which can do
this there ?
cheers,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UV
thanks. I am using ubuntu (for my local computer) and on our server we have
only ipython or shell... but I think I can try your suggestion on my own
computer.
Chao
2012/3/5
> On Mon, Mar 5, 2012 at 10:27 AM, Chao YUE wrote:
> > Dear all,
> >
> > Sorry this is not the go
script?
thanks to all,
cheers,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.
Hi all,
Is anyone using some python geospatial package that can do jobs like
intersection, etc. the job is like you automatically extract a region on a
global map etc.
thanks and cheers,
Chao
--
***
Chao YUE
thanks.
2012/2/18 Eric Firing
> On 02/18/2012 05:52 AM, Chao YUE wrote:
> > Dear all,
> >
> > I built a new empty masked array:
> >
> > In [91]: a=np.ma.empty((2,5))
>
> Of course this only makes sense if you are going to immediately populate
>
rs,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:
n mailing list
> > NumPy-Discussion@scipy.org
> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
**
y.org/mailman/listinfo/numpy-discussion
>
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Ced
Thanks all.
chao
2012/1/27 Tony Yu
>
>
> On Fri, Jan 27, 2012 at 9:28 AM, Paul Anton Letnes <
> paul.anton.let...@gmail.com> wrote:
>
>>
>> On 27. jan. 2012, at 14:52, Chao YUE wrote:
>>
>> > Dear all,
>> >
>> > suppose I have
Dear all,
suppose I have a ndarray a:
In [66]: a
Out[66]: array([0, 1, 2, 3, 4])
how can use it as 5X1 array without doing a=a.reshape(5,1)?
thanks
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de
t; The early birds rate for the PyCOn ends on Jan 25.
>
> See you in PyCon in March,
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/num
ng list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572
the problem is here,
data=np.empty([10,90,720])
you should always use np.ma.empty if you want to construct a masked empty
array.
Chao
2012/1/3 Chao YUE
> Dear all numpy users,
>
> I have 10 90X720 arrays. let's say they are in a list 'a' with each
> element a 90X720
228, 159, 194,
thanks,
Chao
--
*******
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33)
O Yes You're right... It's fine now.
Merry Christmas to all!
Chao
2011/12/22 Aronne Merrelli
>
>
> On Thu, Dec 22, 2011 at 10:27 AM, Chao YUE wrote:
>
>> Dear all,
>>
>> Just a small question, how can I output different columns of ndarray in
or
np.savetxt('new.csv',data,fmt=('%i4','%f6.3'))
give strange results.
In [33]: data.shape
Out[33]: (6506, 2)
I want the first column integer and second column float.
cheers,
Chao
--
*******
thanks, I should do it but I forgot
chao
2011/12/1
> On Wed, Nov 30, 2011 at 1:16 PM, Chao YUE wrote:
> > Hi all,
> >
> > I just want to broadly ask what statistical package are you guys using? I
> > mean routine statistical function like linear regression, GLM
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.
; d.info = "2011-11-18 nov kilroy" # From()
> savedotdict( d, "d.", fmt="%.3g" )
>
> cheers
> -- denis
>
> (If you use this, could you post it to the numpy-discussion group
> please ?
> It rejects me, grr.)
>
>
> On Nov 10, 11:17 am, C
array variables that need
to be included in the dictionary.
is there something like:
d3[index.name()]=index
while index.name() would equal the string 'index'?
I hope my question is clear. thanks to all.
Chao
--
******
I would say pandas is really cool. More people need to know it. and we
should have better documentation.
cheers,
Chao
2011/10/18 Bruce Southey
> **
> On 10/18/2011 09:12 AM, Chao YUE wrote:
>
> thanks. Olivier. I see.
>
> Chao
>
> 2011/10/18 Olivier Delalleau
&
Thanks Bruce.
2011/10/18 Bruce Southey
> **
> On 10/18/2011 09:12 AM, Chao YUE wrote:
>
> thanks. Olivier. I see.
>
> Chao
>
> 2011/10/18 Olivier Delalleau
>
>> As far as I can tell ma.mean() is working as expected here: it computes
>> the mean only ov
thanks Scott. very good explanation.
cheers,
Chao
2011/10/18 Scott Sinclair
> On 18 October 2011 13:56, Chao YUE wrote:
> > but it's strange that if you use b[...,-1],
> > you get:
> > In [402]: b[...,-1]
> > Out[402]: array([ 9, 19])
> >
> > i
t;
> b = a.mean(0)
> b.mask[a.mask.any(0)] = True
>
> Then b will be:
>
> masked_array(data = [5.0 -- -- 8.0 9.0 -- 11.0 12.0 -- 14.0],
> mask = [False True True False False True False False True
> False],
>fill_value = 1e+20)
>
> -=
really cool, thanks.
Chao
2011/10/18 Olivier Delalleau
> if hasattr(a, 'mask'): # or if isinstance(a, numpy.ma.core.MaskedArray.)
>
> code 1
> else
> code 2
>
> -=- Olivier
>
>
> 2011/10/18 Chao YUE
>
>> Thanks Olivier. but I don
You can also check if
> it is an instance of numpy.ma.core.MaskedArray.
>
> -=- Olivier
>
> Le 18 octobre 2011 08:49, Chao YUE a écrit :
>
>> Just one more question, how can I check a ndarr
Just one more question, how can I check a ndarray is a masked array or not?
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
99]:
masked_array(data =
[[ 0.1.1.5 2.5 3.5 4.5 5.5 6.5 7.5 9. ]
[ 10. 11. 11.5 12.5 13.5 14.5 15.5 16.5 17.5 19. ]],
mask =
False,
fill_value = 1e+20)
thanks,
Chao
--
*****
you are right Eric,
In [405]: b[...,-4:]
Out[405]:
array([[ 6, 7, 8, 9],
[16, 17, 18, 19]])
cheers,
Chao
2011/10/18 Chao YUE
> Thanks Jean
> I just want the last several numbers by indexing from the end.
>
> In [400]: b=np.arange(20).reshape(2,10)
>
> In
t;>[6, 7, 8, 9]])
>>
>
>
> I'm not sure to understand, should not a[:,1:] be sufficient ?
> Did I miss something in your message ?
>
>
--
*******
Chao YUE
Laboratoire des Sciences du
something like:
array([[1, 2, 3, 4],
[6, 7, 8, 9]])
I want to index the final 4 rows. I cannot figure out how to do this?
Thanks for any help,
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de
lt; a) & (a < 8),
>
> which I find less readable and more difficult to type.
>
> Neil
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
good answer
2011/10/14 Matthew Brett
> Hi,
>
> On Fri, Oct 14, 2011 at 4:33 AM, Chao YUE wrote:
> > Dear all,
> >
> > is there any difference between np.nan, np.NaN and np.NAN? they really
> > confuse me
> > they are all Not a Number?
> >
&
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.
shows the original value, so what 's the usage of fill_value in
masked array? can I set a fill_value as np.nan?
Thanks,
Chao
2011/10/13
> On Thu, Oct 13, 2011 at 1:17 PM, Chao YUE wrote:
> > Dear all,
> >
> > I use numpy version 1.5.1 which is installed by default when
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.
1 - 100 of 118 matches
Mail list logo