I'm trying to use the rand function in PySpark to generate a column with random numbers. I would like the rand function to take in the primary key of the row as the seed so that the number is reproducible. However, when I run:
df.withColumn('rand_key', F.rand(F.col('primary_id')))
I get the error
TypeError: 'Column' object is not callable
How can I use the value in the row as my rand seed?