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
def test_basic(self): self.assertEqual(dictionary.depth(basic_dict), 2)