4

I'm a data newbie. I've been having trouble seeing the full results of a small JSON file downloaded off of github. I inputted

import pandas as pd
import json
from pandas.io.json import json_normalize

data = pd.read_json('~/bloc/d3_contributor_stats.json')
print pd.DataFrame.from_dict(data, orient='columns')

which is returning

                       author  total  \
0   {u'following_url': u'https://api.github.com/us...      1   
1   {u'following_url': u'https://api.github.com/us...      1   
2   {u'following_url': u'https://api.github.com/us...      1   
3   {u'following_url': u'https://api.github.com/us...      1  

and also cutting off middle values like so:

27  {u'following_url': u'https://api.github.com/us...      1   
28  {u'following_url': u'https://api.github.com/us...      1   
29  {u'following_url': u'https://api.github.com/us...      1   
..                                                ...    ...   
70  {u'following_url': u'https://api.github.com/us...      3   
71  {u'following_url': u'https://api.github.com/us...      3   
72  {u'following_url': u'https://api.github.com/us...      3   
73  {u'following_url': u'https://api.github.com/us...      3   

How can I expand the table to show all of the data, or delete a column like 'following_url' so that some of the other data displays?

Albert S
  • 63
  • 1
  • 6
  • Why are you passing the results of `pd.read_json` to `pd.DataFrame.from_dict`...? That doesn't make any sense. `pd.read_json` returns a `pandas` object, not a `dict`. – juanpa.arrivillaga Dec 24 '16 at 00:13
  • Possible duplicate of [Python pandas, how to widen output display to see more columns?](http://stackoverflow.com/questions/11707586/python-pandas-how-to-widen-output-display-to-see-more-columns) – juanpa.arrivillaga Dec 24 '16 at 00:16
  • Possible duplicate of [Is there a way to (pretty) print the entire Pandas Series / DataFrame?](http://stackoverflow.com/questions/19124601/is-there-a-way-to-pretty-print-the-entire-pandas-series-dataframe) – Lucas Dec 24 '16 at 00:18
  • I have little idea of what I'm doing right now. Thanks for pointing that out, I'll dig a little deeper into the docs and the link to the possible duplicate you posted. – Albert S Dec 24 '16 at 00:18
  • I have little idea of what to do as I need sample data to test things out on. [Read this](http://stackoverflow.com/help/mcve) while you're at it to learn how to ask questions better. Trust me, we like questions. But the way you ask makes a world of difference. – piRSquared Dec 24 '16 at 01:41

0 Answers0