Professional Documents
Culture Documents
Phyton
Phyton
import pandas as pd
AAPL = pd.read-csv(lokasi repository, index-col=0, parse_dates=True)
type(AAPL)
AAPL.shape
AAPL.columns
type(AAPL.columns)
AAPL.index
type(AAPL.index)
AAPL['Close']
type(AAPL['Close'])
AAPL[['Open','Close']]
type(AAPL[['Open','Close']])
Filtering
lima_terakhir=AAPL.iloc[-5:]
lima_terakhir
diatas_seratus=lima_terakhir['Adj Close']>100
lima_terakhir[diatas_seratus]
plotting series
import matplotlib.pyplot as plt
close = AAPL['Close']
plt.plot(close)
plt.style.use('fivethirtyeight')
plt.plot(close)
plt.style.use('seaborn')
plt.plot(close)
AAPL['Close'].plot()
plt.plot(AAPL)
AAPL.plot()
AAPL.plot()
plt.yscale('log')