Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 用dict从U剖面描述中提取数据_Python_Pandas Profiling - Fatal编程技术网

Python 用dict从U剖面描述中提取数据

Python 用dict从U剖面描述中提取数据,python,pandas-profiling,Python,Pandas Profiling,我有一个dict,我想在使用pandas profiling进行分析后提取数据。我正在尝试获取gfcid的数据?我试着看什么是键(),它返回4个键 dict_keys(['table', 'variables', 'freq', 'correlations']) 'variables': count distinct_count p_missing n_missing p_infinite n_infinite \ prf_product 200

我有一个dict,我想在使用pandas profiling进行分析后提取数据。我正在尝试获取gfcid的数据?我试着看什么是键(),它返回4个键

dict_keys(['table', 'variables', 'freq', 'correlations'])

'variables':             count distinct_count p_missing n_missing p_infinite n_infinite  \
 prf_product   200              2         0         0          0          0   
 gfcid          61              2     0.695       139          0          0   
 arrg_id       200            182         0         0          0          0   
例如,我想获取gfcid p_missing,其值为139,我未计算的问题是,我得到了许多gfcid列,我应该采取什么最佳方法来获取这些数据

{'table': {'n': 200,
  'nvar': 3,
  'total_missing': 0.23166666666666666,
  'n_duplicates': 18,
  'memsize': '5.0 KiB',
  'recordsize': '25.6 B',
  'NUM': 1,
  'DATE': 0,
  'CONST': 0,
  'CAT': 1,
  'UNIQUE': 0,
  'CORR': 0,
  'RECODED': 0,
  'BOOL': 1,
  'UNSUPPORTED': 0,
  'REJECTED': 0},
 'variables':             count distinct_count p_missing n_missing p_infinite n_infinite  \
 prf_product   200              2         0         0          0          0   
 gfcid          61              2     0.695       139          0          0   
 arrg_id       200            182         0         0          0          0   

             is_unique                mode p_unique memorysize  ...  \
 prf_product     False           Overdraft     0.01       1728  ...   
 gfcid           False          1022506923     0.01       1928  ...   
 arrg_id         False  458040000000328871     0.91       1728  ...   

                      iqr kurtosis     skewness                   sum  \
 prf_product          NaN      NaN          NaN                   NaN   
 gfcid                NaN      NaN          NaN                   NaN   
 arrg_id      1.97939e+18 -2.01933  0.000718585  -5533519320767099939   

                      mad        cv n_zeros p_zeros  \
 prf_product          NaN       NaN     NaN     NaN   
 gfcid                NaN       NaN     NaN     NaN   
 arrg_id      9.90032e+17  0.685487       0       0   

                                                      histogram  \
 prf_product                                                NaN   
 gfcid                                                      NaN   
 arrg_id      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...   

                                                 mini_histogram  
 prf_product                                                NaN  
 gfcid                                                      NaN  
 arrg_id      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...  

 [3 rows x 34 columns],
 'freq': {'prf_product': Overdraft        100
  Retails Cards    100
  Name: prf_product, dtype: int64, 'gfcid': 1022506923    61
  Name: gfcid, dtype: int64, 'arrg_id': 458040000001206947     2
  458040000003802902     2
  458040000003898582     2
  458040000003488662     2
  2409124554515908929    2
                        ..
  458040000000500916     1
  2422373310444855111    1
  458040000002710689     1
  2459484652984972989    1
  458040000000940444     1
  Name: arrg_id, Length: 182, dtype: int64},
 'correlations': {'pearson':          gfcid  arrg_id
  gfcid      NaN      NaN
  arrg_id    NaN      1.0, 'spearman':          gfcid  arrg_id
  gfcid      NaN      NaN
  arrg_id    NaN      1.0}}
我这样做是为了取回,并意识到它在第一行返回

desc = profile.get_description()
result = []
for i in desc.values():
    print(i.values)
这就是它返回的结果,我们有没有办法把这些数据提取出来?我执行了一个i[0],它返回错误

<built-in method values of dict object at 0x7f2db8e31318>
[[200 2 0.0 0 0.0 0 False 'Overdraft' 0.01 1728 'Overdraft' 100 'CAT' nan
  nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
  nan nan]
 [61 2 0.6950000000000001 139 0.0 0 False 1022506923 0.01 1928 1022506923
  61 'BOOL' 1022506923.0 nan nan nan nan nan nan nan nan nan nan nan nan
  nan nan nan nan nan nan nan nan]
 [200 182 0.0 0 0.0 0 False 458040000000328871 0.91 1728 nan nan 'NUM'
  1.4480719292929288e+18 9.926344464280993e+17 9.853231442356191e+35']]
<built-in method values of dict object at 0x7f2db8e31e10>
<built-in method values of dict object at 0x7f2db8e4e1f8>

[[200 2 0.0 0 0.0 0 0假“透支”0.01 1728“透支”100“类别”nan
楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠楠
[南南]
[61 2 0.6950000000000001 139 0.0 0假1022506923 0.01 1928 1022506923
61‘BOOL’1022506923.0楠楠
南南南南]
[200 182 0.0 0.0 0假458040000000328871 0.91 1728楠楠楠'NUM'
1.448071929288E+189.926344464280993e+179.853231442356191e+35']]