Hello,
I have executed the python with Pycharm and Jupyter Notebook tool as well as Python Exe using Run command from Alteryx.
The Script executed successfully.
But when i am trying to run the exact same code using python its gives me error.
I am trying to compare two data frames with below code
comparision=df1.values==df2.values
rows,cols=np.where(comparision=='False')
This code executed in all the IDEs. but using Python Tool it is showing error as below
Error: elementwise comparison failed this will raise an error in the future
ValueError: not enough values to unpack (expected 2, got 1)
Please help to resolve the issue
This worked for me (see screenshot). I think you will need to share your workflow as I can't reproduce your error. Either that or a few screenshots including your inputs.
I am using below code to compare two excels
df1=pd.read_excel('File1.xlsx') df2=pd.read_excel('File2.xlsx') df1.equals(df2) comparison_values = df1.values == df2.values print (comparison_values) import numpy as np rows,cols=np.where(comparison_values==False)
That's not what I asked for. I need to know what the dataframes look like to be able to help.
Emp Name | Test |
ABC | 123 |
XYZ | 345 |
I am using engine=Openpyxl while reading xlsx file
df1=pd.read_excel('File1.xlsx',engine='openpyxl') df2=pd.read_excel('File2.xlsx',engine='openpyxl')
Ah, I see. And what does,
df1.shape
and
df2.shape
Give you if you run this after reading the Excel?