Guest User

Untitled

a guest
Dec 6th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. user = ""
  2. password = getattr(config, 'password')
  3. url = ''
  4. req = requests.post(url = url, auth=(user, password))
  5. print('Authentication succesful!/n')
  6. ans = req.json()
  7.  
  8. #Transform resultList into Pandas DF
  9. solr_df = pd.DataFrame.from_dict(json_normalize(ans['resultList']), orient='columns')
  10.  
  11. solr_df = pd.DataFrame()
  12. for record in ans['resultList']:
  13. df = pd.DataFrame(record['children'])
  14. df['contactId'] = record['contactId']
  15. solr_df = solr_df.append(df)
Add Comment
Please, Sign In to add comment