Pandas groupby transposeConverting a Pandas GroupBy output from Series to DataFrameSelecting multiple columns in a pandas dataframeRenaming columns in pandasAdding new column to existing DataFrame in Python pandasDelete column from pandas DataFrame“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandasGet list from pandas DataFrame column headersGreater/less than comparisons between Pandas DataFrames/Series
PL/SQL function to receive a number and return its binary format
What's the correct term for a waitress in the Middle Ages?
Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP)/sleep apnea device?
Why does VirtualBox crash macOS?
What risks are there when you clear your cookies instead of logging off?
Average spam confidence
Should I "tell" my exposition or give it through dialogue?
Do any instruments not produce overtones?
Disclosing Spiritual Experiences
When writing an error prompt, should we end the sentence with a exclamation mark or a dot?
QGIS Draw by rule
What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?
Does the "6 seconds per round" rule apply to speaking/roleplaying during combat situations?
How to make thick Asian sauces?
Traffic law UK, pedestrians
Avoiding cliches when writing gods
You've spoiled/damaged the card
Where does this pattern of naming products come from?
4 Layer PCB stack up
"Living" organ bank is it practical?
SF novella separating the dumb majority from the intelligent part of mankind
My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?
siunitx error: Invalid numerical input
Why only the fundamental frequency component is said to give useful power?
Pandas groupby transpose
Converting a Pandas GroupBy output from Series to DataFrameSelecting multiple columns in a pandas dataframeRenaming columns in pandasAdding new column to existing DataFrame in Python pandasDelete column from pandas DataFrame“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandasGet list from pandas DataFrame column headersGreater/less than comparisons between Pandas DataFrames/Series
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a file from SAP which wasn't the prettiest one when dealing with data. So using series.str.contains() and boolean masks I have managed to narrow down to a dataframe looking like below:
0 1
0 SUB 123
1 CAT SKU
2 CODE 1000123
3 CODE 1000234
4 SUB 456
5 CAT LIQ
6 CODE1 1000345
7 CODE1 1000534
8 CODE1 1000433
I am looking for a way where I can separate each SUB into a new entry like below:
print(expected_df)
SUB CAT CODE CODE1
0 123 SKU 1000123.0 NaN
1 123 SKU 1000234.0 NaN
2 456 LIQ NaN 1000345.0
3 456 LIQ NaN 1000534.0
4 456 LIQ NaN 1000433.0
I just cant seem to get pass this step. However, this line:
df[0].eq('SUB').cumsum()
helps to segregate the groups and can be used as a helper series if needed.
Any help in transposing the data as shown would be really appreciated.
Thanks.
python pandas pandas-groupby
add a comment |
I have a file from SAP which wasn't the prettiest one when dealing with data. So using series.str.contains() and boolean masks I have managed to narrow down to a dataframe looking like below:
0 1
0 SUB 123
1 CAT SKU
2 CODE 1000123
3 CODE 1000234
4 SUB 456
5 CAT LIQ
6 CODE1 1000345
7 CODE1 1000534
8 CODE1 1000433
I am looking for a way where I can separate each SUB into a new entry like below:
print(expected_df)
SUB CAT CODE CODE1
0 123 SKU 1000123.0 NaN
1 123 SKU 1000234.0 NaN
2 456 LIQ NaN 1000345.0
3 456 LIQ NaN 1000534.0
4 456 LIQ NaN 1000433.0
I just cant seem to get pass this step. However, this line:
df[0].eq('SUB').cumsum()
helps to segregate the groups and can be used as a helper series if needed.
Any help in transposing the data as shown would be really appreciated.
Thanks.
python pandas pandas-groupby
Is there always oneCATperSUB?
– Jondiedoop
Mar 24 at 15:12
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13
add a comment |
I have a file from SAP which wasn't the prettiest one when dealing with data. So using series.str.contains() and boolean masks I have managed to narrow down to a dataframe looking like below:
0 1
0 SUB 123
1 CAT SKU
2 CODE 1000123
3 CODE 1000234
4 SUB 456
5 CAT LIQ
6 CODE1 1000345
7 CODE1 1000534
8 CODE1 1000433
I am looking for a way where I can separate each SUB into a new entry like below:
print(expected_df)
SUB CAT CODE CODE1
0 123 SKU 1000123.0 NaN
1 123 SKU 1000234.0 NaN
2 456 LIQ NaN 1000345.0
3 456 LIQ NaN 1000534.0
4 456 LIQ NaN 1000433.0
I just cant seem to get pass this step. However, this line:
df[0].eq('SUB').cumsum()
helps to segregate the groups and can be used as a helper series if needed.
Any help in transposing the data as shown would be really appreciated.
Thanks.
python pandas pandas-groupby
I have a file from SAP which wasn't the prettiest one when dealing with data. So using series.str.contains() and boolean masks I have managed to narrow down to a dataframe looking like below:
0 1
0 SUB 123
1 CAT SKU
2 CODE 1000123
3 CODE 1000234
4 SUB 456
5 CAT LIQ
6 CODE1 1000345
7 CODE1 1000534
8 CODE1 1000433
I am looking for a way where I can separate each SUB into a new entry like below:
print(expected_df)
SUB CAT CODE CODE1
0 123 SKU 1000123.0 NaN
1 123 SKU 1000234.0 NaN
2 456 LIQ NaN 1000345.0
3 456 LIQ NaN 1000534.0
4 456 LIQ NaN 1000433.0
I just cant seem to get pass this step. However, this line:
df[0].eq('SUB').cumsum()
helps to segregate the groups and can be used as a helper series if needed.
Any help in transposing the data as shown would be really appreciated.
Thanks.
python pandas pandas-groupby
python pandas pandas-groupby
edited Mar 24 at 15:17
anky_91
asked Mar 24 at 15:07
anky_91anky_91
15.6k41023
15.6k41023
Is there always oneCATperSUB?
– Jondiedoop
Mar 24 at 15:12
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13
add a comment |
Is there always oneCATperSUB?
– Jondiedoop
Mar 24 at 15:12
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13
Is there always one
CAT per SUB?– Jondiedoop
Mar 24 at 15:12
Is there always one
CAT per SUB?– Jondiedoop
Mar 24 at 15:12
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13
add a comment |
3 Answers
3
active
oldest
votes
You can try of using df.pivot followed by .ffill(),bfill() for the specific 'SUB' column group rows.
df1 = df.pivot(columns='0')
df1.columns = df1.columns.map(lambda x: x[1])
df1.SUB = df1.SUB.ffill()
df1.groupby('SUB').ffill().groupby('SUB').bfill().drop_duplicates()
#5.89 ms ± 1.84 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
# as time constraints, without use of lambda operation
#df1.groupby(df1.SUB.ffill()).apply(lambda x: x.ffill().bfill()).drop_duplicates()
#16 ms ± 1.06 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
Out:
SUB CAT CODE CODE1 SUB
2 123 SKU 1000123 NaN 123
3 123 SKU 1000234 NaN 123
6 456 LIQ NaN 1000345 456
7 456 LIQ NaN 1000534 456
8 456 LIQ NaN 1000433 456
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
add a comment |
IIUC,
df.set_index('col1').groupby(df.col1.eq('SUB').cumsum().values).apply(lambda s: pd.DataFrame(
'SUB': s.loc['SUB'].item(),
'CAT': s.loc['CAT'].item(),
s.index[2]: s.loc[s.index[2]].col2.tolist()
)).reset_index(drop=True)
Outputs
SUB CAT CODE CODE1
0 123 SKU 1000123 NaN
1 123 SKU 1000234 NaN
2 456 LIQ NaN 1000345
3 456 LIQ NaN 1000534
4 456 LIQ NaN 1000433
However, this looks like an XY problem. Maybe it's worth taking a look into how you ended up with this df in the first place
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
add a comment |
IIUC
l=[y.set_index('0').T.set_index(['SUB','CAT']).stack() for x , y in df.groupby(df['0'].eq('SUB').cumsum())]
s=pd.concat(l).to_frame('v')
s.assign(key=s.groupby(level=[0,1,2]).cumcount()).set_index('key',append=True).unstack(2)
v
0 CODE CODE1
SUB CAT key
123 SKU 0 1000123 NaN
1 1000234 NaN
456 LIQ 0 NaN 1000345
1 NaN 1000534
2 NaN 1000433
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325191%2fpandas-groupby-transpose%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can try of using df.pivot followed by .ffill(),bfill() for the specific 'SUB' column group rows.
df1 = df.pivot(columns='0')
df1.columns = df1.columns.map(lambda x: x[1])
df1.SUB = df1.SUB.ffill()
df1.groupby('SUB').ffill().groupby('SUB').bfill().drop_duplicates()
#5.89 ms ± 1.84 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
# as time constraints, without use of lambda operation
#df1.groupby(df1.SUB.ffill()).apply(lambda x: x.ffill().bfill()).drop_duplicates()
#16 ms ± 1.06 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
Out:
SUB CAT CODE CODE1 SUB
2 123 SKU 1000123 NaN 123
3 123 SKU 1000234 NaN 123
6 456 LIQ NaN 1000345 456
7 456 LIQ NaN 1000534 456
8 456 LIQ NaN 1000433 456
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
add a comment |
You can try of using df.pivot followed by .ffill(),bfill() for the specific 'SUB' column group rows.
df1 = df.pivot(columns='0')
df1.columns = df1.columns.map(lambda x: x[1])
df1.SUB = df1.SUB.ffill()
df1.groupby('SUB').ffill().groupby('SUB').bfill().drop_duplicates()
#5.89 ms ± 1.84 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
# as time constraints, without use of lambda operation
#df1.groupby(df1.SUB.ffill()).apply(lambda x: x.ffill().bfill()).drop_duplicates()
#16 ms ± 1.06 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
Out:
SUB CAT CODE CODE1 SUB
2 123 SKU 1000123 NaN 123
3 123 SKU 1000234 NaN 123
6 456 LIQ NaN 1000345 456
7 456 LIQ NaN 1000534 456
8 456 LIQ NaN 1000433 456
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
add a comment |
You can try of using df.pivot followed by .ffill(),bfill() for the specific 'SUB' column group rows.
df1 = df.pivot(columns='0')
df1.columns = df1.columns.map(lambda x: x[1])
df1.SUB = df1.SUB.ffill()
df1.groupby('SUB').ffill().groupby('SUB').bfill().drop_duplicates()
#5.89 ms ± 1.84 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
# as time constraints, without use of lambda operation
#df1.groupby(df1.SUB.ffill()).apply(lambda x: x.ffill().bfill()).drop_duplicates()
#16 ms ± 1.06 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
Out:
SUB CAT CODE CODE1 SUB
2 123 SKU 1000123 NaN 123
3 123 SKU 1000234 NaN 123
6 456 LIQ NaN 1000345 456
7 456 LIQ NaN 1000534 456
8 456 LIQ NaN 1000433 456
You can try of using df.pivot followed by .ffill(),bfill() for the specific 'SUB' column group rows.
df1 = df.pivot(columns='0')
df1.columns = df1.columns.map(lambda x: x[1])
df1.SUB = df1.SUB.ffill()
df1.groupby('SUB').ffill().groupby('SUB').bfill().drop_duplicates()
#5.89 ms ± 1.84 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
# as time constraints, without use of lambda operation
#df1.groupby(df1.SUB.ffill()).apply(lambda x: x.ffill().bfill()).drop_duplicates()
#16 ms ± 1.06 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
Out:
SUB CAT CODE CODE1 SUB
2 123 SKU 1000123 NaN 123
3 123 SKU 1000234 NaN 123
6 456 LIQ NaN 1000345 456
7 456 LIQ NaN 1000534 456
8 456 LIQ NaN 1000433 456
edited Mar 24 at 16:33
answered Mar 24 at 15:49
Naga KiranNaga Kiran
2,5491617
2,5491617
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
add a comment |
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
1
1
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
Nice. this seems more readable. I will mark this as the answer for now. I will also try implementing in my prod files and let you know. :) Thanks again for your time
– anky_91
Mar 24 at 16:42
1
1
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
Glad to help, happy coding :-) @anky_91
– Naga Kiran
Mar 24 at 16:47
add a comment |
IIUC,
df.set_index('col1').groupby(df.col1.eq('SUB').cumsum().values).apply(lambda s: pd.DataFrame(
'SUB': s.loc['SUB'].item(),
'CAT': s.loc['CAT'].item(),
s.index[2]: s.loc[s.index[2]].col2.tolist()
)).reset_index(drop=True)
Outputs
SUB CAT CODE CODE1
0 123 SKU 1000123 NaN
1 123 SKU 1000234 NaN
2 456 LIQ NaN 1000345
3 456 LIQ NaN 1000534
4 456 LIQ NaN 1000433
However, this looks like an XY problem. Maybe it's worth taking a look into how you ended up with this df in the first place
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
add a comment |
IIUC,
df.set_index('col1').groupby(df.col1.eq('SUB').cumsum().values).apply(lambda s: pd.DataFrame(
'SUB': s.loc['SUB'].item(),
'CAT': s.loc['CAT'].item(),
s.index[2]: s.loc[s.index[2]].col2.tolist()
)).reset_index(drop=True)
Outputs
SUB CAT CODE CODE1
0 123 SKU 1000123 NaN
1 123 SKU 1000234 NaN
2 456 LIQ NaN 1000345
3 456 LIQ NaN 1000534
4 456 LIQ NaN 1000433
However, this looks like an XY problem. Maybe it's worth taking a look into how you ended up with this df in the first place
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
add a comment |
IIUC,
df.set_index('col1').groupby(df.col1.eq('SUB').cumsum().values).apply(lambda s: pd.DataFrame(
'SUB': s.loc['SUB'].item(),
'CAT': s.loc['CAT'].item(),
s.index[2]: s.loc[s.index[2]].col2.tolist()
)).reset_index(drop=True)
Outputs
SUB CAT CODE CODE1
0 123 SKU 1000123 NaN
1 123 SKU 1000234 NaN
2 456 LIQ NaN 1000345
3 456 LIQ NaN 1000534
4 456 LIQ NaN 1000433
However, this looks like an XY problem. Maybe it's worth taking a look into how you ended up with this df in the first place
IIUC,
df.set_index('col1').groupby(df.col1.eq('SUB').cumsum().values).apply(lambda s: pd.DataFrame(
'SUB': s.loc['SUB'].item(),
'CAT': s.loc['CAT'].item(),
s.index[2]: s.loc[s.index[2]].col2.tolist()
)).reset_index(drop=True)
Outputs
SUB CAT CODE CODE1
0 123 SKU 1000123 NaN
1 123 SKU 1000234 NaN
2 456 LIQ NaN 1000345
3 456 LIQ NaN 1000534
4 456 LIQ NaN 1000433
However, this looks like an XY problem. Maybe it's worth taking a look into how you ended up with this df in the first place
answered Mar 24 at 15:29
rafaelcrafaelc
30.5k83154
30.5k83154
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
add a comment |
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
Thanks a lot, yes, actually it looks like an XY, i am aware of that. :) However the file is from SAP and the format in the file is nothing but one line with bad formattings. :) I will look into it and let you know shortly.
– anky_91
Mar 24 at 15:32
add a comment |
IIUC
l=[y.set_index('0').T.set_index(['SUB','CAT']).stack() for x , y in df.groupby(df['0'].eq('SUB').cumsum())]
s=pd.concat(l).to_frame('v')
s.assign(key=s.groupby(level=[0,1,2]).cumcount()).set_index('key',append=True).unstack(2)
v
0 CODE CODE1
SUB CAT key
123 SKU 0 1000123 NaN
1 1000234 NaN
456 LIQ 0 NaN 1000345
1 NaN 1000534
2 NaN 1000433
add a comment |
IIUC
l=[y.set_index('0').T.set_index(['SUB','CAT']).stack() for x , y in df.groupby(df['0'].eq('SUB').cumsum())]
s=pd.concat(l).to_frame('v')
s.assign(key=s.groupby(level=[0,1,2]).cumcount()).set_index('key',append=True).unstack(2)
v
0 CODE CODE1
SUB CAT key
123 SKU 0 1000123 NaN
1 1000234 NaN
456 LIQ 0 NaN 1000345
1 NaN 1000534
2 NaN 1000433
add a comment |
IIUC
l=[y.set_index('0').T.set_index(['SUB','CAT']).stack() for x , y in df.groupby(df['0'].eq('SUB').cumsum())]
s=pd.concat(l).to_frame('v')
s.assign(key=s.groupby(level=[0,1,2]).cumcount()).set_index('key',append=True).unstack(2)
v
0 CODE CODE1
SUB CAT key
123 SKU 0 1000123 NaN
1 1000234 NaN
456 LIQ 0 NaN 1000345
1 NaN 1000534
2 NaN 1000433
IIUC
l=[y.set_index('0').T.set_index(['SUB','CAT']).stack() for x , y in df.groupby(df['0'].eq('SUB').cumsum())]
s=pd.concat(l).to_frame('v')
s.assign(key=s.groupby(level=[0,1,2]).cumcount()).set_index('key',append=True).unstack(2)
v
0 CODE CODE1
SUB CAT key
123 SKU 0 1000123 NaN
1 1000234 NaN
456 LIQ 0 NaN 1000345
1 NaN 1000534
2 NaN 1000433
answered Mar 24 at 15:31
WeNYoBenWeNYoBen
137k84575
137k84575
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325191%2fpandas-groupby-transpose%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is there always one
CATperSUB?– Jondiedoop
Mar 24 at 15:12
@Jondiedoop thanks for taking a look, yes there is just CAT per SUB. Basically its like a category. :)
– anky_91
Mar 24 at 15:13