[問題] 請問dataframe怎麼往前篩選
各位大神
請問一下
df=
date math
1. 10/20 80
2. 10/22 70
3. 10/24 87
4. 10/26 65
5. 10/30 90
假設是這樣 最新的一次數學分數是90
我要怎麼往前查找 最近一次分數>85 的index
我只想到篩選出大於df[df[math]>85] 然後用iloc[-2]
感覺好像有點笨笨的
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.230.41.199 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1675591282.A.6EA.html
→
02/05 19:15,
1年前
, 1F
02/05 19:15, 1F
→
02/05 23:05,
1年前
, 2F
02/05 23:05, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):