title: How to check if data frame column value appears in all unique year in the data frame column
body: <pre><code>df1 = pd.DataFrame({'type': ['cst1', 'cst1', 'cst1','cst1','cst2','cst2','cst2','cst3','cst3','cst3','cst3'],'year':[2017,2018,2019,2020,2018,2019,2020,2017,2018,2019,2020]})
  
     type  year
  0   cst1  2017
  1   cst1  2018
  2   cst1  2019
  3   cst1  2020
  4   cst2  2018
  5   cst2  2019
  6   cst2  2020
  7   cst3  2017
  8   cst3  2018
  9   cst3  2019
  10  cst3  2020
  </code></pre>
  <p>For above dataframe need to check with each type value if it is present in the all four years [2017,2018,2019,2020] need to label as 1, other wise 0.
  ex: first type cst1 appeared in all 4 years so labeled as 1, cst2 appeared only in 3 years so labeled as 1.
  Note: Ideally the contains only for four years i,e 2017 - 2020. Type and year combination will be unique.</p>
  <p>desired output:</p>
  <pre><code>type  year label
  0   cst1  2017     1
  1   cst1  2018     1
  2   cst1  2019     1
  3   cst1  2020     1
  4   cst2  2018     0
  5   cst2  2019     0
  6   cst2  2020     0
  7   cst3  2017     1
  8   cst3  2018     1
  9   cst3  2019     1
  10  cst3  2020     1
  </code></pre>