title: Selecting only numeric/string columns names from a Spark DF in pyspark
body: <p>I have a Spark DataFrame in Pyspark (2.1.0) and I am looking to get the names of numeric columns only or string columns only.</p>
  <p>For example, this is the Schema of my DF:</p>
  <pre class="lang-text prettyprint-override"><code>root
   |-- Gender: string (nullable = true)
   |-- SeniorCitizen: string (nullable = true)
   |-- MonthlyCharges: double (nullable = true)
   |-- TotalCharges: double (nullable = true)
   |-- Churn: string (nullable = true)
  </code></pre>
  <p>This is what I need:</p>
  <pre><code>num_cols = [MonthlyCharges, TotalCharges]
  str_cols = [Gender, SeniorCitizen, Churn]
  </code></pre>
  <p>How can I make it?</p>