import random x = [1,2,3] bootstrapSample = [random.choice(x) for _ in x]einfach nicht schnell genug ist.
Aber glücklicherweise gibt es numpy!
import numpy x = [1,2,3] bootstrapSample = list(numpy.random.choice(x, len(x)))läuft -- zumindest in meinem Anwendungsfall -- spürbar schneller. Ich werde in Zukunft also immer optimale Fehlerbalken erzeugen.
Keine Kommentare:
Kommentar veröffentlichen