慕无忌1623718
新增中 .Tdf.values.T.tolist()Out[465]: [[-0.171321, 1.93377, 4.10144, 6.25064], [0.0118587, 0.011752, 0.011296299999999999, 0.0103071], [-0.148752, 1.9707, 4.06861, 5.83927]]或者我们可以创建 dict{x:df[x].tolist() for x in df.columns}Out[489]: {'Param_1': [-0.171321, 1.93377, 4.10144, 6.25064], 'Param_2': [0.0118587, 0.011752, 0.011296299999999999, 0.0103071], 'Param_3': [-0.148752, 1.9707, 4.06861, 5.83927]}或使用locals(不推荐,但看起来像您所需要的)variables = locals()for key in df.columns: variables["{0}".format(key)]= df[key].tolist()Param_1Out[501]: [-0.171321, 1.93377, 4.10144, 6.25064]
holdtom
也能 agg>>> df.agg(tuple)Param_1 (-0.171321, 1.93377, 4.10144, 6.25064)Param_2 (0.0118587, 0.011752, 0.011296299999999999, 0....Param_3 (-0.148752, 1.9707, 4.06861, 5.83927)dtype: object如果真的需要lists,df.agg(tuple).transform(list)