Row versus Set Processing, Surprise! Craig Shallahamer: 1. Set based processing will likely be much faster than row based processing. Our experiment of processing 100K rows showed row based processing was 3700 times slower than set based processing.…
1.过滤掉列表中的某些项---列表解析 data=[1,4,2,8,5,-1] res=[] a.依次迭代列表中每一个项 for x in data: if >=0: res.append(x) print res b.使用lambda表达式来进行过滤 form random import randint data = [randint(-10,10)for _ in xrange(10)] filter(lambda x: x>=0,data) c.使用列表解析俩进行过滤 [x for x…