I don't know anything about graphing modules, actually i am looking
for a good one myself which is why you post caught my eye.

I might be able to help with # 3
There are loads of python modules for time/string manipulation which
are really easy to use. You should use seconds as your x axis. it is
common for timestamps to be in seconds and there are lots of modules
and examples that work with them. converting them back and forth in a
myriad of formats.

I have used timedelta (http://docs.python.org/lib/datetime-
timedelta.html) to calculate how many seconds are in a number of
hours.

from datetime import timedelta

timeStr = '0:03:28.234'
timeArray = timeStr.split(':')
hours = float(timeArray[0])
min = float(timeArray[1])
sec = float(timeArray[2])
time = timedelta(hours=hours, minutes=min,seconds=sec)

now you can do

print time.seconds

This may not be exactly what you want. i'd have a look at the time
module http://docs.python.org/lib/module-time.html do a search for
some examples


toby


On 25 Sep, 08:28, "Dalius Dobravolskas"
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> > 1. What libraries/modules should I be using to draw these graphs?
>
> matplotlib
> Samples:http://www.google.lt/search?q=matplotlib+pylons
>
> > 2. Is there any plotting library that understands datetime objects,
> > and can graph them intelligently?
>
> > If the answer to 2 is no...
>
> I don't know.
>
> > 3. How can I turn a datetime object (essentially six numbers) into a
> > single floating point number? For instance, Friday at 1 PM is 6.93,
> > and Friday at 3 PM is 7.71, or something like that which will be
> > possible to graph. Know what I mean? I need to translate/transform a
> > datetime object into a single number that will create a non-distorted
> > graph when that number is used as the X-value for an event (data
> > point).
>
> 1. Convert datetime object to timestamp object.
> 2. Convert previous Monday or Sunday to timestamp (is in seconds).
> 3. Subtract one from another and divide them by number of seconds in
> day (or whatever you want).
>
> > 4. How can I change the labels on the X-axis to say Friday, 1 PM,
> > instead of saying 6.93.
>
> I guess 1 PM is more like 6.54 or even 5.54 or 4.45.
> 1) int(5.54) => 5.
> 2) {0: 'Sunday', 1: 'Monday'....
> 3) round((5.54-int(5.54))*24) -> 13 ...
>
> > Thank you. Also, if I have to do 3 and 4 I will be really, really sad.
>
> Don't be lazy ;-)
>
> --
> Daliushttp://blog.sandbox.lt

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to