看板 Python 關於我們 聯絡資訊
各位大神 請問一下 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
IAMPF: https://i.imgur.com/kDOCyDj.png 02/05 19:15
lycantrope: 這跟之前問過的有什麼不同#1ZC0t1K7 02/05 23:05
cspy: math 排序後就知道全部了~ 02/25 01:16