So i have the following line of code.

`df[['Steps','CampaignSource','UserId']].groupby(['Steps','CampaignSource']).apply(lambda x : x.nunique() if x.name[0] != '9.2-Finalizado' else x.count())`

Which as can see i apply a condition based on a groups key specifically the first one. But the thing is i get this weird end result, which basically gives me two more columns than i would like.

[![enter image description here](https://i.stack.imgur.com/GeCSm.png)](https://i.stack.imgur.com/GeCSm.png)

Any clues on the why, i would like that only UserId returns. if necessary i can provide a sample df.