title: How to open a json.gz file and return to dictionary in Python
body: <p>I have downloaded a compressed json file and want to open it as a dictionary.</p>
  
  <p>I used <code>json.load</code> but the data type still gives me a <code>string</code>.
  I want to extract a keyword list from the json file. Is there a way I can do it even though my data is a string?
  Here is my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>import gzip
  import json
  with gzip.open("19.04_association_data.json.gz", "r") as f:
  
   data = f.read()
  with open('association.json', 'w') as json_file:  
       json.dump(data.decode('utf-8'), json_file)
  
  with open("association.json", "r") as read_it: 
       association_data = json.load(read_it) 
  
  
  
  print(type(association_data))
  
  #The actual output is 'str' but I expect it is 'dic'
  </code></pre>