[Chicago] Using split to arrays

Freddy Martinez freddymartinez9 at gmail.com
Mon Mar 12 20:22:20 CET 2012


Yes, that's more to the point of what I need in the details array. I
assume the notStrings parser would be run in its own for loop that
would turn the strings into elements of an array?

On Mon, Mar 12, 2012 at 1:47 PM, J. D. Jordan <zanson at zanson.org> wrote:
> Is your issue that you want stuff not to be strings?  What you
> currently have is details[0] is
> ['09:30:17', '100', '120.42', '', '']
> It is an array of strings, which can be treated as lists.  If you want
> to get the stuff to not be strings you will need to parse them...
> Something like
> notStrings = [datetime.strptime(details[0][0], "%H:%M:%S").time(),
> int(details[0][1]), float(details[0][2]), int(details[0][3]) if
> details[0][3] else 0, int(details[0][4]) if details[0][4] else 0]

More information about the Chicago mailing list