如何按索引的开头过滤数据帧?

2024-03-29 08:37:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个数据帧的形式:

code    note    
OH2014  Oats Futures, March 2014, OH2014, CBOT
HGG2004 Copper Futures, February 2004, HGG2004, COMEX
BRH2014 Brazilian Real (BRL/USD) Futures, March 2014, ...
F5H2014 PJM PPL Zone Off-Peak Calendar-Month Day-Ahead...
PDMU2016    MISO Indiana Hub Day-Ahead Peak Calendar-Month...
GLG2015 Columbia Gulf Louisiana Natural Gas (Platts IF...
SSIZ2014    Coal (API 8) cfr South China (Argus/McCloskey)...
KCU1997 Coffee Futures, September 1997, KCU1997, ICE
FVH2003 5 Year Treasury Note Futures, March 2003, FVH2...
BOK1974 Soybean Oil Futures, May 1974, BOK1974, CBOT

其中代码是索引

我如何过滤它只返回代码以“OH”开头的条目


Tags: 数据代码calendar形式marchfuturesdaymonth