Answers for "select n rows pyspark"

0

select n rows pyspark

l = [('Alice', 1),('Jim',2),('Sandra',3)]
df = sqlContext.createDataFrame(l, ['name', 'age'])
df.limit(2).withColumn('age2', df.age + 2).toPandas()
Posted by: Guest on April-26-2021

Browse Popular Code Answers by Language