ret2.loc[ret2['INNERCODE'].map(lambda x:x[0]=='6' or x[0]=='3' or x[0]=='0' ),:]

和matlab不一样的风格 - -

直接用filter更方便
ret2 = filter(lambda x:x[0]=='6' or x[0]=='3' and x[0]=='0',ret)

用好map , filter, reduce

pandas,numpy,list要分清楚
pandas有.map
.filter没有iter

list直接用map,filter,类似matlab
posted on 2016-12-29 09:18  ppqchina  阅读(1552)  评论(0编辑  收藏  举报