So I have a dataframe of 168 rows and 121 columns. There are some columns that I want to compare and display the different values.
The code is:
comparison_column = np.where((df_full["Name"] == df_full["Displ_name"]), True, False)
print(comparison_column)
output is a list with True and False.
I used apply method with lambda, but it shows not only rows with different values but also all columns from the dataframe. Is there a method which can display rows with different value but only from compared columns?
df_full[df_full.apply(lambda x: x["Name"] != x["Displ_name"], axis=1)]