title: Issue with using .take() function with spark 2+ pyspark
body: <p>This is the code I am using. Here it runs fine without data.take but gives error when using it in pyspark python</p>
  
  <pre><code>from pyspark.mllib.recommendation import ALS, MatrixFactorizationModel, Rating
  data = sc.textFile("re_u.data")
  pData=data.take(2000)
  ratings = pData.map(lambda l: l.split(','))\
  .map(lambda l: Rating(int(l[0]), int(l[1]), float(l[2])))
  </code></pre>
  
  <h2>Gives Error</h2>
  
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-12-c9c51af1b2e9&gt; in &lt;module&gt;
        2 data = sc.textFile("re_u.data")
        3 pData=data.take(2000)
  ----&gt; 4 ratings = pData.map(lambda l: l.split(','))\
        5  .map(lambda l: Rating(int(l[0]), int(l[1]), float(l[2])))
  
  AttributeError: 'list' object has no attribute 'map'
  </code></pre>
  
  <p>Update:
  After using your change @Hristo Iliev it helped but encountered another issue that followed with ratings as a list. Thank you for your help!</p>
  
  <pre><code>from pyspark.mllib.recommendation import ALS, MatrixFactorizationModel, Rating
  data = sc.textFile("re_u.data")
  ratings = data.map(lambda l: l.split(','))\
    .map(lambda l: Rating(int(l[0]), int(l[1]), float(l[2])))\
    .take(2000)
  rank = 20
  numIterations = 20
  model = ALS.train(ratings, rank, numIterations)
  
  </code></pre>
  
  <p>Gives error</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-24-7e35afff970b&gt; in &lt;module&gt;
        1 rank = 20
        2 numIterations = 20
  ----&gt; 3 model = ALS.train(ratings, rank, numIterations)
  
  C:\spark\spark-3.0.0-preview2-bin-hadoop2.7\python\pyspark\mllib\recommendation.py in train(cls, ratings, rank, iterations, lambda_, blocks, nonnegative, seed)
      271           (default: None)
      272         """
  --&gt; 273         model = callMLlibFunc("trainALSModel", cls._prepare(ratings), rank, iterations,
      274                               lambda_, blocks, nonnegative, seed)
      275         return MatrixFactorizationModel(model)
  
  C:\spark\spark-3.0.0-preview2-bin-hadoop2.7\python\pyspark\mllib\recommendation.py in _prepare(cls, ratings)
      227         else:
      228             raise TypeError("Ratings should be represented by either an RDD or a DataFrame, "
  --&gt; 229                             "but got %s." % type(ratings))
      230         first = ratings.first()
      231         if isinstance(first, Rating):
  
  TypeError: Ratings should be represented by either an RDD or a DataFrame, but got &lt;class 'list'&gt;.
  </code></pre>
  
  <p>Please help!</p>