My Python Pandas Dataframe Looks like this:
I want to plot dates on X-axis and values on Y-axis I am able to get it one at a time. Either X axis or Y axis. I want them together in one graph.
I have tried something like this:
import pandas as pd
from pandas import Series, DataFrame, Panel
from mysql.connector import MySQLConnection, Error
from python_mysql_dbconfig import read_db_config
import matplotlib.pyplot as plt
dbconfig = read_db_config()
conn = MySQLConnection(**dbconfig)
cur = conn.cursor()
df_mysql = pd.read_sql('SELECT PO_Date,PO_Total FROM purchase_order',con=conn)
print df_mysql
po_dates = df_mysql.ix[:,0]
po_total = df_mysql.ix[:,1]
X = Series( po_total,index=po_dates)
X.plot()
plt.show()
conn.close()
How to plot these 2 columns together?