您需要转换
list为
numpyarray然后
reshape:
df = pd.Dataframe(np.array(my_list).reshape(3,3), columns = list("abc"))print (df) a b c0 1 2 31 4 5 62 7 8 9
您需要转换
list为
numpyarray然后
reshape:
df = pd.Dataframe(np.array(my_list).reshape(3,3), columns = list("abc"))print (df) a b c0 1 2 31 4 5 62 7 8 9