Matthias Bläsing wrote:
Am Wed, 28 May 2008 10:41:51 -0700 schrieb davidj411:
I like the str2num function approach, but then i get left with a float
that has more than 2 decimal spaces , i.e. 11.50 becomes
11.449 and round will not fix that.
Welcome to the wonderful world of float
Am Wed, 28 May 2008 10:41:51 -0700 schrieb davidj411:
> I like the str2num function approach, but then i get left with a float
> that has more than 2 decimal spaces , i.e. 11.50 becomes
> 11.449 and round will not fix that.
Welcome to the wonderful world of floating point numbers. For
On May 28, 2:22 am, Kam-Hung Soh <[EMAIL PROTECTED]> wrote:
> David Jackson wrote:
> > i used the csv module and saved its contents to a list.
>
> > ['Date', 'No.', 'Description', 'Debit', 'Credit']
> > ['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45']
> > ['3/04/2007', '5678', 'THE HOME DEP
David Jackson wrote:
i used the csv module and saved its contents to a list.
['Date', 'No.', 'Description', 'Debit', 'Credit']
['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45']
['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity FL', '', '25.40']
the credit/debit fields are strings.
what
En Tue, 27 May 2008 13:00:05 -0300, David Jackson <[EMAIL PROTECTED]>
escribió:
i used the csv module and saved its contents to a list.
['Date', 'No.', 'Description', 'Debit', 'Credit']
['3/17/2006', '5678', 'ELECTRONIC PAYMENT', '', '11.45']
['3/04/2007', '5678', 'THE HOME DEPOT 263 SomeCity
On Feb 28, 5:56 pm, davidj411 <[EMAIL PROTECTED]> wrote:
> i am parsing a cell phone bill to get a list of all numbers and the
> total talktime spend on each number.
>
> (snipped)
>
> I actually found a good solution.
> (snipped)
If you post 1-2 samples of the cell phone bill input, I am sure you
On Fri, 29 Feb 2008 13:32:15 -0800 (PST)
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > You have to get rid of the double quotes first.
>
> you mean replace them with nothing?
>
> li[4].replace('"','')
Sure, that will do. However, look at the csv module for another way of
handling this.
"davidj411" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
|i am parsing a cell phone bill to get a list of all numbers and the
| total talktime spend on each number.
|
| i already have a unique list of the phone numbers.
| now i must go through the list of numbers and add up the tot
> You have to get rid of the double quotes first.
you mean replace them with nothing?
li[4].replace('"','')
once i do that, i should be able to use them as numbers.
--
http://mail.python.org/mailman/listinfo/python-list
davidj411 wrote:
> i am parsing a cell phone bill to get a list of all numbers and the
> total talktime spend on each number.
>
> i already have a unique list of the phone numbers.
> now i must go through the list of numbers and add up the totals for
> each number.
> on the bill, each line has a f
On Thu, 28 Feb 2008 14:56:10 -0800 (PST)
davidj411 <[EMAIL PROTECTED]> wrote:
> ValueError: invalid literal for int() with base 10: '"2"'
>
>
> here is the question:
>
> How can i convert a string number like "2" to a true number that can
> be added.
You have to get rid of the double quotes fir
i am parsing a cell phone bill to get a list of all numbers and the
total talktime spend on each number.
i already have a unique list of the phone numbers.
now i must go through the list of numbers and add up the totals for
each number.
on the bill, each line has a few fields,one field containing
12 matches
Mail list logo