I'm doing a project and there's something I'm curious about pandas groupby(). After I grouped columns with groupby(). I just want to access alphabet column. Can I do it after grouped two columns?
macsx = new_dataset.groupby(['alphabet', 'subject'], as_index=False)['maccs']
net = macsx.apply(lambda _df : _df.iloc[0:20]).reset_index(drop=True)
net
This is the output of the code
I want the output of my code to look like this:
A
A
A
A
.
.
.
Ş
Ş
Ş
If explained more clearly after applying the function to the grouped data set I just want to separate columns again. Now alphabet column can have 1000 rows like maccs column. I am asking if there is a way to do this?
Thank you for now.