Zeigen Sie ein Array im Format der wissenschaftlichen Notation an

Ich möchte meine Ergebnisse in wissenschaftlicher Notation (z. B. 1.2e3) anzeigen. Meine Daten sind im Array-Format. Gibt es eine Funktion wietolist() kann das Array in float konvertieren, damit ich die Ausgabe mit% E formatieren kann?

Hier ist mein Code:

import numpy as np
a=np.zeros(shape=(5,5), dtype=float)
b=a.tolist()
print a, type(a), b, type(b)
print '''%s''' % b 
# what I want is 
print '''%E''' % function_to_float(a or b)

Antworten auf die Frage(2)

Ihre Antwort auf die Frage