小编Waj*_*jih的帖子

序列化包含pandas数据帧的字典(Python)

我有一个字典,其中包含几个熊猫数据框(由键标识),任何有效地序列化(并干净加载)的建议。这是结构(pprint显示输出)。dict ['method_x _'] ['meas_x_']中的每一个都是熊猫数据框。目的是保存数据框,以便使用某些特定的绘图选项进行进一步的绘图。

{'method1':

{'meas1':

                          config1   config2
                   0      0.193647  0.204673
                   1      0.251833  0.284560
                   2      0.227573  0.220327,
Run Code Online (Sandbox Code Playgroud)
'meas2':   
Run Code Online (Sandbox Code Playgroud)
                          config1   config2
                   0      0.172787  0.147287
                   1      0.061560  0.094000
                   2      0.045133  0.034760,
Run Code Online (Sandbox Code Playgroud)

'method2':

{'meas1':

                          congif1   config2
                   0      0.193647  0.204673
                   1      0.251833  0.284560
                   2      0.227573  0.220327,
Run Code Online (Sandbox Code Playgroud)

'meas2':

                          config1   config2
                   0      0.172787  0.147287
                   1      0.061560  0.094000
                   2      0.045133  0.034760}}
Run Code Online (Sandbox Code Playgroud)

python serialization dictionary dataframe pandas

5
推荐指数
1
解决办法
2126
查看次数

标签 统计

dataframe ×1

dictionary ×1

pandas ×1

python ×1

serialization ×1