title: Compare two spark dataframes containing floating point numbers for Unittesting
body: <p>I have to write unit tests to compare output from my code, for this I have to compare two pyspark dataframes containing floating point numbers. </p>
  
  <p>When I try to compare them with assetEquals, it fails saying the corresponding values do not match, mostly a problem with floating point comparisons, I want to use something like np.isclose here but I am not sure how, because np.isclose doesn't for for my case. Consider the example below:</p>
  
  <pre><code>df1 =[
              {
                  "customer_id": "1",
                  "e0": 1.1,
                  "e1": 2.2,
                  "e2": 3.3,
                  "e3": 0.0,
              }
          ]
  
  df2 = [
              {
                  "customer_id": "1",
                  "e0": 1.100000000121,
                  "e1": 2.1999999999012,
                  "e2": 3.3,
                  "e3": 0.0,
              }
         ]
  assertEquals(df1, df2).
  </code></pre>
  
  <p>I want both these dfs to be compared at max 5th decimal point, but not sure how to do this.</p>