def df_from_json(data, rename=True, **kwargs):
 parsed = None
 if isinstance(data, str):
  with open(data) as data_file:
   data = json.load(data_file)
 if isinstance(data, list):
  parsed = json_normalize(data)
 elif isinstance(data, dict):
  for (k, v) in iteritems(data):
   if isinstance(v, list):
    parsed = json_normalize(v)
 if (rename and (parsed is not None)):
  parsed = denormalize_column_names(parsed)
 return parsed

def df_from_json ( data , rename = True , ** kwargs ) : parsed = None if isinstance ( data , str ) : with open ( data ) as data_file : data = json . load ( data_file ) if isinstance ( data , list ) : parsed = json_normalize ( data ) elif isinstance ( data , dict ) : for ( k , v ) in iteritems ( data ) : if isinstance ( v , list ) : parsed = json_normalize ( v ) if ( rename and ( parsed is not None ) ) : parsed = denormalize_column_names ( parsed ) return parsed
attempt to produce :class:pandas .