title: Creating Spark dataframe from numpy matrix
body: <p>it is my first time with PySpark, (Spark 2), and I'm trying to create a toy dataframe for a Logit model. I ran successfully the <a href="https://spark.apache.org/docs/2.1.0/ml-classification-regression.html" rel="noreferrer">tutorial</a> and would like to pass my own data into it. </p>
  
  <p>I've tried this:</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>%pyspark
  import numpy as np
  from pyspark.ml.linalg import Vectors, VectorUDT
  from pyspark.mllib.regression import LabeledPoint
  
  df = np.concatenate([np.random.randint(0,2, size=(1000)), np.random.randn(1000), 3*np.random.randn(1000)+2, 6*np.random.randn(1000)-2]).reshape(1000,-1)
  df = map(lambda x: LabeledPoint(x[0], Vectors.dense(x[1:])), df)
  
  mydf = spark.createDataFrame(df,["label", "features"])
  </code></pre>
  
  <p>but I cannot get rid of : </p>
  
  <pre class="lang-python prettyprint-override"><code>TypeError: Cannot convert type &lt;class 'pyspark.ml.linalg.DenseVector'&gt; into Vector
  </code></pre>
  
  <p>I'm using the ML library for vector and the input is a double array, so what's the catch, please? It should be fine according to the <a href="https://spark.apache.org/docs/2.0.2/api/java/org/apache/spark/ml/linalg/Vectors.html" rel="noreferrer">documentation</a>. </p>
  
  <p>Many thanks.</p>