ich habe ein Problem, welches mir relativ einfach erscheint, aber sich doch nicht so einfach lösen lässt:
Innerhalb einer Schleife erhalte ich ein Numpy-Array, welches auf den Namen datasets hört (ndim=2, shape=(xx,51)) (xx kann eine beliebige Zahl sein, bei jedem Schleifendurchlauf ist xx unterschiedlich groß).
Diese datasets möchte ich jedesmal an ein anderes Array anhängen (append). Den np.append-befehl kenne ich. Nur ist mir leider nicht klar, wie ich ein array initialisiere, in welches ich entsprechendes dataset reinpacken kann.
Code: Alles auswählen
def Example_Query():
#1: Get a list containing all current opened HDF5-Files
file_names = get_FileNames()
datasets=np.array([[],[]])
for file_name in file_names:
#2: Create a query_obect corresponding to the HDF5_File
# represented by file_name
query_object = Query(HDF5_File = file_name)
#3: Run the query passing a individual filter.
# Look at documentation of Query.loading_Leafs
# for more informations
query_object.loading_Leafs(time = True,
filter_inclusive = None,
filter_exclusive = [],
filter_variables = ["RT"])
#4: The query object holds now a reference of each leaf
# and its corresponding time-vector passing through the given filters.
# The query object can be passed now for example to a method which
# will perform some calculation
returnFromMyAnalysis=My_Analysis(query_object, file_name)
datasets=returnFromMyAnalysis[1]
datasetsHeader=returnFromMyAnalysis[2]
Gruß