I am seeing behavior that I don't understand when saving collections of JaggedArrays with the awkward.save() function.
I have an initial set of arrays each with an outer dimension of 10,000. I save those arrays with
data_dict = {"field1": array1, "field2": array2, ... , "fieldN": arrayN}
awk.save("filename.awkd", data_dict, mode="w")
The resulting filesize is about 280 MB.
I then want to filter out events from those arrays. As an example, let's say I want the first 10 events.
events = numpy.arange(10)
data_dict = {"field1": array1[events], "field2": array2[events], ... , "fieldN": arrayN[events]}
awk.save("filename.awkd", data_dict, mode="w")
This produces a filesize of about 280 kB, which makes sense - I've selected 1/1000 events, so the filesize is about 1000x smaller.
However, now I instead select a more distributed set of 10 events.
events = numpy.arange(0, 1000, 100)
data_dict = {"field1": array1[events], "field2": array2[events], ... , "fieldN": arrayN[events]}
awk.save("filename.awkd", data_dict, mode="w")
The resulting filesize is now back to the original 280 MB.
Is this behavior expected? Or am I doing something wrong? When I load the data back, I do only seem to have access to the events I filtered, but the increased filesize is giving me memory issues (on larger files) as I try to concatenate only the filtered events.
How can I achieve saving a small subset of events for later concatenation?
I am seeing behavior that I don't understand when saving collections of
JaggedArrayswith theawkward.save()function.I have an initial set of arrays each with an outer dimension of 10,000. I save those arrays with
The resulting filesize is about 280 MB.
I then want to filter out events from those arrays. As an example, let's say I want the first 10 events.
This produces a filesize of about 280 kB, which makes sense - I've selected 1/1000 events, so the filesize is about 1000x smaller.
However, now I instead select a more distributed set of 10 events.
The resulting filesize is now back to the original 280 MB.
Is this behavior expected? Or am I doing something wrong? When I load the data back, I do only seem to have access to the events I filtered, but the increased filesize is giving me memory issues (on larger files) as I try to concatenate only the filtered events.
How can I achieve saving a small subset of events for later concatenation?