且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python:如何将枚举元素用作字符串?

更新时间:2022-06-05 22:23:15

因为您是在 for 循环内动态生成 Pandas 数据帧,所以在最后打印 j 时,它会显示最后一个生成的数据框.您应该将数据框存储在列表中尝试使用:

Because you are generating your pandas dataframe dynamically inside a for loop so at the end when you print j it will show you the last generated dataframe. You should store your dataframe in list Try using this:

listOfFrame = [] 
for j in dict.keys(): 
    j = pd.DataFrame(dict[j]['Values'])
    listOfFrame.append(j)