[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] rearranging data files



On Fri, Jun 07, 2002 at 09:05:06AM -0400, Andrew Perrin wrote:
| Ha! Perl 1, Python 0....
| 
| (Sorry, couldn't resist.)

;-).

| On Fri, 7 Jun 2002, Joerg Johannes wrote:
| 
| > Am Freitag, 7. Juni 2002 01:21 schrieben Sie:
| > Thank you, Matias, for your reply. I tried out your script, but I get the 
| > following error when using it:
| > 
| > jorg@blaubaer:~/test$ ./datenumkehr.py jo-001.asc 
| > Traceback (most recent call last):
| >   File "./datenumkehr.py", line 14, in ?
| >     if float(numbers[i])>=0:
| > ValueError: empty string for float()
| > 
| > As I never learned python (nor an other scripting language), I don't know 
| > what that means, nor how to fix it.
| > Any idea?

What the error means is this :
    You tried to convert the number in the string "" (empty string) to
    a float (decimal).  
That can't be done -- the string doesn't contain a number.  (perl, of
course, will magically turn it into the number 0.0 without a single
warning)  

The problem could be caused by a programmer error, or it could be due
to incorrect input, or it could be due to the input being correct but
not what the programmer expected it to be.

If the other solutions don't work for you (or if you really want to
see the python one work :-)), can you post the data somewhere since we
already have the code and perhaps someone will debug it.

-D

-- 

The light of the righteous shines brightly,
but the lamp of the wicked is snuffed out.
        Proverbs 13:9
 
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg

Attachment: pgpIi1gM6lBXM.pgp
Description: PGP signature


Reply to: