title: based on column cell value how to extract specific no# of character from string using python
body: <p>Like Left formula we Used in Excel same as I want to extract no. of character from Policy no. column based on Insurer column like.....</p>
  <p>if insurer is HDFC then Extract only 10 character form the sting and
  if insurer is tata then Extract only 7 character form the sting.
  and <strong>if insurer other than HDFC &amp; tata then leave it as blank.</strong></p>
  <p><em><strong>also see hdfc insure comes with lot of different name.</strong></em></p>
  <p>How I will achieve this in python</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Insurer</th>
  <th style="text-align: left;">Policy no.</th>
  <th style="text-align: left;"><em>Expected OutPut</em></th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Hdfc</td>
  <td style="text-align: left;">4509242332</td>
  <td style="text-align: left;">4509242332</td>
  </tr>
  <tr>
  <td style="text-align: left;">Tata</td>
  <td style="text-align: left;">tatadigitNational</td>
  <td style="text-align: left;">tatadig</td>
  </tr>
  <tr>
  <td style="text-align: left;">Hdfc ergo</td>
  <td style="text-align: left;">09082323ab12sd</td>
  <td style="text-align: left;">09082323ab</td>
  </tr>
  <tr>
  <td style="text-align: left;">HDFC</td>
  <td style="text-align: left;">nolanheroman</td>
  <td style="text-align: left;">nolanherom</td>
  </tr>
  <tr>
  <td style="text-align: left;">Tata</td>
  <td style="text-align: left;">97543007356</td>
  <td style="text-align: left;">9754300</td>
  </tr>
  <tr>
  <td style="text-align: left;">Tata</td>
  <td style="text-align: left;">pqrsequence2o202</td>
  <td style="text-align: left;">pqrsequ</td>
  </tr>
  <tr>
  <td style="text-align: left;">Tata</td>
  <td style="text-align: left;">987654321</td>
  <td style="text-align: left;">9876543</td>
  </tr>
  <tr>
  <td style="text-align: left;">HDFC health ergo</td>
  <td style="text-align: left;">nolanheroman</td>
  <td style="text-align: left;">nolanherom</td>
  </tr>
  <tr>
  <td style="text-align: left;">Digit</td>
  <td style="text-align: left;">1733choola</td>
  <td style="text-align: left;"></td>
  </tr>
  <tr>
  <td style="text-align: left;">star</td>
  <td style="text-align: left;">naahiHonaar</td>
  <td style="text-align: left;"></td>
  </tr>
  </tbody>
  </table>
  </div>