title: how to add specific column related to other column in data frame
body: <p>i want to add specific column that related to other column in dataframe</p>
  
  <p>this is my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import numpy as np
  
  df = pd.DataFrame(
      data={'index': ['1','2','3','4','5','6','7','8','9','10'], 
      'charac' : ['A','A','A','A','A','A','A','B','B','B']})
  </code></pre>
  
  <p>When it's the same in 'charac', it goes on continuously.
  but it's different in 'charac', it starts again </p>
  
  <p>like this <code>'add_col' = [1,2,3,4,5,6,7,1,2,3]</code></p>
  
  <p>i think it can be work with 'for' but i don't know how to do .... 
  could you tell me the answer ..?</p>