Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61329

Fwd: Eliminate "extra" variable

References (5 earlier) <CA+FnnTwZ3aF++ZzaAJzG0Y98usfLTge0KTzj14LfqDgh1OnsZQ@mail.gmail.com> <20131208125823.241112db@bigbox.christie.dr> <mailman.3738.1386529877.18130.python-list@python.org> <roy-E243A9.15072508122013@news.panix.com> <CA+FnnTyZzrhwkLvsY0EdvXD_PoTWK45C0=peWGWtse1uEwJC=Q@mail.gmail.com>
Date 2013-12-08 12:58 -0800
Subject Fwd: Eliminate "extra" variable
From Igor Korot <ikorot01@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3744.1386540088.18130.python-list@python.org> (permalink)

Show all headers | View raw


---------- Forwarded message ----------
From: Igor Korot <ikorot01@gmail.com>
Date: Sun, Dec 8, 2013 at 12:57 PM
Subject: Re: Eliminate "extra" variable
To: Roy Smith <roy@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@panix.com> wrote:
> In article <mailman.3738.1386529877.18130.python-list@python.org>,
>  Mark Lawrence <breamoreboy@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Eliminate "extra" variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-08 19:10 +0000
  Re: Eliminate "extra" variable Roy Smith <roy@panix.com> - 2013-12-08 15:07 -0500
    Fwd: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-08 12:58 -0800
    Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-08 16:18 -0600
    Re: Fwd: Eliminate "extra" variable Dave Angel <davea@davea.name> - 2013-12-08 17:36 -0500
    Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-14 23:49 -0800
    Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-15 06:17 -0600
    Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-15 06:29 -0600
    Re: Eliminate "extra" variable Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-12-15 12:08 -0500
    Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 14:46 -0800
    Re: Eliminate "extra" variable MRAB <python@mrabarnett.plus.com> - 2013-12-16 00:58 +0000
    Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 18:43 -0800
    Re: Eliminate "extra" variable Dave Angel <davea@davea.name> - 2013-12-15 21:58 -0500
    Re: Eliminate "extra" variable Chris Angelico <rosuav@gmail.com> - 2013-12-16 13:57 +1100
    Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 20:24 -0800

csiph-web