List列表转化成DataFrame,多个列表合成一个DataFrame

List转DataFrame

import pandas as pd

name = ['Cindy','John','Matt']
point = [78,87,88]

df_grade = pd.DataFrame(name, columns=['name'])

多个List合并成一个DataFrame

df_grade = pd.concat([df_grade, pd.DataFrame(point,columns=['point'])],axis=1)

输出

print(df_grade)

结果

	name	point   
0  Cindy     78
1   John     87
2   Matt     88

你可能感兴趣的:(Python,Pandas)