Parses a numpy array (or Python list/int) of 64-bit integer ids
into a bit64::integer64 vector or character, round-tripping through raw
bytes so no precision is lost.
Arguments
- x
A numpy array, Python list or Python int of 64-bit integers.
- as_character
If
TRUE(the default) return a character vector; otherwise abit64::integer64vector.
Value
A character or bit64::integer64 vector.
Details
Only int64 and uint64 numpy dtypes are accepted; a uint64 array
is checked for values that would overflow signed int64 and errors if any is
found. The bytes are written to a temporary file and read back as doubles
whose class is then set to integer64, which is exact for all 64-bit ids.
See also
rids2pyint() for the reverse direction.