PM
To
tutor@python.org
cc
Subject
[Tutor] An interesting case... of east vs. west
I was trying to read in a tab delimited file i was given with lat and lon,
the thing is I needed decimal lat, and decimal long... well, anyway I
think you can see what my problem was:
for i in range(0,344)
I will work with this further, and report back once I find Alan's method...
but for now, this seems to work:
for i in range(0,20):
y=d[i][2].split('\xb0')
x=d[i][3].split('\xb0')
ydeg,ymin=int(y[0].rstrip()),float(y[1].strip('\' N'))
xdeg,xmin=int(x[0].rstrip()),float(x[1].rstrip("\' E").rstrip("
"John" <[EMAIL PROTECTED]> wrote
> you can see what my problem was:
>
> for i in range(0,344)
> y=d[i][2].split('\xb0')
> x=d[i][3].split('\xb0')
> ...
> declon=int(xdeg)+(float(xmin)/60)
The first thing I'd suggest is not to try to do it all in one step.
Break it into chunks and wri
A little closer, this seems to work, but it's not catching the 'W' or 'S'
cases to make it negative...
for i in range(0,20):
y=d[i][2].split('\xb0')
x=d[i][3].split('\xb0')
ydeg,ymin=int(y[0].rstrip()),float(y[1].strip('\' N'))
xdeg,xmin=int(x[0].rstrip()),float(x[1].rstrip("\' E").rstrip
On 7/10/07, John <[EMAIL PROTECTED]> wrote:
I was trying to read in a tab delimited file i was given with lat and lon,
the thing is I needed decimal lat, and decimal long... well, anyway I think
you can see what my problem was:
for i in range(0,344)
y=d[i][2].split('\xb0')
x=d[i][3].spli
ECTED]>*
Sent by: [EMAIL PROTECTED]
07/10/2007 04:22 PM
To
tutor@python.org cc
Subject
[Tutor] An interesting case... of east vs. west
I was trying to read in a tab delimited file i was given with lat and lon,
the thing is I needed decimal lat, and decimal long... well, anyway I think
you
John wrote:
> Just a quick follow up.. it doesn't work :s
>
> There are definitely some problems... ideas are welcome!
I have an idea: use a regular expression :D
Unfortunately, I don't have the knowledge of these down well enough to
just spout one off OTOH,
and I've got somewhere I have to be,
Just a quick follow up.. it doesn't work :s
There are definitely some problems... ideas are welcome!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I was trying to read in a tab delimited file i was given with lat and lon,
the thing is I needed decimal lat, and decimal long... well, anyway I think
you can see what my problem was:
for i in range(0,344)
y=d[i][2].split('\xb0')
x=d[i][3].split('\xb0')
ydeg,ymin=y[0].strip(),y[1].rstrip(