title: How to write some encoding function in Python Pandas?
body: <p>I need to write a string encoding function that returns the output as follows:</p>
  <pre><code>encode_string(&quot;Jack000Jons000446&quot;) ➞ { &quot;given_name&quot;: &quot;Jack&quot;,
  &quot;family_name&quot;: &quot;Jons&quot;,
  &quot;id&quot;: &quot;446&quot; 
  } 
  encode_string(&quot;Ann0funs003567&quot;) ➞ { &quot;given_name&quot;: &quot;Ann&quot;,
  &quot;family_name&quot;: &quot;funs&quot;,
  &quot;id&quot;: &quot;3567&quot; 
  } 
  </code></pre>
  <p>Furthermore:</p>
  <ul>
  <li>The string will always come in the same positional order</li>
  <li>The field &quot;id&quot; will never contain 0's</li>
  </ul>
  <p>How can I write this type of function in Python Pandas/Numpy ?</p>