How to use python split?
<p>I have some data like that:</p>

<p><img src="http://i.stack.imgur.com/6Jgf7.jpg" alt="enter image description here"></p>

<p>I use split function process data into list.I want to make some data mining in this training set,but I don't know how to separate data as futures like this in python:</p>

<p><img src="http://i.stack.imgur.com/GDBD2.jpg" alt="enter image description here"></p>

<p>By the way,some data are float.Firstly,I want to fill all the data into a list,coding like that:</p>

<pre><code>key_zi = []
for i in range(len(train_set['zi_id'])):
    key_zi = key_zi + train_set['zi_id'][i].split('/')
</code></pre>

<p>but the result call:</p>

<blockquote>
  <p>AttributeError: 'float' object has no attribute 'split'.</p>
</blockquote>

<p>Could you please help me ?</p>

<p>You said that the documentation says</p>

<pre><code>str.split(str="", num=string.count(str))
</code></pre>

<p>What you're missing is that the the first instance of <code>str</code> in this definition is the delimiter for splitting.</p>

<p>Your error is that in this:</p>

<pre><code>  train_set['zi_id'][i].split('/')
</code></pre>

<p>You are trying to call the <code>split</code> method of <code>train_set['zi_id'][i]</code>.   But that thing is a float, not a delimiter string.</p>

python machine-learning