title: Getting ValueError: invalid literal for int() with base 10: ''
body: <p>I'm trying to convert string type of a value in a dictionary to int type. I'm also using strip() function because the field value contains leading spaces. since the field contains few empty values I'm getting ValueError. I want to convert to int only for the values present in the column. If the value is empty I want the output to be "".</p>
  
  <p>Below is the code where I'm trying to convert from string to int:</p>
  
  <pre><code>"user_rating": {
      "rating": int(row['RATING'].strip()) if 'RATING' in row else "           
  }
  </code></pre>
  
  <p>output I'm expecting:</p>
  
  <pre><code>"user_rating": {
      "rating": 5
  }
  </code></pre>
  
  <p>But getting this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/meghashree.r/PycharmProjects/populate_json/CSV_to_Json.py", line 72, in main
      "rating": int(row['RATING'].strip()) if 'RATING' in row else ""
  ValueError: invalid literal for int() with base 10: ''
  </code></pre>