📅  最后修改于: 2022-03-11 14:45:43.506000             🧑  作者: Mango
import pandas as pd
#creating temp df for example
details = {
'Name' : ['Ankit', 'Aishwarya', 'Shaurya', 'Shivangi', 'Priya', 'Swapnil'],
'Nick_Name' : ['Ankit', 'Aish', 'Shaurya', 'Shiv', 'Priya', 'Lucky'],
}
# creating a Dataframe object
df = pd.DataFrame(details, columns = ['Name', 'Nick_Name',],index = ['a', 'b', 'c', 'd', 'e', 'f'])
index_names = df[ (df['Name'] == df['Nick_Name'])].index
df.drop(index_names, inplace = True)
print(df)