Created
March 24, 2020 11:53
-
-
Save allatambov/1b7e03cd2a85e896010e31f7d9cd54c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hp.groupby(['Name', 'Subject']) | |
hp2 = hp.groupby(['Name', 'Subject']).first() | |
hp2.stack() | |
stacked = pd.DataFrame(hp2.stack()) | |
stacked | |
stacked.index[0:6] | |
stacked.columns | |
stacked.iloc[1] | |
stacked.iloc[:, 0] | |
unstacked = stacked.unstack() | |
unstacked | |
unstacked.index | |
unstacked.columns | |
unstacked.iloc[:,1] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment