def as_float_array(X, copy=True, force_all_finite=True):
 if (isinstance(X, np.matrix) or ((not isinstance(X, np.ndarray)) and (not sp.issparse(X)))):
  return check_array(X, ['csr', 'csc', 'coo'], dtype=np.float64, copy=copy, force_all_finite=force_all_finite, ensure_2d=False)
 elif (sp.issparse(X) and (X.dtype in [np.float32, np.float64])):
  return (X.copy() if copy else X)
 elif (X.dtype in [np.float32, np.float64]):
  return (X.copy(('F' if X.flags['F_CONTIGUOUS'] else 'C')) if copy else X)
 else:
  return X.astype((np.float32 if (X.dtype == np.int32) else np.float64))

def as_float_array ( X , copy = True , force_all_finite = True ) : if ( isinstance ( X , np . matrix ) or ( ( not isinstance ( X , np . ndarray ) ) and ( not sp . issparse ( X ) ) ) ) : return check_array ( X , [ 'csr' , 'csc' , 'coo' ] , dtype = np . float64 , copy = copy , force_all_finite = force_all_finite , ensure_2d = False ) elif ( sp . issparse ( X ) and ( X . dtype in [ np . float32 , np . float64 ] ) ) : return ( X . copy ( ) if copy else X ) elif ( X . dtype in [ np . float32 , np . float64 ] ) : return ( X . copy ( ( 'F' if X . flags [ 'F_CONTIGUOUS' ] else 'C' ) ) if copy else X ) else : return X . astype ( ( np . float32 if ( X . dtype == np . int32 ) else np . float64 ) )
converts an array-like to an array of floats the new dtype will be np .