pyspark.RDD.keys — PySpark 4.0.0 documentation (original) (raw)
Return an RDD with the keys of each tuple.
New in version 0.7.0.
Returns
a RDD only containing the keys
Examples
rdd = sc.parallelize([(1, 2), (3, 4)]).keys() rdd.collect() [1, 3]