title: How to concat all column values in a spark dataframe into a String in Python?
body: <p>I am trying to concat all the values in a column to make a string out of it with comma seperated values. To do that in Scala, I wrote the following code:</p>
  
  <pre><code>val pushLogIds = incLogIdDf.select($"interface_log_id").collect().map(_.getInt(0).toString).mkString(",")
  </code></pre>
  
  <p>I am new to Python and after selecting the values in the column, I am unable to find a logic to Python to concat all the column values to a String after collecting them.</p>
  
  <pre><code>final_log_id_list = logidf.select("interface_log_id").collect()
  </code></pre>
  
  <p>Ex:</p>
  
  <pre><code>interface_log_id
  ----------------
       1
       2
       3
       4
  
  Output: a variable of String containing '1,2,3,4'
  </code></pre>
  
  <p>Could anyone let me know how to concat all the column values of a dataframe into a single String of comma separated values.</p>