抽样。
mapPartitionsWithIndex
返回一个新的抽样的抽样函数应用到每个分区,同时跟踪原始分区的索引。
例子
> > >抽样=sc。并行化([1,2,3,4),4)> > >deff(splitIndex,迭代器):收益率splitIndex> > >抽样。mapPartitionsWithIndex(f)。总和()6
以前的
pyspark.RDD.mapPartitions
下一个
pyspark.RDD.mapPartitionsWithSplit