title: Fill NAs while merging Dask Dataframes
body: <p>I'm trying to do a left join on two Dask Dataframes. In additional to the normal join, I'd like to fill in the NAs of the results with <em>any</em> value from the right Dataframe.</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import dask.dataframe as dd
  a = pd.DataFrame({'index':[1, 2, 3], 'key': ['A', 'B', 'C']})
  left = dd.from_pandas(a, npartitions=1).set_index('index')
  b = pd.DataFrame({'index':[1, 2], 'type': ['X', 'Y']})
  right = dd.from_pandas(b, npartitions=1).set_index('index')
  </code></pre>
  <p><em>left</em> and <em>right</em> are the two data frames.</p>
  <p>Left:</p>
  <pre><code>      key
  index      
  1         A
  2         B
  3         C
  </code></pre>
  <p>Right:</p>
  <pre><code>      type
  index     
  1        X
  2        Y
  </code></pre>
  <p>What I want is</p>
  <pre><code>        key type
  index           
  1         A    X
  2         B    Y
  3         C    X
  </code></pre>
  <p>or</p>
  <pre><code>        key type
  index           
  1         A    X
  2         B    Y
  3         C    Y
  </code></pre>
  <p>Both will work for me and I don't really care if it is 'X' or 'Y' for index 3 for 'type' as long as the value exists in the <em>right</em> dataframe.</p>
  <p>It is possible there are multiple rows or even all rows that cannot be joined with the <em>right</em> dataframe. In this case, I still just need the 'type' value to be from any of the <em>right</em> dataframe.</p>
  <p>One way to do this is:</p>
  <pre><code>res = left.merge(right, how='left', left_index=True, right_index=True)
  res = res.fillna(value=right['type'].head(1).to_numpy()[0])
  </code></pre>
  <p>However, this requires an extra Dask calculation for the <em>head(1)</em> part. As in my case, generating the <em>right</em> dataframe needs a lot of computation, I really want to be able to avoid the extra compute step and have a way to finish it in one run.</p>
  <p>Any suggestion would be appreciated.</p>