0
  CustomerID SaleQuarter NumOfBills PurchaseValue
       0       1          101920      31197887.0
       0       2          10          6268.5
       13      1          1           1527.5
       13      2          2           173.5
       13      3          3           958.0
       13      4          4           1827.0
       15      1          35          14500.5
       15      2          38          18081.0
       15      4          1           85.5
       16      1          2           408.0

"i want data like this"

noofcustomers salequarter Noofbills purchasevalue 4 1 101958 31214323

noofcustomers salequarter Noofbills purchasevalue 3 2 50 24523

noofcustomers salequarter Noofbills purchasevalue 1 3 3 958

noofcustomers salequarter Noofbills purchasevalue 2 4 5 1912.50

"How can i get this in pandas"

1 Answers1

2

You can try setting the display options:

import pandas as pd
import numpy as np

np.random.seed(42)

pd.options.display.float_format = '{:,.20f}'.format

df = pd.DataFrame(np.random.rand(10, 3) / 1e6)
print(df)

Result before:

              0             1             2
0  3.745401e-07  9.507143e-07  7.319939e-07
1  5.986585e-07  1.560186e-07  1.559945e-07
2  5.808361e-08  8.661761e-07  6.011150e-07
3  7.080726e-07  2.058449e-08  9.699099e-07
4  8.324426e-07  2.123391e-07  1.818250e-07
5  1.834045e-07  3.042422e-07  5.247564e-07
6  4.319450e-07  2.912291e-07  6.118529e-07
7  1.394939e-07  2.921446e-07  3.663618e-07
8  4.560700e-07  7.851760e-07  1.996738e-07
9  5.142344e-07  5.924146e-07  4.645041e-08

Result after:

                       0                      1                      2
0 0.00000037454011884736 0.00000095071430640992 0.00000073199394181141
1 0.00000059865848419704 0.00000015601864044244 0.00000015599452033620
2 0.00000005808361216820 0.00000086617614577494 0.00000060111501174321
3 0.00000070807257779605 0.00000002058449429580 0.00000096990985216199
4 0.00000083244264080042 0.00000021233911067828 0.00000018182496720710
5 0.00000018340450985343 0.00000030424224295954 0.00000052475643163224
6 0.00000043194501864212 0.00000029122914019804 0.00000061185289472238
7 0.00000013949386065204 0.00000029214464853522 0.00000036636184329369
8 0.00000045606998421704 0.00000078517596139301 0.00000019967378215836
9 0.00000051423443841361 0.00000059241456886204 0.00000004645041272000
René
  • 4,594
  • 5
  • 23
  • 52