Reputation: 97
I want create a new column in spark containing floating point random numbers but i want to generate the same output always i.e i want to use a fix seed value as 102101.
Upvotes: 0
Views: 142
Reputation: 5526
Try this
from pyspark.sql.functions import rand
df.withColumn('RandomNumber', rand(seed=10))
Upvotes: 1