pandas筛选0,3,6开头的行

http://stackoverflow.com/questions/15325182/how-to-filter-rows-in-pandas-by-regex

dbstk.loc[dbstk.STKCODE.str.startswith('6'),:]

dbstk.loc[dbstk.STKCODE.str.contains(^[0,3,6]d{5}$)]

stkdf = stkdf[stkdf['STOCKCODE'].map(lambda x:x[0]=='0' or x[0]=='3' or x[0]=='6')]
原文地址:https://www.cnblogs.com/ppqchina/p/6245767.html