Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form
Dennis Lee Bieber
wlfraed at ix.netcom.com
Tue May 17 21:11:02 EDT 2022
On Tue, 17 May 2022 17:20:54 +0100, MRAB <python at mrabarnett.plus.com>
declaimed the following:
>As it's just a simple replacement, I would've thought that the 'obvious'
>solution would be:
> a = a.replace("'", "")
Mea culpa...
Guess it's time for me to review the library reference for basic data
types again. I'm so used to the .join(.split()) (usually for other purposes
-- like a quick&dirty TSV/CSV formatting without importing the csv module).
The only firm item is that I do not look at any regular expression module
if I can come up with something using native data type methods -- and using
the overhead of re with just simple text [ie; nothing that might be called
an "expression" designed to match /varying/ content) seems really
inefficient.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
More information about the Python-list
mailing list