title: Grouping together columns and populating accordingly
body: <p>I have a dataframe that can have a large amount of columns. The name of each column is 3 identical characters followed by a fourth unique character. I am trying to look at each "group" of columns to determine if they are '-'. If empty, I want to populate each element in each column simply with an 'X'</p>
  
  <p>ex df:</p>
  
  <pre><code>aaa1 aaa2 aaa3 aaa4 bbb1 bbb2 bbb3 bbb4 ccc1 ccc2 ddd1 ggg1 ggg6 ggg8 fff9
   -     -   -    -     1    x   a     -    c   -    a     3    -    -    - 
   -     -   -    -     s    z   1     a    2   -    -     -    -    h    - 
   -     -   -    -     -    x   i     -    c   -    a     3    -    -    - 
   -     -   -    -     -    -   -     -    -   f    -     2    -    2    - 
  </code></pre>
  
  <p>In this example there are two 'blank' groups -- aaa, fff</p>
  
  <p>The resulting df would be like so:</p>
  
  <pre><code>aaa1 aaa2 aaa3 aaa4 bbb1 bbb2 bbb3 bbb4 ccc1 ccc2 ddd1 ggg1 ggg6 ggg8 fff9
   X     X   X    X     1    x   a     -    c   -    a     3    -    -    X 
   X     X   X    X     s    z   1     a    2   -    -     -    -    h    X 
   X     X   X    X     -    x   i     -    c   -    a     3    -    -    X 
   X     X   X    X     -    -   -     -    -   f    -     2    -    2    X
  </code></pre>
  
  <p>The part that has me lost is how to compare the columns as groups. Any ideas would be helpful. </p>