title: How can I remove null keys with values from JSON object in python?
body: <p>I have a JSON object in which I want to remove the null key with the value that is my JSON. Please give me a solution how can I remove the null attribute with key and value from the object and can get without null keys data</p>
  <p>UPDATE:</p>
  <pre><code>if request.method == 'POST': 
      all_products = request.data['products']
      
      db = CategoriesActiveORM.get_connection()
      keywords = db.table('categories'). \
          select('products', db.raw('count(*) as total')). \
          where_not_null('products'). \
          group_by('products'). \
          order_by('total', 'desc'). \
          limit(4). \
          get()
  
      total = keywords.sum('total')
      industries = {}
      for key in keywords:
          industries[key['products']] = round(int(key['total']) / total * 100, 2)
      
      print('industries', industries)
      
      industries = industries.pop(&quot;null&quot;, None)   
  
      print('industries', industries)
      
      industries.pop(&quot;null&quot;, None)
      rint('industries', industries)
  
      return JsonResponse(industries)
  </code></pre>
  <p>Print 1:</p>
  <pre><code>{
      &quot;null&quot;: 87.37,
      &quot; Product1&quot;: 4.95,
      &quot; Product2&quot;: 4.44,
      &quot; Product3&quot;: 3.24
  }
  </code></pre>
  <p>Print 2:</p>
  <pre><code>None
  </code></pre>
  <p>Print 3:</p>
  <pre><code>{
      &quot;null&quot;: 87.37,
      &quot; Product1&quot;: 4.95,
      &quot; Product2&quot;: 4.44,
      &quot; Product3&quot;: 3.24
  }
  </code></pre>