title: (Python) Make variable equal to zero if the data type is not numeric
body: <p>I have this variable assignation in my code which take data from web and converts it to float (after extracting numbers only)</p>
  
  <pre><code>variable_1 = float(re.sub('[^0-9]','', basic_data_list[17]))
  </code></pre>
  
  <p>Now if there is no data on the web (which is specified by "-") I get the error</p>
  
  <p>ValueError: could not convert string to float: which is expected.</p>
  
  <p>Is there any way I can get the value zero assigned to this variable if no data is available? Is there any equivalent of Excels's IsError in python?</p>