Replace entire columns in pandas dataframe
You are getting a KeyError because 'opcodes' doesn't exist in dataFrame. Can you show us the contents of dataFrame not just df?

EDIT:

You don't need to create an empty DataFrame and then apply the data across. Simply do:

df = dataFrame[["opt", "opcodes"]].copy()