This is a pretty ugly hack, and I apologize to everyone concerned, but I've got around this problem like so:
grouped = data.groupby(['code', 'acc'])
means = grouped.mean()
means['nx'] = [group.nx.mean() for name, group in grouped]
means['ny'] = [group.ny.mean() for name, group in grouped]
group1_correct = means.xs('group1').xs(True)
group1_correct['nx'] # Can only be indexed this way