Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/206#discussion_r154241686
  
    --- Diff: src/ports/postgres/modules/stats/correlation.py_in ---
    @@ -180,31 +180,29 @@ def _populate_output_table(schema_madlib, 
source_table, output_table,
                 function_name = "Correlation"
                 agg_str = "{0}.correlation_agg(x, mean)".format(schema_madlib)
     
    +        cols = ','.join(["coalesce(" + col + ", avg_"+col+") "
    +                            for col in col_names])
    +        avgs = ','.join(["avg(" + col + ") AS avg_" + col + ""
    --- End diff --
    
    IMO, easier to read the above two strings without the concatenations i.e. 
    ```
    cols = ','.join(["coalesce({0}, avg_{0})".format(col) for col in col_names])
    avgs = ','.join(["avg({0}) AS avg_{0}".format(col) for col in col_names])
    ```


---

Reply via email to