| [ Web Proxy ] |
| Viewing: https://spark.apache.org/docs/latest/api/python/reference/api/../api/pyspark.RDD.map.html | [Back] [Original] |
Site Navigation
Site Navigation
Section Navigation
Return a new RDD by applying a function to each element of this RDD.
New in version 0.7.0.
a function to run on each element of the RDD
indicates whether the input function preserves the partitioner, which should be False unless this is a pair RDD and the input function doesnt modify the keys
See also
Examples
>>> rdd = sc.parallelize(["b", "a", "c"])
>>> sorted(rdd.map(lambda x: (x, 1)).collect())
[('a', 1), ('b', 1), ('c', 1)]
Copyright @ 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
Created using Sphinx 4.5.0.
Built with the PyData Sphinx Theme 0.13.3.
| Web Proxy Viewer | New URL | Original Page |