我正在尝试将dataframe转换为字典(因为它们在过滤key时速度更快),我目前正在使用 t3 = time()for i in df.index.unique(): r[i].append(df.loc[i].values)
print(round((time()-t3), 1), "s") 这种类型的转换速度很慢。我希望数据帧的索引作为键,行作为在单个键上具有多个值的值</e
我需要他的外貌和照片上的一样。怎么做?Photo with a table that should be obtained at the output 我的代码 array = {1: {2016: 22818888925.021294,0.6750988605150847, 2013: 0.6434239077958611, 2014: 0.6977729348945159, 2015: 0.6643959547744175}})
print pd.DataFrame.from_dict(mass_factor) 我