title: Sepration of words and count in columns and seperate then in two words
body: <p>I have a data set:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Words</th>
  <th>Count</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Hello,World</td>
  <td></td>
  </tr>
  <tr>
  <td>World,%,Hello,Germany</td>
  <td></td>
  </tr>
  <tr>
  <td>Germany,100,ML,Germnay</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div><h3>My Goal:</h3>
  <p>I would that the Code does:</p>
  <ul>
  <li>Separate the Words: (<code>&quot;Hello,World&quot;</code>) ---&gt; (<code>&quot;Hello&quot;,&quot;World&quot;</code>)</li>
  <li>Lists all separated Words in new columns behind each other</li>
  <li>Count the frequency of Words and put the results in &quot;Count&quot; e.g. it finds two times the world &quot;Hello&quot; in column &quot;Words&quot;</li>
  </ul>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Words</th>
  <th>Counts</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Hello</td>
  <td>2</td>
  </tr>
  <tr>
  <td>World</td>
  <td>2</td>
  </tr>
  <tr>
  <td>%</td>
  <td>1</td>
  </tr>
  <tr>
  <td>100</td>
  <td>1</td>
  </tr>
  <tr>
  <td>ML</td>
  <td>1</td>
  </tr>
  <tr>
  <td>Germany</td>
  <td>3</td>
  </tr>
  </tbody>
  </table>
  </div><h3>What I did:</h3>
  <p>The type of &quot;CL1&quot; is &quot;object&quot;</p>
  <pre><code>import pandas as pd
  import re
  
  separators = &quot;,&quot;
  
  def get_word_len(words: str) -&gt; int:
     return len(re.split(separators, words))
  
  df[&quot;Count&quot;] = df.Words.apply(get_word_len)
  
  print(df)
  </code></pre>
  <p>But it counts the number of words in every cell and NOT the frequency and count of repetition in columns.</p>