def tt(x): if x.name == "distribution": return [el[0:10] for el in x.values] else: return x test1 = test.apply(tt)