title: Python - Map with Split Option output Difference
body: <p>I'm a newbie to python just trying to understand why the output is like this.</p>
  
  <p>1) </p>
  
  <pre><code>strr=['asdfasdf','asdf','sdf','sdf']
  
  stak=map(lambda l:l.split(','),strr)
  
  print(stak)
  </code></pre>
  
  <p>When i execute the first set, the output would be of the format as below which is understandable 
  because, the split returns a list and the collect as well returns a list and hence the lists inside 
  the list</p>
  
  <pre><code>[['asdfasdf'], ['asdf'], ['sdf'], ['sdf']]
  </code></pre>
  
  <p>2) </p>
  
  <pre><code>str='asdfasdf,asdf,sdf,sdf'
  
  sc.parallelize(str).map(lambda l:l.split(',')).collect()
  
  print(str)
  </code></pre>
  
  <p>Now check the 2nd case, the below action should have also done the same as above and should have 
  given the similar output. But instead its giving the output as below. What i don't get it, why has 
  the characters been separated into separate lists. Could anyone please explain why difference in 
  outputs in 1 and 2?</p>
  
  <pre><code>[['a'],
   ['s'],
   ['d'],
   ['f'],
   ['a'],
   ['s'],
   ['d'],
   ['f'],
   ['', ''],
   ['a'],
   ['s'],
   ['d'],
   ['f'],
   ['', ''],
   ['s'],
   ['d'],
   ['f'],
   ['', ''],
   ['s'],
   ['d'],
   ['f']]
  </code></pre>