Skip to content

Instantly share code, notes, and snippets.

@himangSharatun
Created February 26, 2018 02:06
Show Gist options
  • Save himangSharatun/49c07d1babec9e47d1f064d1dab84558 to your computer and use it in GitHub Desktop.
Save himangSharatun/49c07d1babec9e47d1f064d1dab84558 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
diff = series.diff()
# pyplot.plot(X, color='blue')
pyplot.plot(diff, color='red')
pyplot.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment