Created
February 26, 2018 02:06
-
-
Save himangSharatun/49c07d1babec9e47d1f064d1dab84558 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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