0

How to create a dataframe with two columns, namely p_vals and t_vals, containing values obtained from GeneralizedLinearRegression, that is summary.tValues() and summary.pValues(). Both of those values are of double[] type. My question is how can I convert summary.tValues() and summary.pValues() to column types so the dataframe can be created. I am trying to do this in Java.

I have tried the following, which didn't work due to the argument type mismatch.

df = df.withColumn("T Values", summary.tValues())
   .withColumn("P Values", summary.pValues());
Al Sweigart
  • 11,566
  • 10
  • 64
  • 92
nardaj
  • 1
  • did you tried lit function like this lit(summary.pValues()) ? – Ramdev Sharma Jan 29 '19 at 16:14
  • 4
    Possible duplicate of [How to convert List\[Double\] to Columns?](https://stackoverflow.com/questions/36382052/how-to-convert-listdouble-to-columns) – vdep Jan 29 '19 at 16:32

0 Answers0