79742070

Date: 2025-08-21 09:11:34
Score: 2
Natty:
Report link

May be this variant with grouping will do the thing?

df = df.assign(grp=df[0].str.contains(r"\++").cumsum())
res = df.groupby("grp").apply(lambda x: x.iloc[-3,2] 
                              if "truck"  in x[1].values
                              else None,
                              include_groups=False).dropna()
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: strawdog