-1

This is the first observation. I need these all in different columns instead of the same column.

[{'route': 'Oral',
  'brand_name': 'MSK',
  'active_ingredients': [{'dose': {'denominator_unit': 'Unknown',
     'numerator': '1',
     'numerator_unit': 'Unknown',
     'denominator': '1'},
    'name': 'Diethylcarbamazine, Oxibendazole'}],
  'atc_vet_code': 'QP52AC57',
  'dosage_form': 'Tablet',
  'manufacturer': {'registration_number': 'USA-USFDACVM-N136483',
   'name': 'MSK'}}]

I want the result to look something like this.

route brand name active_ingredients brand name atc_vet_code dosage_form'
oral MSK Diethylcarbamazine, Oxibendazole QP52AC57 tablet
Epsi95
  • 8,832
  • 1
  • 16
  • 34
Andrea
  • 57
  • 1
  • 7

1 Answers1

0

You might want to check out the answer here Convert list of dictionaries to a pandas DataFrame

The relevant answer is the one talking about json_normalize. https://stackoverflow.com/a/53831756/381179

A list of nested dicts is pretty much what the json data format would look like, and rather than writing some custom read-in functionality, you can use what's already there

cadolphs
  • 9,014
  • 1
  • 24
  • 41