def fListToString(a_list, a_precision=3):
    """ Returns a string representing a list of floats with a given precision """
    from numpy import around
    s_list = ", ".join(("%g" % around(x, a_precision)).ljust(a_precision+3)
                      for x in a_list)
    return "[%s]" % s_list
dataset/ETHPy150Open pybrain/pybrain/pybrain/utilities.py/fListToString/original