如何从字典列表创建 pandas pd.DataFrame
你可以使用 pd.DataFrame(lst) 构造函数从字典列表(lst)创建 pandas pd.DataFrame。
create_dataframe_from_list.py
a = {"x": 1, "y": 2}
b = {"x": 3, "y": 2}
c = {"x": 6, "y": 9}
df = pd.DataFrame([a,b,c])df 将如下所示:

If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow