Format / Suppress Scientific Notation from Pandas Aggregation Results

How can one modify the format for the output from a groupby operation in pandas that produces scientific notation for very large numbers? I know how to do string formatting in python but I’m at a loss when it comes to applying it here. df1.groupby(‘dept’)[‘data1’].sum() dept value1 1.192433e+08 value2 1.293066e+08 value3 1.077142e+08 This suppresses the … Read more

Why are floating point numbers inaccurate?

Why do some numbers lose accuracy when stored as floating point numbers? For example, the decimal number 9.2 can be expressed exactly as a ratio of two decimal integers (92/10), both of which can be expressed exactly in binary (0b1011100/0b1010). However, the same ratio stored as a floating point number is never exactly equal to … Read more