vendredi 1 avril 2016

random number 2-D-array exported to CSV/ HDF5 / SQLite - but how?

I need to wirte a script and hope you can help me out. there were no search results for something like that. You enter your matrix dimesions AxB and it generates a 2-dim array with random numbers. So far , so good. Problem incoming: Now it should save it to a csv, a hdf5 and a sqlite-file, reload them and check the time difference. What I Have is everthing but the export to the files and the reloading. Anybody got something there? Everything I found for hdf5and sqlite didnt work well and csv export was not satisfied with the array somehow... Here is what i have so far:

inA = input("A = ")
print("\n")
inB = input("B = ")
A = int(inA)
B = int(inB)
array = [[random.random() for i in range(A)] for j in range(B)]

Thanks in advance and sorry if i missed something, times are stressful right now for me.

Aucun commentaire:

Enregistrer un commentaire