Skip to content

Instantly share code, notes, and snippets.

View joeng03's full-sized avatar
🎯
Focusing

Yin Joe Ng joeng03

🎯
Focusing
View GitHub Profile
from sklearn.preprocessing import MinMaxScaler
data = df.sort_index(ascending=True, axis=0)
new_data = pd.DataFrame(index=range(0,len(df)),columns=['Date', 'Close'])
for i in range(0,len(data)):
new_data['Date'][i] = data['Date'][i]
new_data['Close'][i] = data['Close'][i]
new_data.index = new_data.Date
new_data.drop('Date', axis=1, inplace=True)
dataset = new_data.values
scaler = MinMaxScaler(feature_range=(0, 1))
@joeng03
joeng03 / univariate.py
Last active November 13, 2019 11:41
read csv file
import pandas as pd
df = pd.read_csv('GS.csv')
df['Date'] = pd.to_datetime(df.Date)
df.index = df['Date']
plt.figure(figsize=(16,8))
plt.plot(df['Close'])