title: Collecting the result of PySpark Dataframe filter into a variable
body: <p>I am using the <code>PySpark</code> dataframe. My dataset contains three attributes, <code>id</code>, <code>name</code> and <code>address</code>. I am trying to delete the corresponding row based on the <code>name</code> value. What I've been trying is to get unique <code>id</code> of the row I want to delete</p>
  
  <pre><code>ID = df.filter(df["name"] == "Bruce").select(df["id"]).collect()
  </code></pre>
  
  <p>The output I am getting is the following: <code>[Row(id='382')]</code></p>
  
  <p>I am wondering how can I use <code>id</code> to delete a row. Also, how can i replace certain value in a dataframe with another? For example, replacing all <code>values == "Bruce"</code> with <code>"John"</code></p>