Python——DataFrame转list(包含两种)

import pandas as pd
df = pd.DataFrame({'a':[1,3,5,7,4,5,6,4,7,8,9],
                   'b':[3,5,6,2,4,6,7,8,7,8,9]})
df

df1 = df.values.tolist()
df1

df2 = [tuple(x) for x in df.values]
df2

posted @ 2019-11-28 23:51  Mr-Lin  阅读(...)  评论(...编辑  收藏