How to add new feature like length of data frame & Drop rows value using indexing. I want to a add a new column where I can count the no-of rows available in a data frame, & using indexing drop rows value.
for i in range(len(df)):
if (df['col1'][i] == df['col2'][i]) and (df['col4'][i] == df['col3'][i]):
pass
elif (df['col1'][i] == df['col3'][i]) and (df['col4'][i] == df['col2'][i]):
df['col1'][i] = df['col2'][i]
df['col4'][i] = df['col3'][i]
else:
df = df.drop(i)