For the code below, I'm getting a Build Error:
14 Error Runtime exception: TypeError: pivot_table() got an unexpected keyword argument 'index'
What am I doing wrong?
import pandas as pd
def initialize(context):
context.spy = sid(8554)
def handle_data(context, data):
prices = history(3900,'1m','price',ffill=False)
prices['date'] = prices.index.map(lambda x: x.date())
prices['time'] = prices.index.map(lambda x: x.hour+x.minute/60.0)
prices_pivot = pd.pivot_table(prices, context.spy, index=prices['date'], columns=prices['time'])
print prices_pivot