[Tutor] python plotting

Francois Dion francois.dion at gmail.com
Tue Jan 19 22:28:46 EST 2016


I'm guessing you loaded from pandas import *... It is better to import
pandas as pd, then use pd.read_csv. I also tend to name my data frames df
or a variation and time series as ts.

Speaking of series, If your data is not a series with a datetime type, then
it will be plotted as a categorical, meaning each different X value is
represented at a constant interval, in index order. You need to convert
your time string to a datetime. (pd.to_datetime is your friend).

Francois

On Tue, Jan 19, 2016 at 2:28 PM, Bachir Bachir via Tutor <tutor at python.org>
wrote:

>  Dear all,
> I have some data taken at specific time of the day and i  want to display
> those data according to the time,attached is the cvs file and the display
> output from python pandas . I used the following script
>  v2=read_csv('v2_12.dat')  #data frame for v2
>  v2.plot(kind='bar', x='Time_hhmmss', y='Av_phase',figsize=(12,1))
> #display for v2 only
> I want to see a gap on the display because there was no data recorded
> between  08:20:56  and   14:55:33      but on my display i see them side by
>  side Is there any way to do  this using python display optionsYour help is
> highly appreciated Thanks much
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
raspberry-python.blogspot.com - www.pyptug.org - www.3DFutureTech.info -
@f_dion


More information about the Tutor mailing list