loop through arrays and find maximum

2011-12-05 Thread questions anon
I would like to calculate the max and min across many netcdf files. I know how to create one big array and then concatenate and find the numpy.max but when I run this on 1000's of arrays I have a memory error. What I would prefer is to loop through the arrays and produce the maximum without having

Re: mask one array using another array

2011-11-21 Thread questions anon
thank you, that makes sense. I should have posted this on another list (which I have now). and the change required is: If your new array is x, you can use: numpy.ma.masked_array(x, mask=mask.mask) On Tue, Nov 22, 2011 at 11:48 AM, MRAB wrote: > On 21/11/2011 21:42, questions anon wr

mask one array using another array

2011-11-21 Thread questions anon
I am trying to mask one array using another array. I have created a masked array using mask=MA.masked_equal(myarray,0), that looks something like: [1 - - 1, 1 1 - 1, 1 1 1 1, - 1 - 1] I have an array of values that I want to mask whereever my mask has a a '-'. how do I do this? I

Re: memory error

2011-09-28 Thread questions anon
= plt.axes([l+w+0.025, b, 0.025, h], ) cbar=plt.colorbar(CS, cax=cax, drawedges=True) #save map as *.png and plot netcdf file plt.savefig((os.path.join(OutputFolder, ncvariablename+date_string+'UTC.png'

memory error

2011-09-13 Thread questions anon
Hello All, I keep coming across a memory error when processing many netcdf files. I assume it has something to do with how I loop things and maybe need to close things off properly. In the code below I am looping through a bunch of netcdf files (each file is hourly data for one month) and within ea

add an entry to twentyquestions.org (please)

2010-03-21 Thread twenty questions
add an entry to http://www.twentyquestions.org (please) -- http://mail.python.org/mailman/listinfo/python-list

Are there sprintf in Python???

2007-01-22 Thread questions?
Are there any sprintf in Python? I know you can print to files(or redefine sys.stout) and later open the file content. Are there similar function to sprintf in C? Thanks -- http://mail.python.org/mailman/listinfo/python-list

example from the book

2007-01-17 Thread questions?
I am a little confused by an example in python book: class wrapper: def __init__(self,object): self.wrapped=object def __getattr__(self,attrname): print "Trace:",attrname print getattr(self.wrapped,attrname) (*) return getattr(self.wrapped,attrname)

Re: os.system call problem

2006-04-27 Thread questions?
Fredrik Lundh wrote: > "questions?" <[EMAIL PROTECTED]> wrote: > > > I use os.system to call a display program, e.g. > > > > os.system(displayblah blah) to call display. the program starts and > > display things I wanted. When I kill display, somehow

os.system call problem

2006-04-27 Thread questions?
I use os.system to call a display program, e.g. os.system(displayblah blah) to call display. the program starts and display things I wanted. When I kill display, somehow the python program don't understand I want to move on, keep calling os.system(displayblah blah) again and again. I have to kill

graph display(please help)

2006-02-22 Thread questions?
I heard from my friend who used to program in JAVA, it is really easy to do graph display in JAVA. I wonder whether there are similiar packages in Python I can use. Since I know a little bit Python syntax already, I can easily learn more in Python. I want to display connected graph(directed or u

redirect and python

2006-02-01 Thread questions?
I am calling system command in python by os.system() I do, os.system("wget http://blah blah blah") then I run the program by ./programname >redirected file The things put to screen doesn't redirect to the file I want. What's the trick in here? Thanks -- http://mail.python.org/mailman/listinfo

Re: GUI and graph

2005-12-23 Thread questions?
Thanks all you guys for the help. -- http://mail.python.org/mailman/listinfo/python-list

GUI and graph

2005-12-22 Thread questions?
I have a graph with different parameters along different parts of the graph. I want to have a program that can display the graph with coloring for different part of the graph. Is this possible in Python? What should I read? Thanks for any comments -- http://mail.python.org/mailman/listinfo/pyth

Re: List index question

2005-12-07 Thread questions?
sorry, I realized the problem already. sorry for the confusion. THanks for the answer!!! -- http://mail.python.org/mailman/listinfo/python-list

List index question

2005-12-07 Thread questions?
I want to do list index function. >>> y=['1','2','3','4'] >>> y ['1', '2', '3', '4'] >>> y.index['2'] Traceback (most recent call last): File "", line 1, in ? TypeError: unsubscriptable object It works with y=[1,2,3,4]. Anyone has any hint, what's the reason here? thanks -- http://mail.pytho

3-dimensional plot in Python?

2005-11-11 Thread questions?
I want to make a 3d plot. x is a vector(discrete), y is also a vector(discrete), for each pairwise x,y I have a value z(x,y)(it is not a function, just discrete values for each pair of x,y) I want to show them on a two dimensional plot by showing z(x,y) with colors. Thanks for any hint -- http:

random number generator

2005-11-03 Thread questions?
How to generate a random number in Python. Is there any build in function I can call? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I run python interactively?

2005-11-02 Thread questions?
Thanks guys for the reply. This is very helpful -- http://mail.python.org/mailman/listinfo/python-list

how can I run python interactively?

2005-11-02 Thread questions?
I need to stop the program in the middle and pause there. Are there anyway I can stop the program in the middle and have something like: please press y to continue. Thanks -- http://mail.python.org/mailman/listinfo/python-list