title: Finding the right value based on comma separated date and value after @ symbol in python
body: <p>Python newbie here. I have a dataframe in this kind of format</p>
  
  <pre><code>Col_A     String                                       Date
  X         1/1/2018@12,01/24/2020@11                    6/14/2019
  Y         1/1/2018@13,01/24/2019@15,08/07/2020@17      8/5/2021
  Z         1/1/2018@13,01/24/2019@15,08/07/2020@17      1/23/2019
  </code></pre>
  
  <p>Here's what I'm attempting to do</p>
  
  <pre><code>Col_A     String                                       Date         Value_I_want
  X         1/1/2018@12,01/24/2020@11                    6/14/2019     12
  Y         1/1/2018@13,01/24/2020@15,08/07/2020@17      8/5/2021      17
  Z         1/1/2018@13,01/24/2019@15,08/07/2020@17      1/20/2019     15
  </code></pre>
  
  <p>Basically the dates mentioned are starting dates for the new value which is followed by the '@' symbol. In the case of the first row in my eg, from 1/1/2018 to 1/23/2020, the value remains 12 but changes to 11 starting on 1/24/2020 onwards.</p>
  
  <p>I'm looking to extract the value that follows the '@' based on the date in the 'Date' column. </p>
  
  <p>The number of values separated by commas can vary for each row. In some rows it can just be a the value without any date or a comma separation.</p>
  
  <p>How exactly do I go about this? Any help is greatly appreciated.</p>
  
  <p>Thanks :)</p>
  
  <p>Edit:
  Adding an edit to clarify my question:
  The string is actually a range of dates. Let me just take string on row 2 as an eg:</p>
  
  <pre><code>1/1/2018@13,01/24/2020@15,08/07/2020@17
  </code></pre>
  
  <p>What it actually means:</p>
  
  <pre><code>Date in string         value
  1/1/2018               13
  1/2/2018               13
  1/3/2018               13
  ...
  1/23/2020              13
  1/24/2020              15
  1/25/2020              15
  ...
  08/06/2020             15
  08/07/2020             17
  08/08/2020             17
  </code></pre>
  
  <p>So with the 'Date' column in the dataframe which is a single date, the logic I'm trying to implement is similar to below. (Explaining with line 2 as eg)</p>
  
  <pre><code>if 8/5/2021 is between 1/1/2018 and 1/23/2018 then value = 13
  else if 8/5/2021 is between 1/24/2019 and 08/06/2020 then value = 15
  else if 8/5/2021 is greater than 08/07/2020 then value = 17
  </code></pre>