python - How to output a long dictionary in a pandas dataframe column in its entirety? -
i have pandas dataframe rather long dictionaries in 1 column.
example:
import pandas pd d = [[{'a':'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','b':'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'}]] df = pd.dataframe.from_dict(d) print df[0]
which leads output:
0 {u'a': u'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', u'... name: 0, dtype: object
everything start of dictionary omitted ellipses.
how output full dictionary without iterating on individual keys?
this should work:
in[6]:df[0].values out[6]: array([ {'a': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'b': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'}], dtype=object)
Comments
Post a Comment