Home > Net >  (Pandas) df.mean() return weird values
(Pandas) df.mean() return weird values

Time:01-12

input
df.mean()
output:

a       4.112657e 07
b       1.197258e 00
c       4.172984e 05
d       2.461237e 02

input

df["a"].mean()

(correct) output:

41126569.99462365

type values in "a" col = int
others col have str values
why is this happening

CodePudding user response:

They are the same numbers, the thing is that the output its written in scientific notation. If you want the typical notation, you can use something like this: Format / Suppress Scientific Notation from Python Pandas Aggregation Results

CodePudding user response:

4.112657e 07 and 41126569.99462365 are the same number. The first is just using scientific notation.

  •  Tags:  
  • Related