Description
When processing large amount of data with Python, I rely on numpy to do the processing.
I seem to have no way of loading large text files with binary numbers in them, something like
101 11 111
110 01 000
I have found that loadtxt
does handle the 0x prefix but not the 0b prefix (as available in Python), probably since you just use some strtoull function for the conversion from ASCII to numbers. On the other hand, the strtou* functions would allow me to specify a radix (2, 8, 10, 16, or even 13). This feature is currently not exposed. Also, the documentation of loadtxt
does not seem to describe the currently implemented logic (how are prefixes like 0x handled? do leading zeros indicate octal literals? etc.).
I would like to propose that I can specify the default radix. Also, it would be nice if numpy would handle the typical Python prefixes (0x, 0o, 0b). Please note that this is not the out-of-the-box strtou* behavior. If given a radix, it will disable prefix detection, AFAIK.