title: Pandas Full Name Split into First , Middle and Last Names
body: <p>I have a pandas dataframe with a fullnames field, I want to change the logic so that the First and Last name will have all the first and last word and the rest will go into the middle name field.</p>
  <p>Note: The full name can contain two words in that case middle name will be null and there may be also extra spaces between the names.</p>
  <p>Current Logic:</p>
  <pre><code>fullnames = &quot;Walter John  Ross Schmidt&quot;
  first, middle, *last = name.split()
  print(&quot;First = {first}&quot;.format(first=first))
  print(&quot;Middle = {middle}&quot;.format(middle=middle))
  print(&quot;Last = {last}&quot;.format(last=&quot; &quot;.join(last)))
  
  Output :
  
  First = Walter
  Middle = John
  Last = Ross Schmidt
  </code></pre>
  <p>Expected Output :</p>
  <pre><code>FirstName = Walter
  Middle = John Ross
  Last = Schmidt
  </code></pre>