473,474 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Plot dates in int format against values

1 New Member
I have a list of values in an array named V that i need to plot against a list of "dates". At the moment the dates are in an array (spanning 6 months) in the format date=['20130322", '20130323', '20130324' etc]
How do i convert these dates into dates that can be sensibly plotted?
Sep 13 '12 #1
1 1537
bvdet
2,851 Recognized Expert Moderator Specialist
The dates can be formatted for display using the time module.
Expand|Select|Wrap|Line Numbers
  1. >>> import time
  2. >>> dates = ['20130322', '20130323', '20130324']
  3. >>> print "\n".join([time.strftime('%b %d, %Y', time.strptime(d, '%Y%M%d')) for d in dates])
  4. Jan 22, 2013
  5. Jan 23, 2013
  6. Jan 24, 2013
  7. >>> 
Sep 14 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Evagelia Tsiligianni | last post by:
Hello! I am trying to find a tool that can plot and print (plotted) data. I need it supports plotting dates as well. I 've tried wxPlot and chaco but each of them applies one of my requests...
3
by: Clark Kent | last post by:
HI! Any one can tell why VB.Net gives error Operator '*' is not defined for types 'Microsoft.DirectX.Matrix' and 'Microsoft.DirectX.Matrix'. from lines that are below and in C# it works...
3
by: Steve Weixel | last post by:
I'm having problems getting dates to format the way that I need them to. The problem is that I'm used to the VB6 way of doing things, with which the statement Format(37866, "dd MMM yyyy") would...
1
by: Vera | last post by:
I have a problem formatting a string I have a decimal myDecimal which contains 0,3 What I want to display in a string is "€ 0,30" So here's what I do Dim myString As Strin Dim prov As...
2
by: Rares Vernica | last post by:
Hi, Can I use locale to format monetary values? If yes, how? If no, is there something I can use? E.g., I have 10000 and I want to get "$10,000". Thanks, Ray
5
by: A.M | last post by:
Hi, I have a datetime value and want to format it to "June 1, 2006" shape. How can I do that? Thank you,
0
by: OKB (not okblacke) | last post by:
I just downloaded matplotlib and I was trying to do some simple date plots, but I'm running up against a puzzling error. Whenever I attempt to plot dates, I get an exception on line 157 of...
2
by: Twanne | last post by:
How do you compare dates that are in dd/mm/yyyy format?? Al my dates are stored like this but access keeps checking them by mm/dd/yyy format. When access can't convert my dd/mm/yyyy format, it uses...
2
by: paulquinlan100 | last post by:
Hi I'm trying to execute the following code: sSQL = "insert into lkpChanges (SiteRef,ProjectName,InvestmentType,FieldChanged,PreviousDate,NewDate,ChangeDate,CurrentRelaunch) " & _ "values ("...
2
by: Durand | last post by:
Hi, I'm trying to plot a simple graph against date or time using matplotlib. I've read about date_plot but I'm not really sure how to use it. At the moment, I have some data arranged into lists,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.