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')]
posted on 2017-01-03 17:49  ppqchina  阅读(1049)  评论(0编辑  收藏  举报