Fwd: Eliminate "extra" variable

Igor Korot ikorot01 at gmail.com
Sun Dec 8 21:58:18 CET 2013

---------- Forwarded message ----------
From: Igor Korot <ikorot01 at gmail.com>
Date: Sun, Dec 8, 2013 at 12:57 PM
Subject: Re: Eliminate "extra" variable
To: Roy Smith <roy at panix.com>

Hi, guys,
Thank you for all those valuable suggestions.
2Tim Chase:
I guess you missed this: "My originalData comes from the database
query" and so the checking of the data quality is a DB burden. ;-)
As to the function: the function purpose is to process the data and
give out the list of dates and the dictionary of date:frequency.
It's input is the query result, so there is no looping when the
function is called. It is called only once.

Also, the data comes from either SQLite or mySQL and so to eliminate
the difference between those engines dates are processed as strings
and converted to dates for the calculation purposes only.
Maybe I will need to refactor SQLite processing to get the dates as
dates and not a string, but that's probably for the future. so that
dates will be kept as the datetime type until the end of the function.
As I wrote the dates will be used as the text for the plotting window
axis labels and as the labels they should come out as strings, hence
the conversion.

Thank you.

On Sun, Dec 8, 2013 at 12:07 PM, Roy Smith <roy at panix.com> wrote:
> In article <mailman.3738.1386529877.18130.python-list at python.org>,
>  Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>> On 08/12/2013 18:58, Tim Chase wrote:
>> > On 2013-12-07 23:14, Igor Korot wrote:
>> [big snip]
>> >
>> Whenever I need date manipulations I always reach out to this
>> http://labix.org/python-dateutil
> The problem with dateutil is it's dog slow.  Sure, I use it too, when
> convenience is more important than performance, but have you ever looked
> at the code for dateutil.parser.parse()?  It's worth reading, just for
> fun.
> --
> https://mail.python.org/mailman/listinfo/python-list

More information about the Python-list mailing list