I tried to use iterrows as a command to deal with the frame.
stocks2['Startpoint']=0
for index,row in stocks2.iterrows():
if row['VOL']>4*row['avg'] and row['RET']< -0.02 :
row['Startpoint']=1
I know that the condition is met several times, but it does not seem to overwrite successfully the value in that case.
stocks2['Startpoint'].value_counts()
Out[141]: 0 1588603 Name: Startpoint, dtype: int64
.iterowsreturns an iterator overpd.Seriesobjects representing the rows of your data-frame, but mutating thosepd.Seriesobjects will not affect the originalpd.DataFrame