Ich gebe mir echt Mühe, verstehe aber trotzdem nur "Bahnhof", oder genauer gesagt, "These options determine the way floating point numbers, arrays and other NumPy objects are displayed", und das ist genau was ich möchte, da ich mit meiner Ausgabe unzufrieden bin.numpy.set_printoptions(precision=None,...,formatter=None)
These options determine the way floating point numbers, arrays and other NumPy objects are displayed.
...
formatter : dict of callables, optional.
If not None, the keys should indicate the type(s) that the respective formatting function applies to. Callables should return a string. Types that are not specified (by their corresponding keys) are handled by the default formatters. Individual types for which a formatter can be set are:
- 'bool'
- 'int'
- 'timedelta' : a `numpy.timedelta64`
- 'datetime' : a `numpy.datetime64`
- 'float'
- 'longfloat' : 128-bit floats
- 'complexfloat'
- 'longcomplexfloat' : composed of two 128-bit floats
- 'numpy_str' : types `numpy.string_` and `numpy.unicode_`
- 'str' : all other strings
Da leider das Handbuch nicht einmal ein halbes Beispiel hinzufügt, wäre ich über die Maßen dankbar, wenn mir jemand erklären kann, wie diese hieroglyphische formatter-Option gehandhabt wird. Welches sind die mir völlig unbekannten "respective formatting functions", welches sind die "default formatters", und wie setzt man ein Format für ein "individual type"?
Meine derzeitige abstruse Fehlermeldung ist:
TypeError: set_printoptions() got an unexpected keyword argument 'formatter'