Returns an array (any sequence of floats, really) as a string.
548404
def toStringArray(name, a, width = 0):
    
    string = name + ": "
    cnt = 0
    for i in a:
        string += "%4.2f  " % i 
        if width > 0 and (cnt + 1) % width == 0:
            string += '\n'
        cnt += 1
    return string
1028404
def FloatStringToFloat(float_string, problems=None):
  """"""
  # Will raise TypeError unless a string
  match = re.match(r"^[+-]?\d+(\.\d+)?$", float_string)
  # Will raise TypeError if the string can't be parsed
  parsed_value = float(float_string)

  if "x" in float_string:
    # This is needed because Python 2.4 does not complain about float("0x20").
    # But it does complain about float("0b10"), so this should be enough.
    raise ValueError()

  if not match and problems is not None:
    # Does not match the regex, but it's a float according to Python
    problems.InvalidFloatValue(float_string)
  return parsed_value
483499
public static float[] getFloatData(INDArray buf) {
        if (buf.data().dataType() != DataType.FLOAT)
            throw new IllegalArgumentException("Float data must be obtained from a float buffer");

        if (buf.data().allocationMode() == DataBuffer.AllocationMode.HEAP) {
            return buf.data().asFloat();
        } else {
            float[] ret = new float[(int) buf.length()];
            INDArray linear = buf.reshape(-1);

            for (int i = 0; i < buf.length(); i++)
                ret[i] = linear.getFloat(i);
            return ret;
        }
    }
1314707
def _str2array(d):
    
    if type(d) == list:
        return np.asarray([_str2array(s) for s in d])
    ins = StringIO(d)
    return np.loadtxt(ins)
1063611
def to_python(self, value):
        """"""
        if not value:
            return []
        return map(super(CommaSepFloatField, self).to_python, value.split(','))
514440
def cfloat32_array_to_numpy(cptr, length):
    """"""
    if isinstance(cptr, ctypes.POINTER(ctypes.c_float)):
        return np.fromiter(cptr, dtype=np.float32, count=length)
    else:
        raise RuntimeError('Expected float pointer')
891735
public static float[] toFloat(int[] array) {
        float[] n = new float[array.length];
        for (int i = 0; i < array.length; i++) {
            n[i] = (float) array[i];
        }
        return n;
    }
1266090
def _as_array(self, fmt):
        ''''''
        assert self.dimensions, \
            '{}: cannot get value as {} array!'.format(self.name, fmt)
        elems = array.array(fmt)
        elems.fromstring(self.bytes)
        return np.array(elems).reshape(self.dimensions)
841320
def comma_converter(float_string):
    """'"""
    trans_table = maketrans(b',', b'.')
    return float(float_string.translate(trans_table))
814304
def ver_str_to_tuple(ver_str):
    """"""
    out = []
    for x in ver_str.split("."):
        try:
            x = int(x)
        except ValueError:
            pass
        out.append(x)
    return tuple(out)
9479
def is_float_array(l):
    

    """
    if isinstance(l, np.ndarray):
        if l.dtype.kind == 'f':
            return True
    return False
1151503
function arrayToString(array){
  var str = '';

  for (let i = 0; i < array.length; i++) {
    str += array[i];
  }

  return str;
}
310228
def array(self):
        
        if self._intervals_len:
            if self._array_len != self._intervals_len:
                if not self._array_len:
                    self._array = np.array(self.intervals) \
                        if hasattr(np, 'array') else self.intervals
                else:
                    self._array = np.concatenate((
                        self._array, self.intervals), axis=0) \
                        if hasattr(np, 'concatenate') else \
                        (self._array + self.intervals)
                self._array_len += len(self.intervals)
                self.intervals = []
            return self._array
        return []
997055
function toArray() {
  const arr = [];
  for (let i = 0; i < this.length; i += 1) {
    arr.push(this[i]);
  }
  return arr;
}
142388
def convert_to_strings(self, sequences, sizes=None):
        """"""
        strings = []
        for x in xrange(len(sequences)):
            seq_len = sizes[x] if sizes is not None else len(sequences[x])
            string = self._convert_to_string(sequences[x], seq_len)
            strings.append(string)
        return strings
220730
function(init) {
  var i, r = new Float64Array(16);
  if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
  return r;
}
1223721
def string_array(self):
        ''''''
        assert len(self.dimensions) == 2, \
            '{}: cannot get value as string array!'.format(self.name)
        l, n = self.dimensions
        return [self.bytes[i*l:(i+1)*l].decode('utf-8') for i in range(n)]