import pandas as pd
import quandl
df=quandl.get('WIKI/GOOGL')
#print(df.head())
df=df[['Adj.Open','Adj.High','Adj.Low','Adj.Close','Adj.Volume']]
df['HL_PCT'] =(df['Adj.High']-df['Adj.Close'])/df['Adj.Close'] * 100
df['PCT_change'] =(df['Adj.Close']-df['Adj.Open'])/df['Adj.Open'] * 100
df=df[['Adj.Close','HT_PCT','PCT_change','Adj.Volume']]
KeyError: "['Adj.Open' 'Adj.High' 'Adj.Low' 'Adj.Close' 'Adj.Volume'] not in index"
You need spaces in columns names - after
.
add one space:If solution above not working, you can try: