title: Create a boolean column and fill it if other column contains a particular string in Pyspark
body: <p>I am new to Pyspark Dataframe.</p>
  <p>I have a pyspark dataframe which has a column which contains value in below format</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Col1</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">a+</td>
  </tr>
  <tr>
  <td style="text-align: left;">b+</td>
  </tr>
  <tr>
  <td style="text-align: left;">a-</td>
  </tr>
  <tr>
  <td style="text-align: left;">b-</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to create another boolean column (Col2). Value for this column will be true if Col1 is having + in its value else it will be False.</p>
  <p>I tried below code after research on Googleverse but it gave  unexpected EOF while parsing error</p>
  <pre><code>DF = DF.withColumn(&quot;col2&quot;, F.when(DF.filter(DF.col1.like('+')), True).otherwise(False)
  </code></pre>
  <p>I also tried below code but that is also giving error Condition should be a column</p>
  <pre><code>df = DF.withColumn(&quot;col2&quot;, F.when(DF.filter(&quot;col1 like '%-%'&quot;)==&quot;-&quot;, True).otherwise(False))
  </code></pre>
  <p>Please assist me on this</p>