I'm wondering how to filter and summarise the following DF using a single line code into a new dataframe (DF1). In other words, how to filter different row ranges (separately) for each column nomenclature (group A and B) and returning the mean.for each sub group.
So far, thats what I have found:
Sorry, I don't understand what you're trying to do. It would help if you a) formatted the example data so it's easier to read and, more important, b) showed your desired output for the example data.
Hi there. Thanks for the prompt reply. I had already tried using group_by, however, for the same group (lets say , group A) there are two ranges or subsets (1:3) and (4:6). I need the mean values for these subsets separately. The ideia is pretty easy, but getting this piped into a single line code is the point.