.get method for nested json doesn't work
<p>I have a large file, that contains <strong>valid nested json</strong> on each line, each json looks like (real data is much bigger, so this peace of json will be shown for illustration just):</p>

<pre><code>       {"location":{"town":"Rome","groupe":"Advanced",
            "school":{"SchoolGroupe":"TrowMet", "SchoolName":"VeronM"}},
            "id":"145",
            "Mother":{"MotherName":"Helen","MotherAge":"46"},"NGlobalNote":2,
            "Father":{"FatherName":"Peter","FatherAge":"51"},
             "Study":[{
            "Teacher":["MrCrock","MrDaniel"],
           "Field":{"Master1":["Marketing", "Politics", "Philosophy"], 
           "Master2":["Economics", "Management"], "ExamCode": "1256"}
             }],
             "season":["summer","spring"]}
</code></pre>

<p>I need to parse this file, in order to extract only some key-values from every json, to obtain the dataframe that should look like:</p>

<pre><code>Groupe       Id   MotherName   FatherName    Master2
Advanced    56   Laure         James        Economics, Management
Middle      11   Ann           Nicolas      Web-development
Advanced    6    Helen         Franc        Literature, English Language
</code></pre>

<p>I use <a href="https://stackoverflow.com/a/35645790/5960260">method proposed me in the other question</a> <code>.get</code> but it doesn't work with nested json, so for instance if I try:</p>

<pre><code>def extract_data(data):
    """ convert 1 json dict to records for import"""
    dummy = {}
    jfile = json.loads(data.strip())
    return (
    jfile.get('Study', dummy).get('Field', np.nan).get('Master1',np.nan),
    jfile.get('location', dummy).get('groupe', np.nan))
</code></pre>

<p>for this line <code>jfile.get('Study', dummy).get('Field', np.nan).get('Master1', np.nan)</code>  it throws me an error: </p>

<blockquote>
  <p>AttributeError: 'list' object has no attribute 'get'</p>
</blockquote>

<p>obviously it happens because the value of <code>"Study"</code> is not a dictionary, neither list, but a valid json!  how can I deal with this problem? Does exist a method that works like .get, but for json? I guess there is another option : decode this json and then parse it with <code>.get</code>, but the problem that it is in the core of another json, so I have no clue how to decode it!</p>