hope you're doing well . i tried counting green color row after another green colored row in the table below In [1]: df = pd.DataFrame([[green], [red], [red]], columns=['A'])
the code i tried to count greengreen:
for index,row in data.iterrows():
if finalData['Color'].loc[i]=='green' & finalData['Color'].loc[i+1]=='green':
greengreen+=1
i+=1
but it didn't work,hope you can help. note: i'm new to data science