0

i'm a newbie in Pandas. I'm actually struggling with Cohort analysis.

I have :

Cohort_Group  Cohort_period
2015-06       2015-06          1
2015-07       2015-07          2
2015-08       2015-08          2
2015-09       2015-09          1
2015-10       2015-10          1
2015-11       2015-11          1
2015-12       2015-12          1

Name: Cohort_period, dtype: int64

And i want to obtain :

Cohort_Group  Cohort_period
2015-06       2015-06          1
              2015-07          2
              2015-08          2
              2015-09          1
              2015-10          1
              2015-11          1
              2015-12          1

Name: client, dtype: int64

I tried to use pandas help with multiindex but i didn't sort it out !

LuFFy
  • 8,799
  • 10
  • 41
  • 59
jeremie
  • 9
  • 1
  • 1
    Welcome to StackOverflow. Please take the time to read this post on [how to provide a great pandas example](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) may also be useful. – jezrael Jul 04 '18 at 10:27
  • Can you please post a sample of the original data frame before you made any modifications. – Kbbm Jul 04 '18 at 18:34

0 Answers0