pandas操作一列数据

2018-11-01  本文已影响0人  阿发贝塔伽马
def tt(x): 
    if x.name == "distribution":
        return [el[0:10] for el in x.values]
    else:
        return x
test1 = test.apply(tt)
上一篇 下一篇

猜你喜欢

热点阅读