I handle a big number of XML files, each of which stores a float64 array in the form of a base64 string. For each of these files, I would like to access the value of its array at a specific index without loading the whole array. I wish to do this in Python.
Currently, I decode the entire string and then access the value at given index, but I am looking for a much faster method.
As I understand, each float uses 8 bytes to store. Each 3-bytes of binary data are mapped to 4 base64 chars. So, in order to access i-th float, you'll need to:
(i * 8 / 3) * 4
to (i * 8) / 3) * 4 + 4
(i * 8) % 3
bytes
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.