code: def safe_float(x):
      """given a string x, convert it to a float. If the stripped string is a ?,
      return a Nan (missing value).
  
      Parameters
      ----------
      x : str
         string to convert
  
      Returns
      -------
      f : float
         where float can be nan
  
      Examples
      --------
      >>> safe_float('1')
      1.0
      >>> safe_float('1\\n')
      1.0
      >>> safe_float('?\\n')
      nan
      """
      if "?" in x:
          return np.nan
      else:
          return float(x)
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import itertools
  import datetime
  from functools import partial
  import numpy
  from scipy._lib.six import next
label_desc: Use image node_id 13 for calling a global function with example usage: safe_float(x) and returns: np, float