Silly Spark SQL query

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Silly Spark SQL query

Aakash Basu-2
Hi,

How to do this when the column (malignant and prediction) names are stored in two respective variables?


tp = test_transformed[(test_transformed.malignant == 1) & (test_transformed.prediction == 1)].count()



Thanks,
Aakash.
Reply | Threaded
Open this post in threaded view
|

Re: Silly Spark SQL query

Aakash Basu-2
Well, it is done.


Using: 

ma = "malignant"
pre = "prediction"
tp_test = test_transformed.filter((col(ma) == "1") & (col(pre) == "1")).count()

On Mon, Jan 28, 2019 at 5:41 PM Aakash Basu <[hidden email]> wrote:
Hi,

How to do this when the column (malignant and prediction) names are stored in two respective variables?


tp = test_transformed[(test_transformed.malignant == 1) & (test_transformed.prediction == 1)].count()



Thanks,
Aakash.