python - Difference between stack/unstack, shape and pivot in Pandas -


i pretty new python , starting read on big data analysis using pandas.

i given task of getting following table long form tall form

    pick 'n pay woolworths  spar        checkers    friendly 7 0   22.222222   11.111111   44.444444   nan         nan 1   8.333333    5.555556    8.333333    11.111111   33.333333 2   8.982036    7.185629    11.976048   35.928144   nan 3   12.500000   37.500000   37.500000   12.500000   nan 

my initial thoughts should use reshaping, settled on using df.stack().

this brought question forefront of mind: difference between stacking/unstacking, reshaping , pivoting? situation should each used in?


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -