53859/pyspark-dataframe-with-random-values
Hey @Esha, you can use this code. Let me know if it doesn't work:
from pyspark.sql.functions import rand,when df1 = df.withColumn('isVal', when(rand() > 0.5, 1).otherwise(0))
Use the function as following: var notFollowingList=List(9.8,7,6,3 ...READ MORE
Can you share the screenshots for the ...READ MORE
How can I import zip files and ...READ MORE
You can do this by turning off ...READ MORE
The glom function is what you are looking for: glom(self): ...READ MORE
Hi, I am trying to run following things ...READ MORE
Instead of spliting on '\n'. You should ...READ MORE
You can get the configuration details through ...READ MORE
Hi, In Spark, fill() function of DataFrameNaFunctions class is used to replace ...READ MORE
val coder: (Int => String) = v ...READ MORE
OR
Already have an account? Sign in.