Fill column with value in a pandas Series -


i have product of pandas groupby().sum() follows:

dto  zona  1    1         4839      2         7347      3         1945      4         2248      5         9395      99999      575 2    1         8739      2         7436      3         5528      4         7490 

now to:

dto  zona  1    1         4839 1    2         7347 1    3         1945 1    4         2248 1    5         9395 1    99999      575 2    1         8739 2    2         7436 2    3         5528 2    4         7490 

this must have been asked before, lack concepts search it.

this pandas option sparsifies pd.multiindex. can turn off option named display.multi_sparse. can see other options here


print(s)  dto  zona  1    1        4839      2        7347      3        1945      4        2248      5        9395      99999     575 2    1        8739      2        7436      3        5528      4        7490 dtype: int64 

you can set pandas options temporarily pd.options_context

with pd.option_context('display.multi_sparse', false):     print(s)  dto  zona  1    1        4839 1    2        7347 1    3        1945 1    4        2248 1    5        9395 1    99999     575 2    1        8739 2    2        7436 2    3        5528 2    4        7490 dtype: int64 

if want set option permanently:

pd.set_option('display.multi_sparse', false) 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -