title: Parallelize the process to update the pandas column
body: <ul>
  <li>I have two data frames <code>df_main</code> &amp; <code>df_lookup</code>.</li>
  <li><code>df_main</code> has 219k records with a geo-spatial feature <code>POINT(latitude, longitude)</code>.</li>
  <li><code>df_lookup</code> has 12k records having geo-spatial feature <code>LINESTRING(latitude longitude, ..........., latitude longitude)</code></li>
  <li>Let me show you the dataframe for <code>df_main</code>.</li>
  <li><code>df_lookup</code> is also same, but instead of <code>POINT</code> it has <code>LINESTRING</code></li>
  </ul>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import numpy as np
  df_main = pd.read_csv(&quot;lat_long.csv&quot;)
  df_lookup = pd.read_csv(&quot;line.csv&quot;)
  
  df_main
  
  **Latitude  Longitude   point**
  0   33.94   -80.37  POINT (33.9428727 -80.37280269999999)
  1   42.71   -71.17  POINT (42.715921 -71.17759649999999)
  2   40.75   -73.99  POINT (40.7513773 -73.9924884)
  3   40.51   -78.40  POINT (40.51711 -78.402507)
  4   33.04   -96.86  POINT (33.0458064 -96.86345449999999)
  </code></pre>
  <ul>
  <li>I am trying to get a minimum distance of a point in <code>df_main</code> to all the lines in <code>df_lookup</code>.</li>
  <li>I am also updating the same distance in the column in <code>df_main</code> at each index iteration. Here is the code below :</li>
  </ul>
  <pre class="lang-py prettyprint-override"><code>cnt=0
  for pnt in df_main.point:
      for line in df_lookup.line:
          min_dist = []
          min_dist.append(line.distance(pnt))
  #         print(&quot;Result appended :&quot;, cnt)
      df_main.loc[cnt,'distance_GAF_locations'] = np.min(min_dist)
      df_main.to_csv(&quot;GAF_location_distance.csv&quot;, index = False)
      cnt+=1
  </code></pre>
  <ul>
  <li>This is taking way too much time.</li>
  <li>Is there an easy way to Parallelize this process?</li>
  </ul>