I have a multi index dataframe from Python code (Pandas) and I am trying to output this dataframe to Alteryx. However I am getting an error message when I use the Alteryx.write(df,1) function.
Dataframe output looks something like this:
Where there are columns with two sub-headers each.
The error says:
ReferenceError: [Datafile.writeData]: metadata is missing column contained in pandas_df: ('Column A', 'Return')
I understand Alteryx may not know how to handle dataframe with multiple column headers/multi index. Is there a workaround for this? Can I directly write to Excel with my Python code in the workflow and add that excel file back to the workflow to make changes to the dataframe?
Solved! Go to Solution.
Could you reshape your dataframe to look like this, and export it to alteryx after that? You would have the same information that you have now, but with a format that wouldnt cause this issue. Even if you write to excel and take the data back to the workflow, you would still have problems with this "2 headers multi index".