Skip to content

Instantly share code, notes, and snippets.

@himangSharatun
Created February 26, 2018 01:49
Show Gist options
  • Save himangSharatun/9197979cb24d7523768dd90487114b0a to your computer and use it in GitHub Desktop.
Save himangSharatun/9197979cb24d7523768dd90487114b0a to your computer and use it in GitHub Desktop.
from pandas import read_csv
from pandas import datetime
from matplotlib import pyplot
import numpy
file_path = "minyak-goreng-prices.csv"
def parser(x):
splited = x.split('-')
return datetime.strptime(splited[0] + "-" + splited[1] + "-20" +splited[2], '%d-%b-%Y')
series = read_csv(file_path, header=0, parse_dates=[0], index_col=0, squeeze=True, date_parser=parser)
print(series.head())
X = series
pyplot.plot(X, color='blue')
pyplot.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment