Pandas -Kartenfunktion auf NP.Float32 -WertenPython

Python-Programme
Anonymous
 Pandas -Kartenfunktion auf NP.Float32 -Werten

Post 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.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post