Here are some of the programming errors in Python that I have faced in my career till now.
Always try to understand the problem that you are attempting to solve i.e If suppose you need to compare data from two pandas data frames that may be very simple task but before this task appeared you might have to face other tedious task to handle date format and you forgot that how you compare 2 Pandas DataFrame in one single line of code.
#this will give intersection of the data frame that you want as result. here “dataframe1”.dataframe1['column_name'].isin(dataframe2['column_name'])
#this will give values that are not common in dataframe1.dataframe1['column_name'].isin(~dataframe2['column_name'])
Here is one simple script to explain the same
import pandas as pd
# Defining Dataframesdf_1 = pd.DataFrame(['A','B','C','D','1','2','3'],columns=['ABC'])
df_2 = pd.DataFrame(['D','E','F','G','3','4','5'],columns=['DEF'])
# Prints Intersection elementsdf_1[df_1['ABC'].isin(df_2['DEF'])]
# Prints Disjoint elementsdf_1[df_1['ABC'].isin(df_2['DEF'])]

For results you need to store these values into respective data frame(i.e. DataFrame variable) and get the generated output from that only.
Above given is the simplest way to compare 2 pandas data frames if your problem is complex the logic to compare will start taking twist and turns too.
For one scenario in a problem statement I needed to compare Address with different Address from 2 different data frame. So for this Problem I will post whole Problem and solution for the same in next post. Stay tuned!