title: Querying JSON in Python
body: <p>I saw some questions about Quering JSON in python, but I didn't quite find what I was looking for.
  I have two big files in a JSON format, where every line is a record, e.g </p>
  
  <p>file 1:</p>
  
  <pre><code>{"x": 2, "y": 0}
  {"x": 3, "y": 1}
  {"x": 4, "y": 1}
  </code></pre>
  
  <p>file 2:</p>
  
  <pre><code>{"x": 5, "z": 0}
  {"x": 4, "z": 1}
  {"x": 4, "z": 1}
  </code></pre>
  
  <p>I input the files to python with</p>
  
  <pre><code>for line in infile:
        Review = json.loads(line)
  </code></pre>
  
  <p>After inserting the line to "review", i do extra actions to insert these records into a dict.</p>
  
  <p>This takes quite some time because every file has around 100K rows.
  Now, if I want to query these files (lets say, join by X) i have to loop through them again. I thought about using some kind of Sqlite package in python to do this, but it just seems too clumsy. 
  Anyone have an idea what the most efficient way to do this is? 
  Thanks.</p>