import pandas as pd
# 创建一个包含学生信息的列表
students = [
['Alice', 20, 80],
['Bob', 21, 75],
['Charlie', 19, 90],
['Dave', 18, 65]
]
# 将列表转换为DataFrame
df = pd.DataFrame(students, columns=['Name', 'Age', 'Score'])
# 显示DataFrame
print(df)
标签:python,DataFrame,列表,df,students,pd,pandas
From: https://www.cnblogs.com/marit/p/17253587.html