Re: [Tutor] numpy.mean across multiple netcdf files

2011-08-10 Thread Andre' Walker-Loud
Hello Anonymous Questioner, First - you will probably be told this isn't the correct email list for this question - this is a general python tutorial list, while your question is numpy specific, so if this doesn't help, you should probably look to another email list. There are a couple general

[Tutor] numpy.mean across multiple netcdf files

2011-08-10 Thread questions anon
I have many ncfiles each containing one month of hourly temperature data. I have worked out how to loop through a number of ncfiles and calculate the mean for each file at a particular time and even plot this and output as a *.png. What I am unsure of is how to calculate the mean at a particular ti

Re: [Tutor] visualizing a point on a 3-dimensional surface

2011-08-10 Thread Steven D'Aprano
Shwinn Ricci wrote: Say I have a point that I want to visualize by placing a small marker there on the surface of an object. However, what if it's a 3-dimensional object? Would you just use a 3-D coordinate system and then use a rotatable camera script to wheel around and get a better view of the

Re: [Tutor] converting string to float

2011-08-10 Thread Steven D'Aprano
Shwinn Ricci wrote: however, I want to convert position to a floating point number, as the actual cell value is in the form of X.XXX (where X = digits). When I try float(position) I get a ValueError saying that the string could not be converted to a float. What am I doing wrong? Inspect the st

Re: [Tutor] converting string to float

2011-08-10 Thread James Reynolds
On Wed, Aug 10, 2011 at 3:16 PM, Shwinn Ricci wrote: > I am reading values from excel using xlrd and using a variable to store > them in (as part of a loop), as such: > > position = sheet.cell(j, i).value > > however, I want to convert position to a floating point number, as the > actual cell va

Re: [Tutor] converting string to float

2011-08-10 Thread Ken
Not sure since a simple float("1.111") worked for me try type() to see what your variable is being returned as. On Wed, Aug 10, 2011 at 3:16 PM, Shwinn Ricci wrote: > I am reading values from excel using xlrd and using a variable to store > them in (as part of a loop), as such: > > position =

[Tutor] converting string to float

2011-08-10 Thread Shwinn Ricci
I am reading values from excel using xlrd and using a variable to store them in (as part of a loop), as such: position = sheet.cell(j, i).value however, I want to convert position to a floating point number, as the actual cell value is in the form of X.XXX (where X = digits). When I try float(po

[Tutor] visualizing a point on a 3-dimensional surface

2011-08-10 Thread Shwinn Ricci
Say I have a point that I want to visualize by placing a small marker there on the surface of an object. However, what if it's a 3-dimensional object? Would you just use a 3-D coordinate system and then use a rotatable camera script to wheel around and get a better view of the point? __

Re: [Tutor] precision?

2011-08-10 Thread Alan Gauld
On 10/08/11 10:41, Walter Prins wrote: Hi Steven D'Aprano wrote: > Thousandth digit??? Python doesn't support floating point numbers ... except of course if you're using an arbitrary precision math package like mpmath or bigfloat. (I would've thought the fact that the original poste

Re: [Tutor] precision?

2011-08-10 Thread Walter Prins
Hi Steven D'Aprano wrote: > > Thousandth digit??? Python doesn't support floating point numbers with a > > thousand digits! I think about seventeen is about the limit. > ... except of course if you're using an arbitrary precision math package like mpmath or bigfloat. (I would've thought the fact

Re: [Tutor] precision?

2011-08-10 Thread Peter Otten
Steven D'Aprano wrote: > Shwinn Ricci wrote: >> When comparing a given value with a database of values, but allowing for >> freedom due to variation at say, the thousandth digit, how does one >> generalize the precision to this degree? I don't want to truncate, so is >> there a round() function th