Note that there are some explanatory texts on larger screens.

plurals
  1. PORead in Dates from file to be used in plots
    primarykey
    data
    text
    <p>I am trying to read date stamps in from a data logger and use these dates in plots. I have been playing with matplotlib dates date2num, datestr2num, and datetime but I keep getting formatting errors and am having trouble finding what the correct syntax and keywords are to do this (and also what they mean). I have been reading through the matplotlib help with not much luck. If you have any help or a better way to read in this information I would love the feedback.</p> <pre><code>import numpy as n import matplotlib.pyplot as p import matplotlib.dates as d import datetime as dt fileobj=open("filename",'r') data=fileobj.readlines() fileobj.close() time=n.empty(len(data)) for i in range(len(data)): strings=data[i].split(',') if i &gt;5: some_time_dt = dt.datetime.strptime(str(strings[0]), '%Y-%m-%d %H:%M:%S') time = d.date2num(some_time_dt) </code></pre> <p>Example data:</p> <pre><code>"2013-02-28 16:53:30",1588,11.85,24.35,22.93,24.1,25.05,22.06,22.2,30.94,21.99,22.7,21.91,22‌​.02,21.79 ,21.72 "2013-02-28 16:53:31",1589,11.85,24.35,23,24.12,25.05,22.09,22.25,31.19,21.97,22.71,21.91,22‌​.02,21.78 ,21.72 "2013-02-28 16:53:32",1590,11.85,24.35,22.98,24.12,25.05,22.12,22.3,31.35,21.98,22.68,21.9,2‌​2.01,21.7 4,21.69 "2013-02-28 16:53:33",1591,11.85,24.35,22.95,24.14,25.06,22.15,22.33,31.49,21.96,22.67,21.87‌​,22,21.73 ,21.66 </code></pre> <p>March 20,2013 I was able to get this to plot but I need to know how to get rid of the UTC label that prints as the time is not in UTC but in PST. I would prefer to just not show a timezone at all.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload