Page 1 of 1

Pandas -Kartenfunktion auf NP.Float32 -Werten

Posted: 13 Feb 2025, 07:00
by Anonymous
Ich habe einen Pandas df df mit einer Spalte foo
Sagen wir df ["foo"]. Iloc [0] ist {'A': 123.02, 'b': 12.3}
Wenn ich
mache

Code: Select all

df["foo"] =  df["foo"].map(str)
< /code>
df["foo"].iloc[0]
wird in
konvertiert"{'A' : np.float32(123.02),
'B': np.float32(12.3)}"
< /code>
instead of
"{'A': 123.02, 'B': 12.3}"
< /code>
Is there anyway to prevent the np.float32 from showing in the str?
Except replacing it in post processing.