示例#1
0
文件: pandas.py 项目: vitiral/cloudtb
def _dataframe_dict(data, index=None, filler='', header=None):
    if isinstance(data, dict):
        try:
            if depth(data, isiter=True) < 2:
                return data
        except TypeError:
            return data
    if not isinstance(data, dict):
        header = resolve_header(header)
        if header is None:
            header = get_header(data[0])
        data = pack(data, header)
    data = flatten(data)
    data = fill_keys(data, filler)
    return data
示例#2
0
 def test_basic(self):
     self.assertEqual(dictionary.depth(basic_dict), 2)