title: Using pandas functions with Pyspark
body: <p>I'm trying to rewrite my Python script (Pandas) with Pyspark, but I can't find a way to apply my Pandas functions in a way to be more efficient with Pyspark functions:</p>
  <p>my functions are the following:</p>
  <pre class="lang-py prettyprint-override"><code>def decompose_id(id_flight):
      
      my_id=id_flight.split(&quot;_&quot;)
      Esn=my_id[0]
      Year=my_id[3][0:4]
      Month=my_id[3][4:6]
  
  return Esn, Year, Month
  
  def reverse_string(string):
    stringlength=len(string) # calculate length of the list
    slicedString=string[stringlength::-1] # slicing 
    return slicedString
  </code></pre>
  <p>I would like to apply the first function to a column of a dataframe (in Pandas I get a row of three elements)
  The second functions is used when a condition of a column of a DataFrame is verified</p>
  <p>is there a method to apply them using Pyspark dataframes?</p>