I am new to Python playing around with a csv file. I would like to find a way to print out my graph by selecting a specific date range, for example 2013-03-20:2014-03-04.
Code below:
import pandas as pd
import matplotlib.pyplot as plt
prc=pd.read_csv("csv",parse_dates=True, nrows=150, usecols=["Close"])
prc_ma=prc.rolling(5).mean()
plt.plot(prc, color="blue", label="Price")
plt.plot(prc_ma, color="red", label="Moving Average")
plt.xlabel("Date")
plt.ylabel("Price")
plt.title("Moving Average")
plt.grid()
I currently work with the parameter nrows.
Thank you