sf_concat_var.py 504 字节
Newer Older
A
Alex Duan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# init
def init():
    pass

# destroy
def destroy():
    pass

def process(block):
    (nrows, ncols) = block.shape()
    results = []
    for i in range(nrows):
        row = []
        for j in range(ncols):
            val = block.data(i, j)
            if val is None:
A
Alex Duan 已提交
17 18
                row = None
                break
A
Alex Duan 已提交
19
            row.append(val.decode('utf-8'))
A
Alex Duan 已提交
20 21 22 23
        if row is None:
            results.append(None)
        else:    
            results.append(''.join(row))
A
Alex Duan 已提交
24 25 26
    return results