I read csv file with panda. On source file i have column with date and time and some outher columns ( financial OHLC ). When i was reading csv file i was using some parse option ( combine columns on parse like this http://pandas.pydata.org/pandas-docs/stable/io.html?highlight=read%20csv#specifying-date-columns ). On the end i try plot simple graphics from new combined datetime column and some other date. All works, but ploting function creates line only from time date on datetime column. Why ploting function don't understand date component on my datetime column? How can i create graphics from all datetime points?
import pandas as pd
import matplotlib.pyplot as plot
sample_date = pd.read_csv('sample-2dayslineEURUSDM1.csv',parse_dates=[[1, 2]],keep_date_col=True)
date_time=sample_date.icol(0)
date_close=sample_date.icol(6)
plot.plot_date(x=date_time,y=date_close,fmt="r-")
plot.xlabel("Close")
plot.ylabel("Date")
plot.show()
Sample from my csv file:
Time_Open Data Time Open Hight Low Close
0 2015-06-01 01:35:00 2005.02.15 01:35 1.29710 1.2972 1.2969 1.2969
1 2015-06-01 01:36:00 2005.02.15 01:36 1.29700 1.2971 1.2969 1.2970
2 2015-06-01 01:37:00 2005.02.15 01:37 1.29700 1.2972 1.2969 1.2970
My plot with error
I think with my data was all right. I can operate with them and python understand data type. I can do like this:
date_time[0]<date_time[1]
Out[11]: True
date_time[0]-date_time[1]
Out[13]: Timedelta('-1 days +23:59:00')
But matplotlib don't understand my data. I want get graphics that on y axis i see datetime (like this 2015-06-01 23:59:00) and not only time (23:59:00). Now matplotlib plot graphs in 24 hours and don't understand that my data have different days. I get one line in one day, but not 1 line for all my data.