Perl and Python, a practical side-by-side example.

John Machin sjmachin at lexicon.net
Fri Mar 2 22:57:03 EST 2007


On Mar 3, 12:36 pm, Bruno Desthuilliers >
[snip]
>      DATE = 5
>      TARGET = 6
[snip]
> Now for the bad news: I'm afraid your algorithm is broken : here are my
> test data and results:
>
> input = [
>      #ID  STATE ...  ...  ... TARG DATE
>      "aaa\tAAA\t...\t...\t...\tBBB\t20071212\n",
[snip]

Bruno, The worse news is that your test data is broken. According to
the OP (and your own code (DATE = 5 etc)), the target state comes
last. GIGO. At least you have demonstrated to the OP why naming the
field indexes is a good idea :-)
Cheers,
John




More information about the Python-list mailing list