title: Conditionally Assign Value to Dask Dataframe using Apply
body: <p>I am trying to iterate through a Dask dataframe and compare the values in one of its columns to a  column in another Dask dataframe with the same name. If the columns match I would like to update the value is the target Dask dataframe. The code below runs, but the values are not updated to '1' where I expected, or anywhere. I am  new to Dask and suspect I am missing some crucial step or am not understanding the framework.</p>
  
  <pre><code>def populateSymptomsDDF(row):
      for vac in row['vac_codes']:
          if vac in symptoms_ddf.columns:
              symptoms_ddf[vac] = symptoms_ddf[vac].where(symptoms_ddf['dog'] == row['dog'], 1)
  
  
  with ProgressBar():
      x = vac_ddf.apply(lambda x: populateSymptomsDDF(x), meta=('int64'), axis=1)
      x.compute(scheduler='processes') 
      symptoms_ddf.compute()
  </code></pre>
  
  <p>Head of icd_ddf:</p>
  
  <pre><code>dog vac_codes
  0   1   [G35, E11.40, R53.1, Z79.899, I87.2]
  1   2   [G35, R53.83, G47.00]
  2   3   [G35, G95.9, R53.83, F41.9]
  3   4   [G35, N53.9, E55.9, Z74.09]
  4   5   [G35, M51.26, R53.1, M47.816, R25.2, G82.50, R...
  </code></pre>
  
  <p>Head of symptoms_ddf (before running code):</p>
  
  <pre><code>dog W19 W10 W05.0   V00.811 R53.83  R53.8   R53.1   R47.9   R47.89  ... G81.12  G81.11  G81.10  G50.0   G31.84  F52.8   F52.31  F52.22  F52.0   F03
  0   1   0   0   0   0   0   0   0   0   0   ... 0   0   0   0   0   0   0   0   0   0
  1   2   0   0   0   0   0   0   0   0   0   ... 0   0   0   0   0   0   0   0   0   0
  2   3   0   0   0   0   0   0   0   0   0   ... 0   0   0   0   0   0   0   0   0   0
  3   4   0   0   0   0   0   0   0   0   0   ... 0   0   0   0   0   0   0   0   0   0
  4   5   0   0   0   0   0   0   0   0   0   ... 0   0   0   0   0   0   0   0   0   0
  </code></pre>
  
  <p>Thank you for any insights you can provide!</p>