title: Databricks spark dataframe create dataframe by each column
body: <p>in pandas , I can do something like this .</p>
  <pre><code>data = {&quot;col1&quot; : [np.random.randint(10) for x in range(1,10)],
      &quot;col2&quot; : [np.random.randint(100) for x in range(1,10)]}
  mypd = pd.DataFrame(data)
  mypd
  </code></pre>
  <p>and give the two columns</p>
  <p><a href="https://i.stack.imgur.com/gjPt4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gjPt4.jpg" alt="enter image description here" /></a></p>
  <p>are there any similar way to create a spark dataframe in pyspark ?</p>