Skip to contents

Converts R ids (character, bit64::integer64, integer or numeric) into a Python list of ints or a numpy int64 array, via a 64-bit-exact path.

Usage

rids2pyint(x, numpyarray = FALSE, usefile = NA)

Arguments

x

R ids in any form coercible to bit64::integer64, or a numpy array (passed through).

numpyarray

If TRUE, return a numpy array; otherwise (the default) a Python list of ints.

usefile

Whether to marshal via a temporary binary file (robust for large vectors) or an in-memory string. NA (the default) chooses automatically based on length.

Value

A Python list of ints, or a numpy int64 array when numpyarray = TRUE.

See also

pyids2bit64() for the reverse direction.

Examples

if (FALSE) { # \dontrun{
rids2pyint(c("720575940621039145", "720575940626877799"))
} # }